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..565e5ce93 --- /dev/null +++ b/scripts/update_test_requirements.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +cd "$(dirname "$0")/.." +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 f6816ae64..ee846d45b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,23 +1,20 @@ -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 +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" },