Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template does not work properly if two different templates are installed. #90

Open
fpgmaas opened this issue Sep 5, 2023 · 0 comments · May be fixed by #91
Open

Template does not work properly if two different templates are installed. #90

fpgmaas opened this issue Sep 5, 2023 · 0 comments · May be fixed by #91
Assignees
Labels
bug Something isn't working

Comments

@fpgmaas
Copy link
Owner

fpgmaas commented Sep 5, 2023

If two templates are installed in an environment at the same time (e.g. this one and cookiecutter-pdm), this causes an issue, since both try to add hooks, {{cookiecutter.project_name}} and cookiecutter.json in the site-packages directory.

This means that only one template is actually installed, and both the commands ccp and ccpdm will trigger the same template. e.g. when installing both packages:

pip install cookiecutter-poetry
pip install cookiecutter-pdm

and then running

ccp
ccpdm

both commands wil create a poetry project!

Solutions

Option 1

A possible solution would be to move the template to a subdirectory:

#91

However, this would mean that the template, if installed from the URL, would need to be installed as follows:

cookiecutter https://github.com/fpgmaas/cookiecutter-poetry.git \
  --directory templates/cookiecutter-poetry

which is less clean and less intuitive. This also breaks the existing functionality.

Option 2

Remove the possibility to install the package, and remove the publishing to pypi. I don't really like this option, because currently it is easy for someone to pin the specific version of the template they want to use by simply installing that version of the template.

Option 3

Find another way to bundle the template with the Python package?

@fpgmaas fpgmaas added the bug Something isn't working label Sep 5, 2023
@fpgmaas fpgmaas self-assigned this Sep 5, 2023
@fpgmaas fpgmaas linked a pull request Sep 5, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant