-
Notifications
You must be signed in to change notification settings - Fork 5.4k
normalize version in setup.py #862
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
Conversation
avoids mismatch between wheel/sdist upload on PyPI due to setuptools normalization of prerelease tags.
|
I like the extra complexity going into setup code rather than the actual modules, but my preference would be that we use PEP whatever compliant version numbers directly, and add some code to assert that they are correct rather than normalising them. |
|
@takluyver From #860, I think @Carreau feels the same, which should amount to moving this same function to I don't like the idea that this is forcing us to internally change perfectly valid version numbers that PEP 440 officially allows and supports. |
|
I'll have @parleur merge the 2 PRs in one later today, and will re-examine the Pep. |
Also I'm not sure I get that :
I don't see any way to have a dot followed by a But I may be missing a part of the Pep, hence why I'll be re-reading. |
|
if you are referring to this section about prerelease separator I understand it as applying only to software that have already been released, and so should not be used by newer release. |
|
We shouldn't do any checking at runtime, since that's an unnecessary waste at import time for extremely static code. The check should be made in setup.py at install/dist time. If we are going to embed PEP440 normalization in our version strings, what I'd propose is we put the '.' in the suffix, as the PEP describes them: version_info = (4, 1, 0, '.dev0')
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:]) |
|
One of the issues with Would you version plus a normalisation in setup.py and a unit-test be an acceptable compromise? Also the |
No, 99.9% of the time it will be |
I think testing in tests is perfect. I only mean that we shouldn't be running tests on import, which is currently done in #860. |
avoids mismatch between wheel/sdist upload on PyPI due to setuptools normalization of prerelease tags.
alternative to #860