Commit 7101a06
Fix inline-script env creation for CPython sys.version_info versions (PEP 723)
The native locator (pet) reports interpreter versions in CPython's
`sys.version_info` form, e.g. "3.14.3.final.0", which is not valid PEP 440.
The `@renovatebot/pep440` helpers reject that shape, so the inline-script
manager mishandled every such interpreter:
- `areEqualPythonReleases()` returned false even for two identical versions,
because `parseReleaseSegments("3.14.3.final.0")` yields `undefined`. A
freshly created environment was therefore judged not to match its own
requested version, rejected with "Created inline-script environment does not
match the requested cache entry", and deleted — so env creation failed for
scripts without `requires-python`.
- `matchesInstallConstraint()` threw (caught, returning false), so scripts
with `requires-python` found no compatible base interpreter.
Add `normalizeCpythonVersionInfo()`, which converts the `sys.version_info`
form to PEP 440 ("3.14.3.final.0" -> "3.14.3", "3.14.0.candidate.2" ->
"3.14.0rc2"). It preserves the release segments verbatim (no zero-padding, so
`extractLowerBoundVersion`'s `uv python install` targets are unaffected) and
returns any other string unchanged. Apply it inside `parseReleaseSegments()`
(fixing `areEqualPythonReleases` and the interpreter/candidate sorting that
also depend on it) and before `satisfiesPep440()` in
`matchesInstallConstraint()` (fixing the `requires-python` paths).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 3570eeb commit 7101a06
4 files changed
Lines changed: 107 additions & 5 deletions
File tree
- src
- common/utils
- managers/builtin/inlineScript
- test
- common/utils
- managers/builtin/inlineScript
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
6 | 38 | | |
7 | 39 | | |
8 | 40 | | |
9 | 41 | | |
10 | 42 | | |
11 | 43 | | |
12 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
13 | 47 | | |
14 | 48 | | |
15 | | - | |
| 49 | + | |
16 | 50 | | |
17 | 51 | | |
18 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
2503 | 2507 | | |
2504 | 2508 | | |
2505 | 2509 | | |
2506 | | - | |
| 2510 | + | |
2507 | 2511 | | |
2508 | 2512 | | |
2509 | 2513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
8 | 40 | | |
9 | 41 | | |
10 | 42 | | |
11 | 43 | | |
12 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
13 | 54 | | |
14 | 55 | | |
15 | 56 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
556 | 579 | | |
557 | 580 | | |
558 | 581 | | |
| |||
0 commit comments