fix(plugins/uv): Avoid modifying already relocatable venv#2565
Open
carlcsaposs-canonical wants to merge 1 commit intocanonical:mainfrom
Open
fix(plugins/uv): Avoid modifying already relocatable venv#2565carlcsaposs-canonical wants to merge 1 commit intocanonical:mainfrom
carlcsaposs-canonical wants to merge 1 commit intocanonical:mainfrom
Conversation
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 path, like it does with `venv`—instead of a relocatable path) 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
Contributor
Author
|
The test failures appear to be unrelated to the changes in this PR (I do not have access to retrigger the tests) |
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.
The uv plugin from craft-parts already uses
uv venv --relocatableto create an activate script that has a portable path instead of an absolute pathhttps://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
activateto contain a hardcoded absolute path, like it does withvenv)This currently doesn't cause any issues, but could break in the future if the format of the activate script created by
uv venvchanges (since charmcraft is usingsedto update the script)Use the relocatable option provided by uv's public API instead of patching a private implementation detail