Closed
Description
Problem
If python-version
is defined, setup-uv
currently auto-activates a venv under .venv
in the repository/workspace root.
Problems with this behavior:
- Does not support repos with multiple possible venvs: Support
working-directory
in action configuration #271
Other considerations:
- Interaction with the
pyproject-file
input?VIRTUAL_ENV
is set to wrong directory when usingpyproject-file
config #251 - Interaction with
.python-version
file: Support .python-version files as input towith python-version
#211 - Support
--system-site-packages
: Flag for--system-site-packages
when initializing venv #260 - Should the correct python version be always installed? Python version part of the cache key is undefined if the required python version is not yet installed #283
Solutions
Solution 1
- a new boolean input
activate-environment
- a new input
working-directory
which defaults to ${{ github.workspace }}. This adds--directory
to uv commands inside setup-uv.Ifactivate-environment: true
it will activate the venv in this place - this will replace the inputs
uv-file
andpyproject-file
Optional: We always install the target python version (determined by python-version
, pyproject.toml or .python-version).
Open question: What to do about --system-site-packages?