Skip to content

Commit

Permalink
pep508: Fix python_full_version creation for non-cpython interpreters
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Dec 28, 2024
1 parent 11e4d96 commit 91a9d41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/expected/pep508.mkEnviron.testPypy3Linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
"post": null,
"pre": null,
"release": [
7,
3,
11
9
],
"str": "7.3.11"
"str": "3.9"
}
},
"python_version": {
Expand Down
9 changes: 8 additions & 1 deletion lib/pep508.nix
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,14 @@ in
throw "Unsupported platform";
platform_version = ""; # Field not reproducible
python_version = python.passthru.pythonVersion;
python_full_version = python.version;
# Nixpkgs lacks an equivalent of python_full_version.
# This isn't a problem on CPython where we can use python.version to get the full version,
# but on pypy we don't know which language patch version of Python the interpreter is for.
python_full_version =
if lib.hasPrefix python.passthru.pythonVersion python.version then
python.version
else
python.passthru.pythonVersion;
implementation_name = python.passthru.implementation;
implementation_version = python.version;
};
Expand Down

0 comments on commit 91a9d41

Please sign in to comment.