Skip to content
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

InvalidRequirement - possible requirement parsing regression in 8.1.2 #3781

Closed
Smirl opened this issue Jun 6, 2016 · 10 comments · Fixed by #4038
Closed

InvalidRequirement - possible requirement parsing regression in 8.1.2 #3781

Smirl opened this issue Jun 6, 2016 · 10 comments · Fixed by #4038
Labels
auto-locked Outdated issues that have been locked by automation
Milestone

Comments

@Smirl
Copy link

Smirl commented Jun 6, 2016

  • Pip version: 8.1.2
  • Python version: 2.7.11
  • Operating System: Debian Jesse (official python:2.7 Docker image)

Description:

When trying to install the requirement appdynamics I get the error below. This package has a requirements.txt format which I have never seen before:
https://pypi.python.org/pypi/appdynamics/4.1.4.0

appdynamics-bindeps-linux-x86 (==4.1.4.0); 'linux' in sys_platform and platform_machine=='i386'
appdynamics-bindeps-linux-x64 (==4.1.4.0); 'linux' in sys_platform and (platform_machine=='x86_64' or platform_machine=='AMD64')
appdynamics-bindeps-osx-x86 (==4.1.4.0); sys_platform=='darwin' and platform_machine=='i386'
appdynamics-bindeps-osx-x64 (==4.1.4.0); sys_platform=='darwin' and (platform_machine=='x86_64' or platform_machine=='AMD64')

What I've run:

Error

docker run --rm -it python:2.7 bash
pip install appdynamics

Traceback

Invalid requirement: 'appdynamics-proxysupport-linux-x64==1.8.0.51; linux in "sys_platform" and (platform_machine == "x86_64" or platform_machine == "AMD64")'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
    req = Requirement(req)
  File "/usr/local/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'; linux '"

No Error

docker run --rm -it python:2.7 bash
pip install --upgrade pip==8.1.1
pip install appdynamics  # works
@chrisheaththomas
Copy link

Same problem.

chrisheaththomas referenced this issue in docker-library/python Jun 20, 2016
@avelis
Copy link

avelis commented Jul 11, 2016

This issue arose when trying to run builds on CircleCI and installing AppDynamics via pip. I believe they use Docker with pip version 8.1.2. For anyone who comes across this specific scenario. I forced my build settings to use pip version 8.1.1 until this issue gets resolved. Likely in another maintenance release.

@dholth
Copy link
Member

dholth commented Jul 11, 2016

Requirements inside wheel's METADATA file have parenthesis around the version numbers due to pEP 345; other formats do not. Could this be related to that?

@avelis
Copy link

avelis commented Jul 11, 2016

@dholth It's possible. Looking at the PEP345 docs I do see references to allowed parenthesis. I could be wrong on my understanding.

Did parsing expectations change in version 8.1.2 from version 8.1.1 in consuming requirement strings?

@sergray
Copy link

sergray commented Jul 29, 2016

This seems to be related to #3624 and that's a backward incompatible change even if some maintainers abuse simple grammar for environmental markers.

Are there any plans for fixing that regression?

@gsnedders
Copy link
Contributor

I guess we need to add support to packaging for this quirk, if packages are relying on it. Yay. :\ (Though trust anything @dstufft says over me.)

@dstufft
Copy link
Member

dstufft commented Jul 29, 2016

I think this is fixed in master already?

@sergray
Copy link

sergray commented Jul 29, 2016

@dstufft it is not, I've tried the master branch without success today :(

@KoviRobi
Copy link

I have ran into this problem while trying to compile Plover (https://github.com/openstenoproject/plover) as well

@KoviRobi
Copy link

KoviRobi commented Aug 27, 2016

For Plover at least, the 'in' syntax is what is broken, so using "win" == sys_platform instead of "win" in sys_platform works.

@dstufft dstufft added this to the 8.2 milestone Sep 7, 2016
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
8 participants