Skip to content

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

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

zooba wants to merge 15 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 Resolved
Comment thread src/manage/list_command.py Resolved

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.

Comment thread src/manage/installs.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved

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.

🔵 Needs a closer look

Active selection regressions allow --online --one to return multiple runtimes and cause --one to omit installed defaults or valid prerelease matches.

3 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Preserve a runtime when --one is used without filters

src/​manage/​list_command.py:388

Without any filters, tags is empty, so the new loop never adds a candidate and line 404 replaces the installed runtimes with an empty list. Consequently, py list --one -f=exe produces no executable even when a default runtime is installed. Preserve the marked default (or first available runtime) when there are no filters, and use the per-tag selection only for explicit filters.

Medium severity Use listing aliases when selecting filtered prerelease runtimes

src/​manage/​list_command.py:400

This second filtering pass requires a matching run-for alias, although listing uses install-for aliases. Prerelease records generated by scripts/generate-nuget-index.py include 3-dev-64 in install-for but not in run-for, so py list --one 3-dev discards these valid listing matches and can print nothing. Rank candidates using the listing match rules rather than requiring a runnable alias for the filter.

4 resolved since last review

Review effort: Balanced

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.

Comment thread src/manage/tagutils.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/list_command.py Resolved
Comment thread src/manage/tagutils.py Resolved
Comment thread src/manage/verutils.py Resolved
Comment thread src/manage/verutils.py Resolved

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

Active issues cause inequality constraints to reject valid runtimes with omitted micro versions and allow py list --online --one to return multiple results when platform selection falls back.

1 open issue
7 resolved since last review

Review effort: Balanced

Comment thread src/manage/tagutils.py Resolved
@zooba
zooba requested a balanced review from Copilot November 13, 2026 15:27

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

Non--dev range matching can select out-of-range runtimes, online --one fallbacks can return multiple results, and the new version assertion always fails.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread src/manage/tagutils.py
else:
if any(f.satisfied_by(t) for t in install_tags):
return True
if any(f.satisfied_by(t) for t in install_tags):
Comment thread tests/test_verutils.py Outdated
@@ -20,10 +29,11 @@ def test_version(ver_str):
def test_long_version(assert_log):
v = "3.1.2.3.4.5.6.7.8.9"
v2 = "3.1.2.3.4.5.6.7"
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