morepath / morepath-cookiecutter

A Cookiecutter Template for Morepath

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'-' in package name

q-b opened this issue · comments

commented

Hi,

My first package was named morepath-something, I had to change the - to _ manually, else calling pip failed with a cryptic error message.

console_scripts=[
    'run-app = morepath_something.__main__:run',
                       ^
                      here
],

Thank you anyway for the template!

@href, AFAICS the easiest way to prevent this kind of problem from arising again is to validate the package_name following the example in the docs.

A more sophisticated solution might be to have two separate variables, say project_name and package_name, the latter having as default value a regex'ed version of the former to make it Python friendly.

+1 on not trying to be smart and just not accept it

Thank you @q-b for reporting this issue. The latest commit has a hook that should warn users early:

6cf48ef

@taschini, thanks - I used the example in slightly modified form (cookiecutter's example doesn't accept packages with a single character and they do not handle namespaces).