Commit 8cef54d
authored
fix(python plugin): remove UV_PYTHON env variable (#2608)
## Summary
Fixes: #2575
The current python plugin sets `UV_PYTHON` to path of python executable
under default `VENV_DIR` directory. However if someone sets a custom
`VENV_DIR` in their `devbox.json` file, this will cause an error. Since
`uv` will attempt and fail to find python in the default VENV_DIR path
where the venv would no longer exist.
This change removes the `UV_PYTHON` environment variable from the plugin
altogether. This can be done, since `uv` will use the python executable
of the active virtual environment its running in
(https://docs.astral.sh/uv/reference/cli/#uv-python), and the venv is
automatically created and activated by the python plugin.
This change allows flexibility for users to set their own `VENV_DIR`. It
also still works with pip (`uv pip install`) as expected.
## How was it tested?
1. devbox create uvtest --template python-pip
2. cd uvtest
3. mkdir -p src/uvtest
4. add `"VENV_DIR": "./src/uvtest/.venv"` to `env` section of
`devbox.json` file
5. devbox shell
6. `uv run main.py`: (this step would cause an error before these
changes)
7. `uv pip install fastapi`
## Community Contribution License
All community contributions in this pull request are licensed to the
project
maintainers under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).
By creating this pull request, I represent that I have the right to
license the
contributions to the project maintainers under the Apache 2 License as
stated in
the
[Community Contribution
License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).1 parent af0b958 commit 8cef54d
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
0 commit comments