Github Action to install uv and create a virtual environment.
Compatible with Unix and Windows.
This action prevents Windows installation errors that occur when using uv without a virtual environment:
error: failed to remove file `C:\hostedtoolcache\windows\Python\3.10.11\x64\Lib\site-packages\../../Scripts/uv.exe`
Caused by: Access is denied. (os error 5)
The error occurs because uv attempts to modify the global Python environment, which is restricted in GitHub Actions.
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: andgineer/uv-venv@v3
- name: Install dependencies
run: uv pip install -r requirements.dev.txt