Repository navigation
🐛 fix(pylock): use target marker values - #4331
Merged
gaborbernat merged 7 commits intoOct 31, 2026
Merged
gaborbernat merged 7 commits into
gaborbernat merged 7 commits into
Conversation
rahuldevikar
force-pushed
the
radevika-microsoft-fix-pylock-markers-host-interpreter
branch
3 times, most recently
from
October 30, 2026 18:00
41c3546 to
0b0b893
Compare
gaborbernat
marked this pull request as draft
October 30, 2026 19:08
gaborbernat
force-pushed
the
radevika-microsoft-fix-pylock-markers-host-interpreter
branch
from
October 30, 2026 23:32
d3a7fc9 to
89a3ff3
Compare
gaborbernat
marked this pull request as ready for review
October 30, 2026 23:33
gaborbernat
marked this pull request as draft
October 30, 2026 23:33
gaborbernat
marked this pull request as ready for review
October 30, 2026 23:38
gaborbernat
marked this pull request as draft
October 30, 2026 23:45
gaborbernat
force-pushed
the
radevika-microsoft-fix-pylock-markers-host-interpreter
branch
from
October 30, 2026 23:49
98914c7 to
b36cf91
Compare
gaborbernat
marked this pull request as ready for review
October 30, 2026 23:49
gaborbernat
marked this pull request as draft
October 30, 2026 23:56
for more information, see https://pre-commit.ci
A partial probe lets packaging fill missing marker keys from the tox host, which can select the wrong lock entry for a target interpreter. Reject incomplete output and exercise marker selection through tox runs. Refs tox-dev#4246
virtualenv already queries the target interpreter while selecting a creator. Use that result for lock markers without a separate marker subprocess. Keep existing constructor and probe calls valid for plugins. Probe the target when discovery metadata is absent.
The project lock excludes releases newer than seven days, while tox now requires python-discovery 1.9. Admit its published files and refresh the single affected lock entry.
The plugin path still ran a marker script inside tox. Query the selected interpreter through python-discovery using its tox environment. Keep the virtualenv record instead of resolving to the base interpreter; the base can produce different marker values.
gaborbernat
force-pushed
the
radevika-microsoft-fix-pylock-markers-host-interpreter
branch
from
October 31, 2026 00:55
b36cf91 to
4dc8db1
Compare
gaborbernat
marked this pull request as ready for review
October 31, 2026 00:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PythonRun._install_pylockat the merge base supplied five marker values from the target interpreter. packaging supplied missing values from the tox interpreter, so a Python 3.11 environment could install the package locked for Python 3.15. tox now evaluates lock markers with all 11 standard values from the target interpreter. Fixes #4246.Missing target marker values
The old marker mapping omitted
implementation_version, among other values. Issue #4246 shows the wrong package selection when the tox and environment interpreters differ. python-discovery PR #178 adds the complete target marker mapping to the interpreter record that virtualenv obtains during discovery. The 1.9.0 release exports its 11-keyMarkerEnvironmenttype, which tox now requires. Virtualenv discovery passes that mapping through tox's interpreter record to lock evaluation. The built-in path needs no separate marker subprocess.Runners without discovery metadata
tox-uv constructs tox's interpreter record without a marker field. The new field is optional so that constructor remains valid. A runner with a pylock-capable installer and no discovery metadata asks python-discovery to query its selected interpreter with tox's target environment variables and keeps the environment record. An unavailable or incomplete result stops installation.
Lock file cutoff
The project lock at the merge base pinned python-discovery 1.6.4, which cannot satisfy the new minimum. The default seven-day upload cutoff excludes the 1.9.0 files. A cutoff for python-discovery admits those files, and the lock entry now pins 1.9.0.
Behavior changes
pylock.tomlmarkers now select packages for the target interpreter on built-in virtualenv paths. Built-in virtualenv creation reuses discovery data; runners without that data query their selected interpreter through python-discovery. If either result is incomplete, tox reports a marker environment error and does not install from the lock. tox-uv's installer at f9e1241 rejects pylock files. This PR leaves dependency installation withoutpylock.tomlunchanged.Reported by Anthropic OSS Scanner: ANT-2026-O73ECNS8.