-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Various package-index filtering flags do not affect the environment markers #11664
Comments
#10050 (comment) has the relevant piece from that issue. |
I think the right move here is doing what pex has done, and taking a complete environment specification including environment markers; and not inferring anything from the interpreter when that's done. It'll be a slightly disruptive change, like any other change, but we'll be in a better spot in terms of this. Thoughts on this? |
Agreed, this sounds better. In fact, I'd like to go even further and completely isolate environment discovery - not just marker values, but sysconfig locations, and anything else that we introspect from the Python interpreter. That would allow us to manage any sort of environment, even "artificial" ones constructed from information supplied independently of the running interpreter. I'm thinking of this in support of I'm happy to limit the change to markers as an incremental step, if that's easier to achieve, but I'd like to have our long-term goal be to have full isolation of "interpreter introspection". |
I really don't want to allow the user to specify arbitrary paths with schemes (this was extensively discussed during installer's API/CLI design discussions) because I'm wary of what hacky layouts people might expect to be "supported" if we allow that. I am OK with exposing basically everything else, since misuse/abuse of them seems less likely/problematic to me. |
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 I absolutely agree, we don't want user options to individually specify paths. That way lies chaos... |
Oh, that wasn't clear. 😅 We're in complete agreement here. :) |
I'm copying @uranusjr's UX proposal from #9981 (comment) here:
I assume that whenever one |
Currently there is an issue with pip that prevents installing the notebook package's dependencies (and possibly others) for non-Windows OSs on Windows. Our issue: carpentriesoffline#95 pip issue: pypa/pip#11664 Fixes carpentriesoffline#95 Co-authored-by: Abhishek Dasgupta <abhidg@trenozoic.net>
If it's feasible (I haven't checked), it may be worth it to emit a warning when a marker is encountered when a package index filtering option is given. |
@pradyunsg although it's true you can't compute them all, you can compute the ones that seem to be used the large majority of the time in the wild. Pex has had (has) its own legacy That derives as many environment markers as it can from the 4 platform values and leaves the rest
Here the user passed All this is done using minimal runtime patches to off the shelf Pips from 20.3.4 to 24.1.1. To underscore though, |
This 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.
The text was updated successfully, but these errors were encountered: