From bbbef58103901891d60cefc315e9d7694b72bfc4 Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Fri, 15 May 2026 16:39:00 -0700 Subject: [PATCH 1/2] Pin all dependencies to avoid random build failures. --- .github/workflows/all.yml | 14 +++++++++ pyproject.toml | 6 ++-- scripts/update_test_requirements.sh | 4 +++ test-requirements.txt | 45 ++++++++++++++--------------- uv.lock | 2 ++ 5 files changed, 46 insertions(+), 25 deletions(-) create mode 100755 scripts/update_test_requirements.sh diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index a7aa11530..a712cd1d6 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -36,6 +36,20 @@ jobs: - name: Check Python formatting run: ruff format --check ${{ github.workspace }}/pedalboard --diff + check-test-requirements: + runs-on: "ubuntu-24.04" + name: Check test-requirements.txt is in sync + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Check test-requirements.txt is in sync with uv.lock + run: | + cp test-requirements.txt /tmp/test-requirements.txt.before + ./scripts/update_test_requirements.sh + diff /tmp/test-requirements.txt.before test-requirements.txt \ + || (echo "test-requirements.txt is out of sync with uv.lock. Run ./scripts/update_test_requirements.sh and commit." && exit 1) + type-check-python: runs-on: "ubuntu-24.04" continue-on-error: true diff --git a/pyproject.toml b/pyproject.toml index 9ffc49aab..45f244c6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,16 +60,18 @@ version = "0.9.23" [project.optional-dependencies] test = [ + "coverage", "pytest", - "pyright", - "mutagen", "pytest-cov", "pytest-mock", "tqdm", "psutil", + # mypy 2.0+ unconditionally depends on ast-serialize, which requires Rust + # and can't be built from source on musllinux_1_1. "mypy<2", "pyright", "mido", + "mutagen", ] [tool.scikit-build] diff --git a/scripts/update_test_requirements.sh b/scripts/update_test_requirements.sh new file mode 100755 index 000000000..82a5e49ac --- /dev/null +++ b/scripts/update_test_requirements.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +cd "$(dirname "$0")/.." +uv export --extra test --no-dev --no-emit-project --no-hashes --frozen -o test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt index f6816ae64..e10164a97 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,23 +1,22 @@ -coverage -pytest>6.2 -pytest-cov -pytest-mock -pybind11<2.13; python_version < '3.7' -pybind11>=2.13; python_version >= '3.7' -setuptools>=59 -pip>22; python_version > '3.6' -pip>21; python_version < '3.7' -wheel - -numpy>=2.1.0rc1; python_version>="3.13" -numpy>=2; python_version>="3.9" and python_version<"3.13" -numpy<2; python_version<="3.8" -tqdm -psutil -mypy<2 -pyright -# ty # Uncomment to enable Astral type checker (still in early development) - -# For MIDI support - only in test though! -mido -mutagen \ No newline at end of file +# This file was autogenerated by uv via the following command: +# uv export --extra test --no-dev --no-emit-project --no-hashes --frozen -o test-requirements.txt +colorama==0.4.6 ; sys_platform == 'win32' +coverage==7.8.0 +exceptiongroup==1.3.0 ; python_full_version < '3.11' +iniconfig==2.1.0 +mido==1.3.3 +mutagen==1.47.0 +mypy==1.15.0 +mypy-extensions==1.1.0 +nodeenv==1.9.1 +numpy==2.2.5 +packaging==25.0 +pluggy==1.6.0 +psutil==7.0.0 +pyright==1.1.400 +pytest==8.3.5 +pytest-cov==6.1.1 +pytest-mock==3.14.0 +tomli==2.2.1 ; python_full_version <= '3.11' +tqdm==4.67.1 +typing-extensions==4.13.2 diff --git a/uv.lock b/uv.lock index 189eee150..40d4ea67a 100644 --- a/uv.lock +++ b/uv.lock @@ -255,6 +255,7 @@ dependencies = [ [package.optional-dependencies] test = [ + { name = "coverage" }, { name = "mido" }, { name = "mutagen" }, { name = "mypy" }, @@ -268,6 +269,7 @@ test = [ [package.metadata] requires-dist = [ + { name = "coverage", marker = "extra == 'test'" }, { name = "mido", marker = "extra == 'test'" }, { name = "mutagen", marker = "extra == 'test'" }, { name = "mypy", marker = "extra == 'test'", specifier = "<2" }, From d4206e84309bbd74fbf38acdb34f74727b163584 Mon Sep 17 00:00:00 2001 From: Peter Sobot Date: Fri, 15 May 2026 16:45:47 -0700 Subject: [PATCH 2/2] Ignore comments. --- scripts/update_test_requirements.sh | 5 ++++- test-requirements.txt | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/update_test_requirements.sh b/scripts/update_test_requirements.sh index 82a5e49ac..565e5ce93 100755 --- a/scripts/update_test_requirements.sh +++ b/scripts/update_test_requirements.sh @@ -1,4 +1,7 @@ #!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." -uv export --extra test --no-dev --no-emit-project --no-hashes --frozen -o test-requirements.txt +uv export --extra test --no-dev --no-emit-project --no-hashes --no-header --frozen \ + | grep -v '^ ' \ + | grep -v '^$' \ + > test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt index e10164a97..ee846d45b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,3 @@ -# This file was autogenerated by uv via the following command: -# uv export --extra test --no-dev --no-emit-project --no-hashes --frozen -o test-requirements.txt colorama==0.4.6 ; sys_platform == 'win32' coverage==7.8.0 exceptiongroup==1.3.0 ; python_full_version < '3.11'