-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make safe_name compliant to PEP 503 and behaviour of pip > 8.1.2 #1324
Conversation
According to PEP 503, a "normalized" project name has all runs of the characters ., - and _ replaced with a single - character. [0] Similarly, since version 8.1.2, that is the behaviour of pip as well. [1] However, Setuptools still allows a . in the normalized name, which is causing trouble down the line. [0] https://www.python.org/dev/peps/pep-0503/#normalized-names [1] pypa/pip#3666
The tests failed as expected, because they're testing the wrong specification (with dots allowed in "normalized" projects name). If the change is approved I can fix the tests as well. |
This change seems reasonable. What is the impact for the users (package maintainers and consumers)? Are there compatibility concerns for an environment that transitions from the old behavior to the new? |
In Fedora, all packages provide a tag with their canonical name ( See: https://bugzilla.redhat.com/show_bug.cgi?id=1564095
We just discovered the incompatibility in Fedora thus no issues are expected. And given that pip handles this correctly for a long time now (8.1.2 released on 2016-05-10) and does not accept dots in the name, IMHO it's more dangerous to leave setuptools incompatible than to fix it. |
There don't seem to be any objections to this; I think it's ok to merge once the tests are updated and a changelog.d entry is added. The documentation already matches the intended behavior. |
I think that in tests
it should read
instead. This, in turn will still fail as there is FAIL in the stdout, i.e.
|
@silkentrance In order to avoid more delays, I've decided to make this merge without addressing your concern, but I would welcome a PR according to your suggestion. |
Well heck. I thought I saw tests were passing, but now I see that tests are failing (as Jeremy pointed out). I'm going to revert the changes. |
And I am not going to make a PR for this trivial. |
According to PEP 503, a "normalized" project name has all runs of the
characters ., - and _ replaced with a single - character. [0]
Similarly, since version 8.1.2, that is the behaviour of pip as well. [1]
However, Setuptools still allows a . in the normalized name, which
is causing trouble down the line.
[0] https://www.python.org/dev/peps/pep-0503/#normalized-names
[1] pypa/pip#3666