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

Preserve environment markers of indirect dependencies #1127

Closed
estan opened this issue May 1, 2020 · 2 comments
Closed

Preserve environment markers of indirect dependencies #1127

estan opened this issue May 1, 2020 · 2 comments
Labels
bug Something is not working duplicate Duplicate of an existing issue/PR markers Related to environment markers

Comments

@estan
Copy link
Contributor

estan commented May 1, 2020

#459 ensured that environment markers for dependencies listed explicitly in requirements.in are preserved in the output requirements.txt.

This feature request is about also preserving requirement markers for indirect dependencies.

Example:

(testenv) estan@edison:~$ cat requirements.in 
pytest==5.4.1
(testenv) estan@edison:~$ pip-compile requirements.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile requirements.in
#
attrs==19.3.0             # via pytest
importlib-metadata==1.6.0  # via pluggy, pytest
more-itertools==8.2.0     # via pytest
packaging==20.3           # via pytest
pluggy==0.13.1            # via pytest
py==1.8.1                 # via pytest
pyparsing==2.4.7          # via packaging
pytest==5.4.1             # via -r requirements.in
six==1.14.0               # via packaging
wcwidth==0.1.9            # via pytest
zipp==3.1.0               # via importlib-metadata
(testenv) estan@edison:~$

However, importlib-metadata is only a dependency of pytest and pluggy on Python < 3.8 due to them having

Requires-Dist: importlib-metadata (>=0.12) ; python_version < "3.8"

in their wheel meta data. I would therefore like the output to have

importlib-metadata==1.6.0 ; python_version < "3.8"  # via pluggy, pytest

That is, the environment marker for this indirect dependency should be preserved.

More formally:

  1. A dependency, whether direct or indirect, should always be listed in the output requirements.txt, even if the environment markers for it state that it is not needed in the environment in which pip-compile is running.

  2. In the output, the environment markers for a given dependency should be the logical or of the requirement markers encountered for that dependency in the dependency graph.

@atugushev
Copy link
Member

atugushev commented May 1, 2020

Duplicates #563.

@atugushev atugushev added markers Related to environment markers bug Something is not working duplicate Duplicate of an existing issue/PR labels May 1, 2020
@atugushev
Copy link
Member

Feel free to reopen if you think that it doesn't resolve the issue. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working duplicate Duplicate of an existing issue/PR markers Related to environment markers
Projects
None yet
Development

No branches or pull requests

2 participants