You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried moving the template directory to under src/, but then I couldn't generate a project anymore due to a cookiecutter.exceptions.NonTemplatedInputDirException.
I subsequently looked at a bunch of cookiecutter-template repos to see how they did it. Hardly any use the src or src-like patttern. Here's one https://github.com/better-go/cookiecutter-go. From its readme, I was able to run our template using an extra argument --directory
Activity
moved template files one level deeper to src/; refs #173
jspaaks commentedon Apr 21, 2021
I tried moving the template directory to under
src/, but then I couldn't generate a project anymore due to acookiecutter.exceptions.NonTemplatedInputDirException.I subsequently looked at a bunch of cookiecutter-template repos to see how they did it. Hardly any use the
srcorsrc-like patttern. Here's one https://github.com/better-go/cookiecutter-go. From its readme, I was able to run our template using an extra argument--directoryI also had to move
hooksandcookiecutter.jsonintosrcfor it to work but that's ok i guess.Sidenote: the config from
setup.cfgsuggested at https://packaging.python.org/tutorials/packaging-projects/#configuring-metadata didn't seem to matter much when running withcookiecutter <template dir>. Maybe it would work better if you're using cookiecutter as a library from python code.See result here #203
Overall, this isn't worth it to me, I prefer to stick to what we had before, i.e. the template directory in the root of this project
sverhoeven commentedon Apr 22, 2021
I did not explain myself well enough.
At the moment in this repo we have
to use the structure of https://packaging.python.org/tutorials/packaging-projects/ it would have to be changed to
So when a project (for example named
my_python_package) is generated, its files would be:See for example https://github.com/cjolowicz/cookiecutter-hypermodern-python/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/src/%7B%7Bcookiecutter.package_name%7D%7D/__init__.py, however it does not use setuptools, but poetry so can not be copied fully.
jspaaks commentedon Apr 22, 2021
ok, I'll see if I can make some changes