question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Various package-index filtering flags do not affect the environment markers

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pradyunsgcommented, Dec 17, 2022

Oh, that wasn’t clear. 😅

We’re in complete agreement here. 😃

0reactions
pfmoorecommented, Dec 17, 2022

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…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · pypa/pip - GitHub
Various package-index filtering flags do not affect the environment markers state: needs discussion This needs some more discussion type: feature request ...
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
PEP 668 – Marking Python base environments as “externally ...
This document does not use “package” in the sense of an importable name that contains Python modules, though in many cases, a distribution ......
Read more >
Packaging Guide — Spack 0.18.0 documentation
Packaging Guide¶. This guide is intended for developers or administrators who want to package software so that Spack can install it.
Read more >
hashin - PyPI
If there's no output, it worked. Check how it edited your requirements file. Filtering releases by Python version. Some requirements have many releases...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found