Closed impredicative closed 2 months ago
You can set UV_LINK_MODE=copy
in your container.
I have now defined it in my project's .devcontainer/devcontainer.json
file as:
"containerEnv": {
"UV_LINK_MODE": "copy"
},
Yeah it's a bit tedious but right now only a subset of the uv
arguments are exposed on Rye's command-line. Perhaps we should have a blanket --uv-args
thing.
In my case, an env var is exactly what I needed, as I can define it at the container level. I didn't want to have to define anything at the project level. Alternatively, a global setting could have also worked.
👍 For posterity, we define all respected environment variables here: https://github.com/astral-sh/uv?tab=readme-ov-file#environment-variables
When running
rye sync --update-all
, I got the warning:To set the background, my project is is using devcontainer. As such, the cache dir may be in the container. The project dir however is outside the container, but is mapped into the container. This explains why the hardlink fails.
My issues are:
--link-mode=copy
, but it wasn't accepted as a valid argument. It is not clear where or how to specify it.REMOTE_CONTAINERS=true
, and if it sees this, it should not emit the warning.pyproject.toml
that the project is container-based because it's up to the user of the project how they want to run it.