Repository navigation
Conversation
Assisted-by: Codex (model: GPT-6, autonomous)
There was a problem hiding this comment.
🟡 Changes recommended
A verified gap in tilde-prefixed PIPX_HOME handling still prevents valid relocated installations from being upgraded.
1 open issue
What changed in this PR
Extends Specify CLI’s install detection so specify self upgrade can recognize relocated uv and pipx installations, targeting the problem reported in #5095.
Changes:
- Adds relocation variables and current platform defaults while retaining legacy paths.
- Adds regression cases for supported layouts, sibling-directory rejection, and unset or empty variables.
- Documents the environment settings needed when upgrading relocated installations.
| File | Description |
|---|---|
tests/specify_cli/test_version_detection.py |
Adds positive and negative relocation-detection cases. |
src/specify_cli/_version.py |
Expands installer prefixes and ignores unconfigured directory variables. |
docs/upgrade.md |
Explains relocation support and required environment settings. |
Review effort: Max
|
Please address Copilot feedback |
Assisted-by: Codex (model: GPT-6, autonomous)
|
Please address Copilot feedback |
Preserve path boundaries and unset-variable guards while resolving PIPX_HOME against the installer working directory. Add current Windows and legacy macOS uv layouts with positive and sibling-path regressions. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Resolve UV_TOOL_DIR against the working directory while preserving sibling boundaries and rejecting relative XDG_DATA_HOME prefixes. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
|
Could you make the tilde expansion specific to the variable being handled? The unpublished finding itself isn’t visible, but focused checks of the base and head code reproduce a problem at |
Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
|
@mnriem, the variable-specific tilde handling is corrected at The November 3 validation recorded four regressions failing on the preceding head and passing after the fix. The six focused version/upgrade test files report 180 passed and four skipped on Windows/Python 3.14.6. The updated description includes the literal-tilde Posted on behalf of Shubham-Padkonde by OpenAI Codex (GPT-6, autonomous; exact model variant and reasoning setting are not exposed). Codex prepared the earlier code and validation and this review summary; no independent personal human review is claimed. |
|
Thank you! |

Description
Fixes #5095.
specify self upgradeclassifies valid uv/pipx installations outside the old hard-coded folders as unsupported. Detect relocated tool environments throughUV_TOOL_DIR,PIPX_HOME, XDG data locations, and platform defaults while retaining legacy paths.The review fixes also recognize uv's current
%APPDATA%/uv/toolsand legacy macOS~/Library/Application Support/uv/toolsdirectories. Preserve variable-specific tilde handling:PIPX_HOMEexpands it to the home directory,UV_TOOL_DIRtreats it literally under the working directory, and relativeXDG_DATA_HOMEvalues (including tilde-prefixed values) are ignored. RelativePIPX_HOMEandUV_TOOL_DIRpaths resolve against the working directory. Unset/empty/unresolved-variable guards, path-component boundaries, and registry fallback restrictions remain intact. Relative XDG paths are still rejected.The upgrade guide explains that relocation variables must remain set when running the installer. Ephemeral uvx detection and copied Windows entrypoint shims outside the tool environment are outside this path-detection change.
Validation
Windows, Python 3.14.6, using this checkout's own virtualenv:
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/test_version_release.py tests/specify_cli/selfs/test_command_upgrade.py -q: 180 passed, 4 skipped.PIPX_HOME=./pipx-home/../pipx-home. All pass after the fix. Sibling-directory negative controls pass before and after. The original change had twelve failing layout regressions on base.PIPX_HOME; its real environment entrypoint detectspipxduringself upgrade --dry-run --tag v1.2.3. No upgrade was executed. pipx's copied external Windows shim remains unrecognized, as noted above.UV_TOOL_DIR=./tools/../toolsregressions fail on the preceding PR commit and pass after this fix. Sibling-directory controls and relative XDG rejection pass. An isolated non-editableuv tool installwith a relativeUV_TOOL_DIRdetectsuv toolthrough the real installed executable duringself upgrade --dry-run; no upgrade was executed.git diff --checkpass. Ruff reports the same seven existing findings on base and head, with no added findings.Latest tilde-semantics validation: four new regressions fail at the preceding PR head and pass after this correction. Positive literal-tilde uv paths, negative home-expanded uv paths, both XDG tool layouts and existing pipx tilde controls are covered.
uv tool dirwith a literalUV_TOOL_DIR=~/toolsconfirms the working-directory interpretation. CLI help and the diff check pass; Ruff retains the same seven base findings.AI Disclosure
OpenAI Codex (GPT-6), operating autonomously on behalf of Shubham-Padkonde, investigated the issue and review feedback, wrote code/tests/documentation, ran validation, and drafted this description. The exact model variant/reasoning setting is not exposed to the agent. No personal line-by-line human review is claimed. Agent-authored commits identify assistance in their trailers.