-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BLD: pandas should generate PEP 440 compliant dev versions #9518
Comments
I'll make a PR for this, which we can merge immediately before or after the release of v0.16.0. That way, dev versions will remain meaningfully ordered. |
if you actually read the PEP it makes it clear pandas itself is not allowed to use local version strings. just so you know. |
@kay1793 I did in fact read the PEP. My main intent here was to preserve the useful identifying nature of existing development versions. Git hashes are an important part of that. We don't make or tag regular development releases of pandas (aside from release candidates), so the This usage is also exactly what versioneer settled on, and I think they provide a compelling justification in the PR adding this: python-versioneer/python-versioneer#67 |
and the PEP says you're wrong.
no.
"developmental release" is not clearly defined in the document, so .devN is probably what the PEP wants you to use. Otherwise, the PEP only concerns itself with official release versions and because pandas makes no official dev releases it can do what it likes during development and still be compliant (and users should use
sure, but not for the setuptools version (all you need there is sorting). git hashes matter in the internal version pandas keeps in
Do you mean:
?? that's not compelling at all. a project can't be its own downstream just like a person can't be his/her own mother. |
Do you really think that pandas should use different version identifiers in
Yes, this is my point exactly. This is not a literal interpretation of PEP 440 guidelines but a pragmatic choice for a gray area that it doesn't cover (unreleased development versions). The only reasonable alternative I've seen is Can you think of any actual situations where such usage would be problematic? |
You'll also notice:
https://www.python.org/dev/peps/pep-0440/#dvcs-based-version-labels Pandas does not actually use a build system for unreleased development versions, so I'm not convinced it even makes sense to have |
do you have a reason you'd like to share for thinking that? I was thinking 0.15.2.dev242 and 0.15.2-242-geadfd92 are practically interchangable.
But it does define what an upstream project is and says you should not use local version strings. Whether you violate that in order to handle some other undefined need is beside the point.
that's not how standards are supposed to work. violating them because "I don't see a problem" is not how standards should be treated. can you think of a reason to abuse a PEP when you don't need to? |
you're not allowed to use local version labels.
what does that have to do with anything?
"uniquely identify" is what you care about, whether a "build system" is involved doesn't matter.
so you're squshing public history in master now?? assuming you don't (you don't really) then the number of commits since the last tag is a unique (ordering) identifier of a commit and that's all you need for setuptools. The convenience of git tag can live in the (or in a) internal version string. setuptools doesn't need to know about it. |
You can install development versions of pandas from source from any branch on any source, not just master. So IMO the number does not suffice. Also, note that 0.15.2.devN < 0.15.2 as far as setup tools is concerned -- hence the need for .post.devN |
I don't understand. your goal is to control version sorting wrt to other commits in other forks and branches now? ok, well good luck with that.
Yes I did miss that and you actually need Still waiting to hear why you think having |
I think using local versions for this is fine - the PEP 440 restriction is intended to be against uploading them to PyPI. Generating them when building directly from a source checkout seems fine to me - in that case, you're not relying on version specifiers, you're giving the VCS URL explicitly. However, you may still want to consider incrementing the version number and switching to "commits since the last tag" dev release numbering - once the previous release has been published, installing from source control is at least arguably a pre-release of the next version, rather than a post-release of the previous one. |
@ncoghlan, The PEP (which you co-wrote... hi there) should say that then, because |
I think part of what is being lost here is that if a user is building from source then they are their own packagers. Using the down-stream post-fix (with the git hash) to make it easy for the upstream devs to understand exactly what version some one is using when they report an issue is a first order good (because 'master' is a moving target). At my day-job we package and distribute internally a number of python packages (at this point mostly our own stuff) and I am sure that we are not unique in this regard. Having the upstream projects set up to emit sensible local patch numbering also seems like a first order good (because I am lazy). @ncoghlan As I understood the pep the There is also existential discussion of what a 'release' is. One can make the case that every git commit that passes tests is a 'release', but this seems like the wrong place to start painting that bike shed. |
Yes, but no one is actually saying the git hash is not useful, only questioning what the PEP (as written) says about upstream using
I'm not so sure - if they're packaging a version that is simply an upstream commit with a version string that upstream decided on? what would be the difference between upstream shipping tarballs and users doing it in this case? it's a de-facto dev release by upstream. I dislike the suggested |
If a user checks out a commit and builds it (turning source -> binary) and then installs it they are doing exactly what a packager does. If upstream suggests a version string, already localized, to be something sensible, they are just being good OSS citizens 😈 . If upstream did a full 'release' with the rigamarole of rebuilding the docs, announcements to the mailing list etc etc that included the |
If you're not touching PyPI (which is the case when installing directly from version control) then PEP 440's guidelines don't have to apply - we're specifically looking to control published version identifiers that need to interact with version specifiers, and hence need to define an unambiguous total ordering. I've filed pypa/interoperability-peps#25 to propose clarifying this directly in the PEP, but in the meantime, if a local version identifier solves your problem, feel free to go that way. Don't tie yourselves in knots trying to stick to the letter of a PEP that doesn't currently cover your situation. |
@shoyer What is the exact format you propose? We have now, depending on git being found or not, the formats
|
I would advocate for |
see here : https://github.com/ContinuumIO/blaze/blob/master/core.recipe/version.py which generates tags like 0.15.2.post226.gelaaf8c we use this now for conda recipes |
My thought was to do On the other hand, maybe including |
I think @tacaswell's suggestion should work fine too, there's nothing confusing about adding .post and users installing these versions know where they came from anyway. @jreback's suggstion is invalid according to the PEP so that doesn't help anything. |
@jreback Your link is dead, did you change your mind about using that method? |
https://github.com/ContinuumIO/blaze/blob/master/core.recipe/meta.yaml they r now doing it directly in the conda build (which is better) |
This makes it more difficult to feed back into the |
Here's a direct link to that |
I tried implemented this change locally. Unfortunately, something about the new version format broke with the old version of pip I was using:
Then I upgraded to the newest pip and things worked fine:
But the version I initially tested (1.5.6) was only released last May. I suspect we'll get some grief if we break lots of dev installs. Not sure if there is really any ideal solution here.... |
Just following up here to say pypa/interoperability-peps#25 has been closed via this tweak to PEP 440: https://hg.python.org/peps/rev/bf4ffb364faf |
I definitely was not using a development version of pip. I can do some more experiments -- it's possible that there was something funny with the setup of that virtual environment... |
I think you got it right. PEP-386 preceded 440 and sanctioned the form:
also included are specific regexps for parsing which include a terminating "$" and so you can't have anything following a While checking this I've discovered pip phones home without asking whenever you run an install to check for updates. that's always a bonus. |
use binstar build OSX stack testing, pandas-dev#7127
use binstar build OSX stack testing, pandas-dev#7127
Doing an inplace install with recent versions of pip (e.g., with
pip install -e .
) currently produces this warning:UserWarning: The version specified ('0.15.2-224-geadfd92') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
We should update setup.py to produce PEP 440 compliant versions such as
'0.15.2+224.geadfd92'
instead. For an example of how to convert between, see python-versioneer/python-versioneer#45 (comment)The text was updated successfully, but these errors were encountered: