From a9bdf070193285cd67f09d65214c41a0c3814f27 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Sep 2025 22:07:44 +0200 Subject: [PATCH 1/4] Use uv in github actions --- .github/workflows/benchmark.yml | 9 +++------ .github/workflows/lint.yml | 7 +++---- .github/workflows/publish.yml | 11 ++++------- .github/workflows/test.yml | 31 +++++++++++++++++++++---------- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 8b856f5a..8bf37cfa 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -15,17 +15,14 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Set up Python 3.13 - uses: actions/setup-python@v6 - id: setup-python + - name: Set up Python with uv + uses: astral-sh/setup-uv@v6 with: python-version: "3.13" - architecture: x64 - name: Install tox run: | - python -m pip install --upgrade pip - python -m pip install tox tox-uv uv + uv pip install --system tox tox-uv - name: Run benchmarks with CodSpeed uses: CodSpeedHQ/action@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 21f92db5..62969b04 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,15 +10,14 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Set up Python 3.13 - uses: actions/setup-python@v6 + - name: Set up Python with uv + uses: astral-sh/setup-uv@v6 with: python-version: '3.13' - name: Install tox run: | - python -m pip install --upgrade pip - python -m pip install tox uv tox-uv + uv pip install --system tox tox-uv - name: Run code quality tests with tox run: tox diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bee561ff..e6d69fe1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,16 +13,13 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Set up Python 3.13 - uses: actions/setup-python@v6 + - name: Set up Python with uv + uses: astral-sh/setup-uv@v6 with: python-version: '3.13' - - name: Build wheel and source tarball with uv_build - run: | - python -m pip install --upgrade pip - python -m pip install uv_build - python -m uv_build build + - name: Build wheel and source tarball with uv + run: uv build - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6ddbbca..6fd6407b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,14 +14,25 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up CPython with uv + if: ${{ !contains(matrix.python-version, 'pypy') }} + uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up PyPy without uv + if: ${{ contains(matrix.python-version, 'pypy') }} uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + - name: Set up uv for PyPy + if: ${{ contains(matrix.python-version, 'pypy') }} + uses: astral-sh/setup-uv@v6 + - name: Install tox and plugins run: | - python -m pip install tox tox-gh-actions tox-uv uv + uv pip install --system tox tox-gh-actions tox-uv - name: Run unit tests with tox run: tox @@ -37,22 +48,22 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Set up Python 3.13 (tox runner) + - name: Set up target Python ${{ matrix.python-version }} (for tox discovery) uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up Python 3.13 (tox runner) with uv + uses: astral-sh/setup-uv@v6 with: python-version: '3.13' - name: Install tox and plugins (with Python 3.13) run: | - python3.13 -m pip install tox tox-gh-actions tox-uv uv - - - name: Set up target Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} + uv pip install --system tox tox-gh-actions tox-uv - name: Run unit tests with tox for target shell: bash run: | ENV="py${{ matrix.python-version }}"; ENV=${ENV/./} - python3.13 -m tox -e "$ENV" + python -m tox -e "$ENV" From 66b930523372e50feb006b9168424c5758acec40 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Sep 2025 22:11:46 +0200 Subject: [PATCH 2/4] Try differently --- .github/workflows/benchmark.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 8bf37cfa..285c5b63 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -22,7 +22,7 @@ jobs: - name: Install tox run: | - uv pip install --system tox tox-uv + uv pip install tox tox-uv - name: Run benchmarks with CodSpeed uses: CodSpeedHQ/action@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 62969b04..d74ffb4e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: - name: Install tox run: | - uv pip install --system tox tox-uv + uv pip install tox tox-uv - name: Run code quality tests with tox run: tox diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6fd6407b..175a4ebd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Install tox and plugins run: | - uv pip install --system tox tox-gh-actions tox-uv + uv pip install tox tox-gh-actions tox-uv - name: Run unit tests with tox run: tox @@ -60,7 +60,7 @@ jobs: - name: Install tox and plugins (with Python 3.13) run: | - uv pip install --system tox tox-gh-actions tox-uv + uv pip install tox tox-gh-actions tox-uv - name: Run unit tests with tox for target shell: bash From f9a905057174b19bf2211c0a4d6a203c406b0e03 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Sep 2025 22:39:13 +0200 Subject: [PATCH 3/4] Try again --- .github/workflows/benchmark.yml | 18 ++++++++++-- .github/workflows/lint.yml | 17 +++++++++-- .github/workflows/publish.yml | 18 ++++++++++-- .github/workflows/test.yml | 52 ++++++++++++++++++++------------- 4 files changed, 76 insertions(+), 29 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 285c5b63..1add274b 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -13,18 +13,30 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - name: Checkout project + id: checkout + uses: actions/checkout@v5 - - name: Set up Python with uv - uses: astral-sh/setup-uv@v6 + - name: Set up Python 3.13 + id: setup-python + uses: actions/setup-python@v6 with: python-version: "3.13" + architecture: x64 + + - name: Install uv + id: setup-uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Install tox + id: install-tox run: | uv pip install tox tox-uv - name: Run benchmarks with CodSpeed + id: run-benchmarks uses: CodSpeedHQ/action@v4 with: mode: instrumentation diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d74ffb4e..908849fc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,18 +8,29 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - name: Checkout project + id: checkout + uses: actions/checkout@v5 - - name: Set up Python with uv + - name: Set up Python 3.13 + id: setup-python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Install uv + id: setup-uv uses: astral-sh/setup-uv@v6 with: - python-version: '3.13' + enable-cache: true - name: Install tox + id: install-tox run: | uv pip install tox tox-uv - name: Run code quality tests with tox + id: lint run: tox env: TOXENV: ruff,mypy,docs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e6d69fe1..819fe1e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,16 +11,28 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - name: Checkout project + id: checkout + uses: actions/checkout@v5 - - name: Set up Python with uv + - name: Set up Python 3.13 + id: setup-python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Install uv + id: setup-uv uses: astral-sh/setup-uv@v6 with: - python-version: '3.13' + enable-cache: true - name: Build wheel and source tarball with uv + id: build run: uv build + - name: Publish a Python distribution to PyPI + id: publish uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 175a4ebd..4c8e9db7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,29 +12,29 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.9', 'pypy3.10'] steps: - - uses: actions/checkout@v5 + - name: Checkout project + id: checkout + uses: actions/checkout@v5 - - name: Set up CPython with uv - if: ${{ !contains(matrix.python-version, 'pypy') }} - uses: astral-sh/setup-uv@v6 - with: - python-version: ${{ matrix.python-version }} - - - name: Set up PyPy without uv - if: ${{ contains(matrix.python-version, 'pypy') }} + - name: Set up Python ${{ matrix.python-version }} + id: setup-python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - name: Set up uv for PyPy - if: ${{ contains(matrix.python-version, 'pypy') }} + - name: Install uv + id: setup-uv uses: astral-sh/setup-uv@v6 + with: + enable-cache: true - name: Install tox and plugins + id: install-tox run: | - uv pip install tox tox-gh-actions tox-uv + uv pip install tox tox-uv tox-gh-actions - name: Run unit tests with tox + id: test run: tox tests-old: @@ -46,24 +46,36 @@ jobs: python-version: ['3.7', '3.8'] steps: - - uses: actions/checkout@v5 + - name: Checkout project + id: checkout + uses: actions/checkout@v5 - - name: Set up target Python ${{ matrix.python-version }} (for tox discovery) + - name: Set up Python 3.13 (tox runner) + id: setup-python uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} + python-version: '3.13' - - name: Set up Python 3.13 (tox runner) with uv + - name: Install uv + id: setup-uv uses: astral-sh/setup-uv@v6 with: - python-version: '3.13' + enable-cache: true - - name: Install tox and plugins (with Python 3.13) + - name: Install tox and plugins + id: install-tox run: | - uv pip install tox tox-gh-actions tox-uv + uv pip install tox tox-uv tox-gh-actions + + - name: Set up target Python ${{ matrix.python-version }} + id: setup-target-python + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} - name: Run unit tests with tox for target + id: test shell: bash run: | ENV="py${{ matrix.python-version }}"; ENV=${ENV/./} - python -m tox -e "$ENV" + python3.13 -m tox -e "$ENV" From 3f43c5a430241f0956569732cdc648f6938a7f90 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Sep 2025 22:41:40 +0200 Subject: [PATCH 4/4] Try again --- .github/workflows/benchmark.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 1add274b..20c78ab8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -33,7 +33,7 @@ jobs: - name: Install tox id: install-tox run: | - uv pip install tox tox-uv + uv pip install --system tox tox-uv - name: Run benchmarks with CodSpeed id: run-benchmarks diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 908849fc..61fd1761 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,7 +27,7 @@ jobs: - name: Install tox id: install-tox run: | - uv pip install tox tox-uv + uv pip install --system tox tox-uv - name: Run code quality tests with tox id: lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c8e9db7..41dc6727 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: - name: Install tox and plugins id: install-tox run: | - uv pip install tox tox-uv tox-gh-actions + uv pip install --system tox tox-uv tox-gh-actions - name: Run unit tests with tox id: test @@ -65,7 +65,7 @@ jobs: - name: Install tox and plugins id: install-tox run: | - uv pip install tox tox-uv tox-gh-actions + uv pip install --system tox tox-uv tox-gh-actions - name: Set up target Python ${{ matrix.python-version }} id: setup-target-python