Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andgineer/uv-venv
Github Action to install uv and create a virtual environment
https://github.com/andgineer/uv-venv
actions python uv venv virtualenv
Last synced: 3 days ago
JSON representation
Github Action to install uv and create a virtual environment
- Host: GitHub
- URL: https://github.com/andgineer/uv-venv
- Owner: andgineer
- Created: 2024-03-08T12:27:23.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T06:53:40.000Z (8 days ago)
- Last Synced: 2024-11-08T07:35:26.715Z (8 days ago)
- Topics: actions, python, uv, venv, virtualenv
- Language: Shell
- Homepage:
- Size: 1.7 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# uv-venv
Github Action to install [uv](https://github.com/astral-sh/uv) and create a virtual environment.
Compatible with Unix and Windows.
### Why
This action prevents Windows installation errors that occur when using uv without a virtual environment:```shell
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.
## Usage
```yaml
- 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
```### Examples
* [andginee/opensearch-log](https://github.com/andgineer/opensearch-log/blob/0d1060c57a6adac85d3559b52ec714c931f3b671/.github/workflows/ci.yml#L44)
* [cookiecutter template](https://github.com/andgineer/cookiecutter-python-package)