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

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

Closed
3 tasks done
ossareh opened this issue Apr 1, 2021 · 2 comments · Fixed by python-poetry/poetry-core#153
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@ossareh
Copy link

ossareh commented Apr 1, 2021

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.

@cheradenine
Copy link

I got here from a google search for this same error. I'm on poetry 1.1.8. My toml references sub directories as a raw directory, not a wheel. My PKG-INFO does not have a space after the relative path:

Requires-Dist: somepackage @ lib/somepackage; sys_platform == "darwin"

the toml file has a line like this:

somepackage = [
    {path = "./lib/somepackage", develop = false, markers = "sys_platform == 'darwin' "},
]

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
dimbleby pushed a commit to dimbleby/poetry that referenced this issue Apr 21, 2022
…ies with markers (python-poetry#153)

* fix(packages/dependency): add space after filename for file dependencies with markers

local vendored files need a space after the file name and before the ";" which demarks the start of
markers

fix python-poetry#3872
Copy link

github-actions bot commented Mar 2, 2024

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
3 participants