You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03176cd
Browse filesBrowse the repository at this point in the historyBrowse files
Harden uv Python compatibility for inline scripts (#1733)
## Context
Inline-script environment creation selects an installed Python when
possible and falls back to installing a compatible Python with uv. The
fallback has to use the same PEP 440 semantics before and after
installation; otherwise setup can download Python successfully and then
reject it.
This remains behind the undeclared, default-off inline-script feature
flag.
## Why this change is needed
Two compatibility paths were inconsistent:
- A directly resolved Python was checked by the release-segment-only
helper before the manager's strict PEP 440 check. This could reject a
compatible final release, such as Python 3.15.0 for `!=3.15.0rc2`.
- A short exact requirement such as `==3.13` could be passed to uv as
the broad selector `3.13`. uv may install a later 3.13 patch, while
strict PEP 440 equality requires 3.13.0.
The default uv catalog can also omit older patch releases. A strict
short-exact lookup therefore needs an all-versions catalog to find
3.13.0 after newer 3.13 releases exist.
## What changed
- Direct post-install resolution now keeps the existing Python 3, error,
executable, and canonical-path guards while using strict PEP 440
compatibility.
- Short exact equality resolves through a concrete uv catalog result
instead of forwarding a broad minor selector.
- Only the short-exact path requests `uv python list --all-versions`;
existing catalog callers retain their previous command arguments.
- Fully specified exact versions, simple lower bounds, bounded ranges,
exclusions, prerelease/dev requirements, no-requirement behavior, and
quick-create prompt suppression remain unchanged.
## Behavior and compatibility
- No setting, command, menu, view, or status-bar contribution is added.
- The inline manager remains unregistered while the feature flag is off.
- Non-inline uv and package-management flows keep their existing
behavior.
- Failures remain fail-closed: no incompatible cache environment is
created.
## Reviewer guide
1. Review the strict direct-resolution guard in
`inlineScript/envManager.ts`.
2. Review short-exact catalog selection and the `allVersions` option.
3. Review uv command-argument tests, then the manager compatibility
regressions.
## Validation
- `npm run compile-tests --silent`
- Targeted inline manager, uv installer, and interpreter suites: 311
passing
- ESLint on changed TypeScript files
- `git diff --check`
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments