From c5e7f1b8dd0e873848d1ff60f6aaa572a9c26a88 Mon Sep 17 00:00:00 2001 From: David Seddon Date: Mon, 7 Apr 2025 17:24:56 +0100 Subject: [PATCH 1/2] Update pytest-codspeed and github action versions --- .github/workflows/main.yml | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 960f0fc8..72742df5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,9 +56,9 @@ jobs: benchmarks: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.13" allow-prereleases: true diff --git a/tox.ini b/tox.ini index 2830d425..b998da00 100644 --- a/tox.ini +++ b/tox.ini @@ -74,7 +74,7 @@ usedevelop = false deps = pytest==7.4.4 pyyaml==6.0.1 - pytest-codspeed==2.2.1 + pytest-codspeed==3.2.0 Django==5.1.1 commands = {posargs:pytest --codspeed} From 52dc1f8eebe333eaeb95a822570f43da5c39bfb3 Mon Sep 17 00:00:00 2001 From: David Seddon Date: Mon, 7 Apr 2025 17:35:07 +0100 Subject: [PATCH 2/2] Don't run codspeed using tox --- .github/workflows/main.yml | 17 ++++++++++++----- .gitignore | 1 + tox.ini | 4 +++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72742df5..47806a8c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,20 +58,27 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Setup python + uses: actions/setup-python@v5 with: python-version: "3.13" allow-prereleases: true + # Temporarily install hardcoded dependencies here. + # Codspeed doesn't work well with tox, as it runs the tox installation process as part of the benchmarking + # process, which is very slow. - name: Install dependencies run: | python -VV - python -m site - python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade tox tox-gh-actions + uv venv + uv pip install pytest==7.4.4 pyyaml==6.0.1 pytest-codspeed==3.2.0 Django==5.1.1 /home/runner/work/grimp/grimp - name: Run benchmarks uses: CodSpeedHQ/action@v3 with: token: ${{ secrets.CODSPEED_TOKEN }} - run: tox -ecodspeed + run: | + uv run pytest tests/benchmarking/ --codspeed diff --git a/.gitignore b/.gitignore index c6dbd00e..8898f647 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ coverage.xml htmlcov .benchmarks +.codspeed # Translations *.mo diff --git a/tox.ini b/tox.ini index b998da00..3bdb2cb9 100644 --- a/tox.ini +++ b/tox.ini @@ -71,13 +71,15 @@ setenv = passenv = * usedevelop = false +# Note - these dependencies are duplicated in main.yml, make sure to change them there too. +# TODO: switch to UV for dependency management. deps = pytest==7.4.4 pyyaml==6.0.1 pytest-codspeed==3.2.0 Django==5.1.1 commands = - {posargs:pytest --codspeed} + pytest --codspeed {posargs} [testenv:docs]