andgineer / uv-venv

Github Action to install uv and create a virtual environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uv-venv

Github Action to install uv and create a virtual environment.

It works on both Unix and Windows.


This action is necessary because if you try to use uv in a GitHub Action without virtual environment, you will get an error on Windows like this:

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)

This happens because, without a virtual environment, it tries to modify the global one, which is not allowed.

Usage

    - 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@v1

    - name: Install dependencies
      run: uv pip install -r requirements.dev.txt

Example usage: andginee/opensearch-log.

It is also included to my cookiecutter template

About

Github Action to install uv and create a virtual environment


Languages

Language:Shell 81.3%Language:Python 18.7%