diff --git a/.cspell/library_terms.txt b/.cspell/library_terms.txt index 092afec1..ac427b2c 100644 --- a/.cspell/library_terms.txt +++ b/.cspell/library_terms.txt @@ -152,6 +152,7 @@ vars viewcode vmap vmaps +worksteal writebytes xlabel ylabel diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2d8c43bb..c3ab7efc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -47,7 +47,7 @@ jobs: - name: Debug - uv pip freeze run: uv pip freeze - name: Assess coverage of unit tests - run: uv run pytest tests/unit --cov + run: uv run pytest tests/unit -n auto --dist worksteal --cov - name: Extract total coverage percentage id: cov run: | diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index be19a437..3414b2cc 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -58,10 +58,10 @@ jobs: - name: Debug - uv pip freeze run: uv pip freeze - name: Test with pytest - run: uv run pytest --ignore=tests/integration + run: uv run pytest --ignore=tests/integration -n auto --dist worksteal # Integration tests are slow, so only run if all other tests pass. - name: Test integration tests - run: uv run pytest tests/integration + run: uv run pytest tests/integration -n auto --dist worksteal - name: Minimize UV cache run: uv cache prune --ci if: always() diff --git a/pyproject.toml b/pyproject.toml index a03958bb..66c99fe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ test = [ "pytest>=8", "pytest-cov>=6", "pytest-rerunfailures>=15", + "pytest-xdist>=3", "scipy>=1.13", ] # Compile documentation diff --git a/uv.lock b/uv.lock index 89223107..5fc2b9d8 100644 --- a/uv.lock +++ b/uv.lock @@ -730,6 +730,7 @@ test = [ { name = "pytest" }, { name = "pytest-cov" }, { name = "pytest-rerunfailures" }, + { name = "pytest-xdist" }, { name = "scipy", version = "1.13.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, { name = "scipy", version = "1.15.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "torch" }, @@ -768,6 +769,7 @@ requires-dist = [ { name = "pytest", marker = "extra == 'test'", specifier = ">=8" }, { name = "pytest-cov", marker = "extra == 'test'", specifier = ">=6" }, { name = "pytest-rerunfailures", marker = "extra == 'test'", specifier = ">=15" }, + { name = "pytest-xdist", marker = "extra == 'test'", specifier = ">=3" }, { name = "scikit-learn", specifier = ">=1" }, { name = "scipy", marker = "extra == 'test'", specifier = ">=1.13" }, { name = "sphinx", marker = "extra == 'doc'", specifier = ">=7" }, @@ -1103,6 +1105,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453 }, ] +[[package]] +name = "execnet" +version = "2.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bb/ff/b4c0dc78fbe20c3e59c0c7334de0c27eb4001a2b2017999af398bf730817/execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3", size = 166524 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/09/2aea36ff60d16dd8879bdb2f5b3ee0ba8d08cbbdcdfe870e695ce3784385/execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", size = 40612 }, +] + [[package]] name = "executing" version = "2.2.0" @@ -3683,6 +3694,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/89/37/54e5ffc7c0cebee7cf30a3ac5915faa7e7abf8bdfdf3228c277f7c192489/pytest_rerunfailures-15.0-py3-none-any.whl", hash = "sha256:dd150c4795c229ef44320adc9a0c0532c51b78bb7a6843a8c53556b9a611df1a", size = 13017 }, ] +[[package]] +name = "pytest-xdist" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "execnet" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/41/c4/3c310a19bc1f1e9ef50075582652673ef2bfc8cd62afef9585683821902f/pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d", size = 84060 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/82/1d96bf03ee4c0fdc3c0cbe61470070e659ca78dc0086fb88b66c185e2449/pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7", size = 46108 }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0"