Skip to content

relative path includes with markers generate incorrect Requires-Dist in PKG-INFO #3872

@ossareh

Description

@ossareh

Issue

I have a case very similar to #2802 where I am installing a vendored wheel file and it the code that generates PKG-INFO is producing an invalid line.

$ poetry add --platform linux blob/pyvcam-2.1.0-cp39-cp39-linux_x86_64.whl

results in pyproject's dependencies having:

pyvcam = {path = "blob/pyvcam-2.1.0-cp39-cp39-linux_x86_64.whl", platform = "linux"}

and during a tox run the following error:

...snip...
  File "/home/ossareh/dev/src/github.com/erisyon/vega/.tox/py39/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/home/ossareh/dev/src/github.com/erisyon/vega/.tox/py39/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3033, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/home/ossareh/dev/src/github.com/erisyon/vega/.tox/py39/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3094, in parse_requirements
    yield Requirement(line)
  File "/home/ossareh/dev/src/github.com/erisyon/vega/.tox/py39/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3103, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Parse error at "'sys_plat'": Expected stringEnd

Inside the bundle created by poetry I have:

$ grep pyvcam vega-0.1.0/PKG-INFO
Requires-Dist: pyvcam @ blob/pyvcam-2.1.0-cp39-cp39-linux_x86_64.whl; sys_platform == "linux"

According to the #2802 (linked above) I think there is meant to be a space prior to the ";". I have checked that the output of poetry build produces the same PKG-INFO entries.

I am about to submit a PR; I'm opening this issue for the context for that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions