cookiecutter-cms icon indicating copy to clipboard operation
cookiecutter-cms copied to clipboard

Allow package name to be different from repository name

Open eirrgang opened this issue 2 years ago • 1 comments

It is not uncommon for importable packages to have different names than the repositories (or distributions) that hold them, so {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}} should use two distinct variables.

project_name is not a drop-in for either, since it can include spaces and capital letters.

It seems like maybe there should be an additional option declared between repo_name and first_module_name.

Also, it seems a bit odd to default to creating the first module as projectname/projectname.py. Would it be reasonable to change the default to the proposal from the workshop material? (i.e. functions?)

{
    "project_name": "ProjectName",
    "repo_name": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}",
    "package_name": "{{ cookiecutter.repo_name.lower().replace(' ', '_') }}",
    "first_module_name": "functions",
...

Then, the template directory structure can be updated to {{cookiecutter.repo_name}}/{{cookiecutter.package_name}}

eirrgang avatar Aug 12 '22 13:08 eirrgang

For those with access, see also https://molssiedu.slack.com/archives/C03Q6GCCZ1B/p1659622847027609

eirrgang avatar Aug 12 '22 13:08 eirrgang