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

Installation fails when installing a wheel resulted from using PEP 508 in extras_require #5903

Closed
KOLANICH opened this issue Oct 19, 2018 · 10 comments
Labels
auto-locked Outdated issues that have been locked by automation C: extras Handling optional dependencies C: wheel The wheel format and 'pip wheel' command project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior

Comments

@KOLANICH
Copy link
Contributor

Environment

  • pip version: git
  • Python version: pypy3

Description
https://gitlab.com/KOLANICH/RichConsole/-/jobs/110427970

[options.extras_require]
colorama colors = colorama @ git+https://github.com/tartley/colorama.git#egg=colorama-dev
plumbum colors = plumbum @ git+https://github.com/tomerfiliba/plumbum.git#egg=plumbum-dev
colored colors = colored @ git+https://gitlab.com/dslackw/colored.git#egg=colored-dev

Expected behavior
Should work fine

How to Reproduce

  1. download https://gitlab.com/KOLANICH/RichConsole/tree/d5d3f0dd2f8e4c33631208ebf9d8ff035b25c435/
  2. Build the wheel
  3. try to install it.

Output

set(req_to_install.extras) - set(dist.extras)
File "/usr/local/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2840, in extras
return [dep for dep in self._dep_map if dep]
File "/usr/local/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2885, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/local/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2895, in _compute_dependencies
reqs.extend(parse_requirements(req))
File "/usr/local/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2956, in parse_requirements
yield Requirement(line)
File "/usr/local/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2965, in __init__
raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Parse error at "'extra =='": Expected stringEnd
@KOLANICH KOLANICH changed the title Installation fails when installing a wheel using PEP 508 in extras_require Installation fails when installing a wheel resulted from using PEP 508 in extras_require Oct 19, 2018
@benoit-pierre
Copy link
Member

Looks like you found another bug in wheel. And pkg_resources...

  • wheel generate package @ URL; markers, which is invalid, the correct syntax is package @ URL ; markers, note the space after the URL before ;
  • and pkg_resources.Requirement is also buggy:
>> import pkg_resources
>>> pkg_resources.Requirement('foo @ http://host/foo.zip ; extra == "extra"')
Requirement.parse('foo@ http://host/foo.zip; extra == "extra"')

@KOLANICH
Copy link
Contributor Author

pip uses vendored pkg_resources, doesn't it?

@benoit-pierre
Copy link
Member

Yes.

@benoit-pierre
Copy link
Member

pypa/wheel#270

@benoit-pierre
Copy link
Member

pypa/packaging#137

@cjerdonek cjerdonek added type: bug A confirmed bug or unintended behavior C: wheel The wheel format and 'pip wheel' command project: vendored dependency Related to a vendored dependency C: extras Handling optional dependencies labels Oct 27, 2018
@ssbarnea
Copy link
Contributor

ssbarnea commented Nov 8, 2018

It seems that this bug also calls for adding some CI testing around this function involving: building a package with extras_require, installing it, validating that it works.

@richin13
Copy link

So is this fixed in pip 19?

@benoit-pierre
Copy link
Member

benoit-pierre commented Jan 29, 2019

@richin13: yes, pip>=19.0 vendors packaging==19.0 with the fix, just make sure you're using wheel>=0.32.3 to generate the wheels.

@pypa/pip-committers: this can be closed.

@cjerdonek
Copy link
Member

Was this ever added to news?

@lock
Copy link

lock bot commented May 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 29, 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 C: extras Handling optional dependencies C: wheel The wheel format and 'pip wheel' command project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants