Pip: Installation fails when installing a wheel resulted from using PEP 508 in extras_require

Created on 19 Oct 2018  路  10Comments  路  Source: pypa/pip

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

File "/usr/local/site-packages/pip/_internal/resolve.py", line 306, in _resolve_one 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

extras wheel vendored dependency auto-locked bug

Most helpful comment

@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.

All 10 comments

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"')

pip uses vendored pkg_resources, doesn't it?

Yes.

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.

So is this fixed in pip 19?

@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.

Was this ever added to news?

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.

Was this page helpful?
0 / 5 - 0 ratings