Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd --package-name option to pcreate. #2783
Conversation
| safe_name = pkg_resources.safe_name(project_name) | ||
| if self.options.package_name is None: | ||
| pkg_name = _bad_chars_re.sub( | ||
| '', project_name.lower().replace('-', '_')) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mmerickel
Oct 3, 2016
Member
Is this code not run on the project name if --package-name is not specified? It seems the pkg_name should be normalized in one spot.
mmerickel
Oct 3, 2016
Member
Is this code not run on the project name if --package-name is not specified? It seems the pkg_name should be normalized in one spot.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
goodwillcoding
Oct 3, 2016
Member
The only change is if package name is given it is assumed to be safe and hence assigned in the else block. The assumption of safety is documented in help for pcreate
goodwillcoding
Oct 3, 2016
Member
The only change is if package name is given it is assumed to be safe and hence assigned in the else block. The assumption of safety is documented in help for pcreate
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mmerickel
Oct 3, 2016
Member
Sorry I read that test wrong, I thought it was is not None. So are we not validating the package name if you specify --package-name?
mmerickel
Oct 3, 2016
Member
Sorry I read that test wrong, I thought it was is not None. So are we not validating the package name if you specify --package-name?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
goodwillcoding
Oct 3, 2016
Member
We are not validating it. Rationale being: if user provide the package name then it's a case where they want a specific one and hence need to know if it is safe. I can add validation of course if you think it is needed.
goodwillcoding
Oct 3, 2016
Member
We are not validating it. Rationale being: if user provide the package name then it's a case where they want a specific one and hence need to know if it is safe. I can add validation of course if you think it is needed.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mmerickel
Oct 3, 2016
Member
Where is the assumption of safety documented? I don't get that from reading the help. Maybe rephrase that sentence slightly because I think has to be a valid python package name implies that it will be validated. Perhaps Assumed to be a valid python package name.
mmerickel
Oct 3, 2016
Member
Where is the assumption of safety documented? I don't get that from reading the help. Maybe rephrase that sentence slightly because I think has to be a valid python package name implies that it will be validated. Perhaps Assumed to be a valid python package name.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bertjwregeer
merged commit 11cbc8f
into
Pylons:master
Oct 3, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Thanks! |
goodwillcoding commentedOct 3, 2016
This solves the problem of scaffold creating an existing directory where the package created should not be named after the base folder. For example if I am in I run pcreate in ~/code/trypyramid.com and
would like to create package called tpc this is currently impossible. This solves the issues by allowing me to specify the package name on the command line.
Note: I'll add changelog changes post review