Skip to content

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

@fpgmaas

Description

@fpgmaas

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions