Repository navigation
fix: detect relocated uv and pipx tool installations - #5103
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
Assisted-by: Codex (model: GPT-6, autonomous)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #5095.
specify self upgradecurrently classifies existing uv/pipx installations outside the legacy hard-coded directories as unsupported. Since an existing entrypoint intentionally cannot fall back to another installer's registry, a valid relocated installation never reaches the upgrade path.Extend path detection to
UV_TOOL_DIR,PIPX_HOME, XDG data locations, and current Windows/macOS/Linux defaults while retaining legacy paths. These layouts follow the uv storage reference and pipx environment reference. Ignore unset or empty environment variables so they cannot turn into root-level prefixes. Existing path-component boundaries, registry fallback restrictions, and installer command construction are unchanged.The upgrade guide notes that the same relocation variables must remain set when upgrading, so the invoked installer also uses that directory. Ephemeral uvx cache detection is outside this fix.
Testing
self upgrade --dry-run --tag v1.2.3invocation.uv sync --extra test.uv tool install --from . specify-cliinto isolatedUV_TOOL_DIRandUV_TOOL_BIN_DIRdirectories. Its real executable reportsDetected install method: uv tooland previews the correct installer command; no upgrade was executed.Windows / Python 3.14.6:
.venv/Scripts/python -m pytest tests/specify_cli/test_version_detection.py tests/specify_cli/test_version_execution.py tests/specify_cli/test_version_guidance.py tests/specify_cli/test_version_verification.py tests/specify_cli/selfs -q: 155 passed, 4 skipped.git diff --checkpasses. Ruff reports the same seven existing findings in the two Python files on base and head; no new findings.AI Disclosure
AI disclosure: OpenAI Codex (GPT-6), operating autonomously on behalf of Shubham-Padkonde, investigated the issue, generated code/tests/documentation, ran validation, and drafted this PR. The exact model variant/reasoning setting is not exposed to the agent. No personal line-by-line human review is claimed.