Skip to content

Conversation

minrk
Copy link
Member

@minrk minrk commented Dec 14, 2015

avoids mismatch between wheel/sdist upload on PyPI due to setuptools normalization of prerelease tags.

alternative to #860

avoids mismatch between wheel/sdist upload on PyPI due to setuptools normalization of prerelease tags.
@Carreau Carreau added this to the 4.1 milestone Dec 14, 2015
@takluyver
Copy link
Member

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.

@minrk
Copy link
Member Author

minrk commented Dec 14, 2015

@takluyver From #860, I think @Carreau feels the same, which should amount to moving this same function to _version.py and producing __version__ with it.

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.

@Carreau
Copy link
Member

Carreau commented Dec 14, 2015

I'll have @parleur merge the 2 PRs in one later today, and will re-examine the Pep.

@Carreau
Copy link
Member

Carreau commented Dec 14, 2015

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.

Also I'm not sure I get that :

The canonical public version identifiers MUST comply with the following scheme:
[N!]N(.N)*[{a|b|rc}N][.postN][.devN]

I don't see any way to have a dot followed by a a, b or rc

But I may be missing a part of the Pep, hence why I'll be re-reading.

@Carreau
Copy link
Member

Carreau commented Dec 14, 2015

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.

@minrk
Copy link
Member Author

minrk commented Dec 14, 2015

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:])

@minrk minrk closed this Dec 14, 2015
@Carreau
Copy link
Member

Carreau commented Dec 14, 2015

One of the issues with version_info = (4, 1, 0, '.dev0') is it will most of the time be (4,1,0) which will lead to us forgetting the . on next release.

Would you version plus a normalisation in setup.py and a unit-test be an acceptable compromise?

Also the '.'.joincan be seen as an extra-expensive runtime computation :-P

@minrk
Copy link
Member Author

minrk commented Dec 14, 2015

One of the issues with version_info = (4, 1, 0, '.dev0') is it will most of the time be (4,1,0) which will lead to us forgetting the . on next release.

No, 99.9% of the time it will be version_info = (4, 1, 0, '.dev0'). It's only (4, 1, 0) for one commit, and the next commit is always putting it back to '.dev0'.

@minrk
Copy link
Member Author

minrk commented Dec 14, 2015

Would you version plus a normalisation in setup.py and a unit-test be an acceptable compromise?

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants