Commit 1db4861
🐛 fix(discovery): match prerelease versions against major.minor specs
Python prerelease versions like 3.15.0a6 were incorrectly failing to match
version specifiers like >=3.15. This broke testing of prereleases in Fedora
and other environments that build libraries against alpha/beta Python versions.
The root cause was always comparing the full version string "3.15.0a6" against
the normalized specifier version "3.15.0". Since PEP 440 defines prereleases
as strictly less than final releases, this comparison failed even though the
intent of >=3.15 is to match any 3.15.x version including prereleases.
The fix matches the comparison precision to the specifier precision. For a
two-component specifier like >=3.15, we now compare "3.15" without prerelease
suffix, allowing prereleases to satisfy the constraint. Prerelease suffixes
are only included when the specifier itself contains a prerelease marker.
Fixes #45
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c4ec5ca commit 1db4861
2 files changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
476 | 484 | | |
477 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
478 | 488 | | |
479 | 489 | | |
480 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
300 | 307 | | |
301 | 308 | | |
302 | 309 | | |
| |||
0 commit comments