Various package-index filtering flags do not affect the environment markers
See original GitHub issueThis is a common pattern that I’m seeing in pip’s issue tracker; so filing an issue to (a) trigger a discussion of how to improve documentation / output / errors to better deal with the mismatch in user expectations vs behaviour here and (b) consolidate those issues.
Basically, the fundamental problem here is that pip has various options that affect the wheels that pip will consider when triaging things (--platform <platform>
, --python-version <python_version>
, --implementation <implementation>
, --abi <abi>
) but those do not affect the marker evaluation environment for dependencies.
This results in a subtle failure mode: pip install [options] package
will use a wheel for package that has a (hypothetical) Python version 9.22 but when evaluating environment markers (https://packaging.python.org/en/latest/specifications/dependency-specifiers/#environment-markers), that would still use the environment for the current Python interpreter.
It is not possible to compute the environment markers based on the values passed in by the user via the CLI.
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (6 by maintainers)
Oh, that wasn’t clear. 😅
We’re in complete agreement here. 😃
I wasn’t suggesting that paths get exposed directly as user options. Simply that internally, we collect everything that is introspected from the interpreter in one place. Then, flags for things like
--platform
can modify that internal structure. There won’t be flags to alter the paths, but existing means of configuring paths, like--target
or--user
, can be modified to simply change the “interpreter config” structure, rather than having effects across the code base. It’s not a big deal, though.I absolutely agree, we don’t want user options to individually specify paths. That way lies chaos…