Repository navigation
Conversation
Without an unversioned "python" executable on PATH, Python.get_preferred_python() falls back to Python.get_system_python(), which builds the version from sys.version_info[:3] and so drops the pre-release suffix. The test expected the full version (e.g. 3.15.0rc1) and failed on pre-release interpreters in such environments, like the Debian build daemons.
Author
|
pre-commit.ci autofix |
Author
|
@radoering could you take a look when you have time? It's a follow-up to #10518: on systems without an unversioned python on PATH (e.g. Debian buildds) get_preferred_python() falls back to get_system_python(), which drops the pre-release suffix. Test-only change, CI is green. cc @hroncok since you hit the same test with rc releases in #10303/#10478. |
This branch has not been deployed
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.
test_python_get_preferred_defaultfails on pre-release interpreters when there is no unversionedpythonexecutable onPATH.In that case
Python.get_active_python()finds nothing, soPython.get_preferred_python()falls back toPython.get_system_python(). That builds the version fromsys.version_info[:3]and drops the pre-release suffix, whichtest_python_get_version_on_the_flyandtest_python_get_system_pythonexpect. Since #10518, thepython_versionfixture uses the full version fromsys.version(e.g.3.15.0rc1), so the assertion compares3.15.0with3.15.0rc1and fails.The CI always has
pythononPATH, so this doesn't show up there. It does show up on the Debian build daemons, which only shippython3, during the Debian rebuild against the Python 3.15 release candidates (Debian bug #1147234).The test now accepts either version, with a comment explaining why.
Checked on current
mainwith Python 3.15.0rc1:pythonon PATHpythonon PATH