Turn spaces in project name to underscore.#6085
Conversation
neersighted
left a comment
There was a problem hiding this comment.
This change as-is is much too specific and hardcoded to the particular issue you sought to solve. We should likely normalize all project names during poetry new (e.g. see the canonicalize_name() function in packaging.utils that was most recently discussed in #6022), or reject them outright if they don't meet validity criteria.
|
I see. Since PEP 426 only indicated which characters are allowed in package names. Maybe we should reject all package name with any invalid characters in it (by throwing an error)? |
|
Closing as this is not mergable; a check for invalid characters in a pretty name ( |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Currently, if the project name you typed contains whitespaces, the package name will also contain whitespaces. For example:
will cause test file contain:
which will cause error. In this case, we should automatically change project name to
new_project.I know that set
--nameargument can solve this problem. But I think maybe this process can be automated.I have not include a tests for this PR. Mainly because I have not figured out a suitable testing method, also because this is a draft PR. If anyone have good idea on how to test, please help, thanks.
No documentation change required for this PR.