← Back to issue list

fix(plugins/uv): Avoid modifying already relocatable venv

View original Github issue

Metadata

Project
charmcraft
Number
#2565
Type
pull request
State
open
Author
carlcsaposs-canonical
Labels
Created
Updated
Closed

Current evaluation

Avoids sed-patching the activate script for the uv plugin since craft-parts already creates relocatable venvs via uv venv --relocatable. Small 2-file diff, pending review with 0 reviewers; CI has several failing jobs (snap-tests, Trivy, typecheck-with-ty) that the author says are unrelated.

Suggested action: needs review

Reason: The PR is a small, well-scoped cleanup (17+/8- lines) that removes a fragile sed patch of the uv-generated activate script in favor of uv's public --relocatable API, which is already used by craft-parts' uv plugin (confirmed in craft_parts/plugins/uv_plugin.py). The code in charmcraft/utils/parts.py still contains the sed command, so the fix is not yet merged. Last activity was 200 days ago with only the author's comment about unrelated CI failures and zero maintainer interaction, so it needs a maintainer to review and address the failing CI checks (snap-tests, Trivy, typecheck-with-ty).

Impact: 30 Quick Win: 25.5 Staleness: 55 Complexity: 15 Confidence: 75

Issue body

The uv plugin from craft-parts already uses `uv venv --relocatable` to create an activate script that has a portable path instead of an absolute path https://github.com/canonical/craft-parts/blob/71291d50ec95aed813215e89463866dd09aaaa5e/craft_parts/plugins/uv_plugin.py#L108 Currently, charmcraft is overriding the relocatable path set by uv with its own relocatable path (since it's expecting `activate` to contain a hardcoded absolute path, like it does with `venv`) This currently doesn't cause any issues, but could break in the future if the format of the activate script created by `uv venv` changes (since charmcraft is using `sed` to update the script) Use the relocatable option provided by uv's public API instead of patching a private implementation detail

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 25.5
Staleness: 55
Complexity: 15
Confidence: 75
needs review Avoids sed-patching the activate script for the uv plugin since craft-parts already creates relocatable venvs via uv venv --relocatable. Small 2-file diff, pending review with 0 reviewers; CI has several failing jobs (snap-tests, Trivy, typecheck-with-ty) that the author says are unrelated.
qwen3.6-35b-a3b-mtp-q6
Staleness: 58
Complexity: 15
Confidence: 65
needs review Replaces fragile sed patching of activate scripts with uv's public relocatable API. Currently pending maintainer review with zero reviewers and several unrelated CI failures.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 15
Confidence: 70
needs review Updates charmcraft to use uv's public relocatable API instead of patching the activate script with sed. Currently awaiting maintainer review after author noted unrelated test failures.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 15
Confidence: 75
needs review Replaces sed-based path patching in the uv plugin with uv's built-in --relocatable API to prevent future breakage. Currently awaiting maintainer review and CI retrigger.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 15
Confidence: 80
needs review Replaces charmcraft's fragile sed patching of uv's activate script with uv's built-in relocatable venv API. PR remains open with unrelated test failures blocking merge; author lacks CI retrigger permissions.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.