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

Can we change project_name to package_name? #2

Open
rob-smallshire opened this issue Sep 20, 2021 · 1 comment
Open

Can we change project_name to package_name? #2

rob-smallshire opened this issue Sep 20, 2021 · 1 comment

Comments

@rob-smallshire
Copy link
Contributor

The question being asked by cookie cutter doesn't make it clear that this string will become the package name. Is there a way to provide validation to ensure it's a valid Python identifier, say with a regex?

@abingham
Copy link
Contributor

For the first part, you can change "project_name" to "package_name" in cookiecutter.json. You'll also need to see where that key is used in the template code.

For validation, I think you need to use some hooks: https://cookiecutter.readthedocs.io/en/1.7.2/advanced/hooks.html#example-validating-template-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants