From d9040412234b611553702297cf3cad016d15c2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 17 Feb 2025 14:42:03 +0100 Subject: [PATCH] feat(ci): use uv to install dependencies This simplifies the workflow files and performs faster. --- .github/workflows/test.yml | 26 ++++++++++---------------- tox.ini | 4 +++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32b62f38..49d017d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,21 +27,18 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: pyproject.toml + + - uses: astral-sh/setup-uv@v5 + with: + cache-suffix: ${{ matrix.python-version }} - name: Install System dependencies run: | sudo apt-get update sudo apt-get install -qq -y --no-install-recommends libxmlsec1-dev swig - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - name: Type check with tox - run: tox -e "py${PYTHON_VERSION/\./}-pyright" + run: uvx tox -e "py${PYTHON_VERSION/\./}-pyright" test: runs-on: ubuntu-24.04 @@ -65,21 +62,18 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: requirements*.txt + + - uses: astral-sh/setup-uv@v5 + with: + cache-suffix: ${{ matrix.python-version }} - name: Install System dependencies run: | sudo apt-get update sudo apt-get install -qq -y --no-install-recommends libxmlsec1-dev swig - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install coverage tox - - name: Test with tox - run: tox -e "py${PYTHON_VERSION/\./}" + run: uvx tox -e "py${PYTHON_VERSION/\./}" - uses: codecov/codecov-action@v5 with: diff --git a/tox.ini b/tox.ini index 4c9037eb..bae3e7f4 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,9 @@ envlist = py39,py310,py311,py312,py313,py39-pyright,p313-pyright [testenv] passenv = * -install_command = python -I -m pip install --no-binary lxml --no-binary xmlsec {opts} {packages} +allowlist_externals = + uv +install_command = uv pip install --no-binary lxml --no-binary xmlsec {opts} {packages} deps = py{39,310,311,312,313}: -e .[dev,all] commands =