Skip to content

Properly handle -dev suffix on tags and ranges. - #436

Open
zooba wants to merge 4 commits into
python:mainfrom
zooba:gh-428
Open

zooba wants to merge 4 commits into
python:mainfrom
zooba:gh-428

Conversation

@zooba

@zooba zooba commented Oct 30, 2026

Copy link
Copy Markdown
Member

Fixes #428

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Installed listings can still select a stable release for 3-dev, while execution can choose an x64 prerelease despite an available preferred ARM64 prerelease.

2 open issues
What changed in this PR

This PR addresses #428 by making -dev tags and ranges signal prerelease preference during runtime selection.

Changes:

  • Add prerelease-preference detection for tags and ranges, excluding negated constraints.
  • Apply that preference to installation lookup, execution, and online single-result listings.
  • Add tests for suffix casing, platform suffixes, and range operators.
File Description
tests/​test_tagutils.py Tests prerelease preferences for tags and ranges.
src/​manage/​tagutils.py Adds suffix checking and prerelease-preference properties.
src/​manage/​list_command.py Honors prerelease preference in online --one listings.
src/​manage/​installs.py Prefers matching installed prereleases for execution.
src/​manage/​indexutils.py Infers installation prerelease preference from the requested tag or range.

Review effort: Balanced

Comment thread src/manage/installs.py Outdated
Comment on lines +360 to +367
if tag and tag.prefers_prerelease:
for i, t in best:
try:
if Version(i["sort-version"]).is_prerelease:
return _patch_install_to_run(i, t)
except ValueError as ex:
LOGGER.debug("Failed to parse %s to check for prerelease",
i["sort-version"])
Comment on lines +359 to 361
if any(t.prefers_prerelease for t in tags):
# First result will be the latest prerelease (or release)
installs = best[:1] or installs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

py install 3-dev doesn't install prerelease

2 participants