-
Notifications
You must be signed in to change notification settings - Fork 3.1k
TypeError: bad operand type for unary -: 'NoneType' #1192
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
Comments
I've now got this to reproduce reliably:
I think this is somehow related to the fact that I put a bunch of stuff in my wheelhouse for py27? |
Looks like this stems from this line: Line 269 in 9b4b651
You can't do |
So I believe the set of circumstances this occurs in is: if you have something in your wheelhouse, but that item is not universal, and is for some other python version |
the assumption of this section of the sorting code, is that the wheel links it's sorting are supported, so |
about 'wheelhouse', it's the default build location for |
Yup, here is my [global]
timeout = 15
download_cache = ~/.pip/cache
allow-all-external = false
no-allow-insecure = false
use-wheel = true
wheel-dir = /Users/alex_gaynor/.pip/wheels
find-links = /Users/alex_gaynor/.pip/wheels |
ok, you mind listing your wheels dir for me? the names will help. |
It's pretty huge so I put it in a paste: http://bpaste.net/show/136231/ |
As it turns out, the root issue here is general. In the case of wheels, there's some additional sorting that operates on the filename, which is not expecting unsupported archives, for the wrong project to be passed in. e.g. download https://pypi.python.org/packages/source/p/pytest-xdist/pytest-xdist-1.8.zip into a local
it will happily install pytest-xdist for you. Our matching routine right now tries to get away with not determining the project name, and matching the whole filename with I think the solution is to change this routine so that it matches against the project name. distlib has a function for determining the project name ( |
I had a PR with tests ready to go, but there's a snag with using |
I temporarily switched PyPI to using the |
what does PyPI have now? |
Something that pip can't do; I looked it up by filename in the database |
donald, do you mind posting the ones that fail. for the sake of 1.4.2, the conservative thing I think it just to fix this for wheel archives, and leave fixing sdist parsing to 1.5, which will provide beta testing, which a major change like this really needs. I'll post a PR probably tomorrow. |
Um, I think |
the distlib function is only able to be better at parsing project names like "pytest-xdist" because it assumes a more "rigid" versioning scheme (versions starting with [0-9]. Is that right? (except for not allowing "dev") Breaking parsing for pre-existing distributions is bad, but something has to give here. staying with what we have for sdists is pretty bad too. |
With the latest update to
I can't say whether it will correctly deal with all combinations on PyPI, though - there are some pretty varied version and project naming styles there. By all means log an issue if a reasonable-looking project name/version combination isn't handled. |
Oh, and
|
oh, good |
hey, @vsajip, can you add additional tests for that diff? https://bitbucket.org/pypa/distlib/commits/22c38563185bf13bfd267efc88d147a51e9880e3 |
@vsajip, thanks, one case I see missing in your suite is the wheel filename case where both the project name and version have "-" replaced with "_", e.g. "pytest_xdist-0.1_myfork" |
Not quite sure what provokes this error, I've seen it a few times when pip is invoked under tox:
The text was updated successfully, but these errors were encountered: