sys_platform and python_version env markers in requirements files should respect --platform and --python-version #6117
Labels
C: download
About fetching data from PyPI and other sources
state: awaiting PR
Feature discussed, PR is needed
type: enhancement
Improvements to functionality
Environment
Description
pip download
allows you to specify an explicit platform (--platform
) and python version (--python-version
) which overrides the current environment, however, thesys_platform
andpython_version
markers in requirements files still use the current environment, making them useless in practice.Expected behavior
sys_platform
andpython_version
markers should be overridden by--platform
and--python-version
.How to Reproduce
create a requirments.txt file:
Install from python2 for python3:
the
future
package should be skipped because we're trying to download packages for python 3.6 and the marker specifies that it should only be installed forpython_version < '3.0'
, but because the current python interpreter is 2.7, pip attempts to download it anyway.Output
Expected Output
The text was updated successfully, but these errors were encountered: