Skip to content

Allow package name to be different from repository name #154

@eirrgang

Description

@eirrgang

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}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions