Conversation
python-version to pyvenv.cfg for PEP 838
gaborbernat
marked this pull request as ready for review
July 24, 2026 06:33
gaborbernat
marked this pull request as draft
July 24, 2026 06:35
gaborbernat
force-pushed
the
pep-838-python-version
branch
from
August 28, 2026 19:17
a2e69f4 to
23c018b
Compare
Bind version_info once instead of repeating self.interpreter.version_info across the python-version, version_info, and version fields. Assert the written python-version against sys.version_info rather than the interpreter object the code just read, so the test fails if the field value is wrong.
The key had no home in the docs, since virtualenv documented no `pyvenv.cfg` key anywhere. A reference page now covers the file, and a table sets `python-version` against `version` and `version_info`, which carry one number at three precisions and gave callers no reason to prefer one over another. The tutorial reads the key out of an environment it just made, the usage guide parses it without spawning the interpreter, and the explanation of why environments borrow from the base install says why `pyvenv.cfg` became the place tools look. The version assertion compared against the running interpreter while the code reads the target one, so it passed for the wrong reason whenever the two agree.
gaborbernat
force-pushed
the
pep-838-python-version
branch
from
August 28, 2026 19:22
23c018b to
1ebb90b
Compare
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.
Draft PR accompanying PEP 838