-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip package upgrade fails to recognise version compatiblity #3984
Comments
From https://pypi.python.org/pypi/python-swiftclient/3.1.0 it looks like python-swiftclient publish a Python 2/3 compatible wheel for that version. And your log shows
which confirms that. If that wheel contains code that isn't valid syntax for a version of Python they claim to support, then that's a packaging bug on their part, and you should report it to them. |
btw, what is actually the correct/canonical way to publish universal wheels that do not support python 2.6 ? |
Simplest answer is to publish two - a Python 2.7 wheel and a Python 3 wheel. |
i see, can we document that somewhere? i presume its also possible to set the implementation tags to py27.py3? |
Yeah, that would probably also work. I'm perfectly OK with documenting it somewhere, but I'm not 100% sure where or how. Publication best practices haven't really settled down to that level yet. (The basic rule, "don't tag a wheel with a version it doesn't support" is both glaringly obvious and also really easy to neglect :-() |
yes, it is, i am guilty of it too - also these days i think we need to get that out to people i think most package authors do not realize they do in fact not support python2.6 but their package claims it |
Radical thought, but maybe these days "universal" should mean py27.py3? If people still want to claim 2.6 support, they have to explicitly request it. That might avoid the worst cases. |
@dholth any opinion on updating wheel to have universal mean that? |
@pfmoore another problem is - that a py3 wheel also doesnt tell about python versions not supported |
@dholth perhapps wheel should deprecate the universal flag and tell people to explicitly specify it |
@RonnyPfannschmidt This is a common misunderstanding. py2.py3 does not mean "supports Python 2.6". It means "supports some version of Python 2, and some version of Python 3". If there is no variant of your package that supports Python 2.6 you still say "py2". Wheel tags are for choosing between different builds of the same version of a package, for example, separate wheels if you are using 2to3 to produce a Python 3 version with different source code, or more commonly, separate wheels for each OS+architecture. With wheel tags the negative is more important: throw away all the available wheels that definitely do not work on your computer, then try to install the higest-ranked one that might. The requires-python metadata does what you want, it is a way to say exactly which Python versions are supported: #3846 |
This is important, because otherwise if you don't have a wheel otherwise available for Python 2.6 and someone attempts to install on Python 2.6, it'll just download the sdist and install that anyways. IF you make the |
@dholth at first glance the whole combination is a mess as for wheels, unless someone puts in the metadata (which at first glance is documented so bad that i have no idea how to specify entries for different major python versions) the wheel that means exactly that |
OK, I'd misunderstood this too (but as @dstufft points out, sdists are not tagged to Python version, so it's never possible to avoid there being an applicable download for every Python version simply based on what you publish). So the options for package authors are:
In the OP's case, none of this is relevant as the project documents that it supports Python 2.6, but it uses constructs that don't work in 2.6. The project should either fix their code, drop support for Python 2.6, or publish a 2.6-only version of the wheel which will be picked up in preference to the universal wheel. |
Stuff doesn't work on Python 2.6, and it doesn't work on Python 3.6 maybe, and it definitely doesn't work on Python 3.0 or 3.2. Sometimes the publisher knows this and could possibly include it in some metadata, but often the publisher accidentally breaks support for Python 2.6 or other Python versions they are not using. IMO this is the basic price you pay for using free software dependencies where you are not paying for the software at all, and are not paying for compatibility guarantees. Any update to any dependency can break you for any reason. Compatibility with interpreter versions is only a tiny part. After that you have the much larger category of API changes and bugs. |
And sometimes the publisher simply doesn't care about those versions, but doesn't want to actively disallow users from using them. That's very commonly the case with newer versions for instance - there are likely very few projects that have actively tried to ensure Python 3.6 support works yet, but I'd be very sad if they included metadata that said "Requires Python 2.7 or 3.3-3.5". It's bad enough having to wait for binary builds for new versions, let's not encourage pure Python projects to do similar (eggs did this, btw, and it was a pain). |
i would like a mechanism that makes it easy to mark eol'd and broken python versions as not installable there while not excluding new versions (but it might be nice to warn that the package doesn't include explicit support) |
@RonnyPfannschmidt |
yikes ^^ @dstufft please lets get an or - the second example so much better |
Presumably The way @RonnyPfannschmidt describes his use case, it sounds like he would find a |
@pfmoore >>> from packaging.specifiers import SpecifierSet as S
>>> S("~=3.3").contains("3.3.0")
True
>>> S("~=3.3").contains("3.3.5")
True
>>> S("~=3.3").contains("3.4.0")
True
>>> S("~=3.3").contains("3.4")
True
>>> S("~=3.3").contains("3.4.7")
True
>>> S("~=3.3").contains("3.2")
False
>>> S("~=3.3").contains("4.0")
False I'm not sure that a |
@dstufft ... oh. I knew there were complexities in the version spec stuff that I didn't fully understand, but OK. That seems weird, in the sense that "I don't know how to read I will just say that |
The I honestly accidentally underspecified the more complex string because I intended it to match 2.7 and 3.x but it didn't occur to me to account for 4.x at all :). Whether it makes sense to under-specify or over-specify really depends on the compatibility promises of the thing you're depending on... which I don't actually know if Python is ever planning to release another break-the-world as 4.x or what they're going to do there. If 4.0 is just going to be whatever comes after 3.9 then yea it makes sense to do |
The over-specified version requirement thing is important. It's way more irritating to have trouble installing a package that would work except it has incorrect metadata than to get a successful install of something that does not quite execute correctly. Maybe you would rather just install, and then edit the 2 lines of code required to get it to run on Python 3.next or 2.previous. This was a problem with egg, which is why pure Python wheels are automatically compatible with all newer versions of Python. This is why I am not that excited about amazing metadata dependency resolution etc. features - they work if the metadata is perfect, but it isn't. |
Closing this, there's nothing for us to do here and the |
Description:
I updated a package using:
$ pip install ftp-cloudfs --upgrade
After the upgrade, I ran my package ftpcloudfs and got the following issue:
I reported the issue to ftpcloudfs here: https://github.com/cloudfs/ftp-cloudfs/issues/57
But they advised me it was to do with using the wrong version of swiftclient alongside the wrong version of python.
Instead I've had to explicitly install swiftclient v2.7
$ pip install python-swiftclient==2.7.0
I was expecting pip to provide me with the latest compatible version of packages for my specs.
What I've run:
The text was updated successfully, but these errors were encountered: