From 3bd182dd328cdd55fcfaa708f18bfa6532e76354 Mon Sep 17 00:00:00 2001 From: prrao87 Date: Thu, 29 Oct 2026 10:23:13 -0700 Subject: [PATCH] test(python): run the test suite in parallel with pytest-xdist --- .github/workflows/python-test.yml | 2 +- python/Makefile | 2 +- python/pyproject.toml | 1 + python/uv.lock | 24 ++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index f9f7b3a..1123ec9 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -51,7 +51,7 @@ jobs: run: uv run --no-sync maturin develop - name: Run tests working-directory: python - run: uv run --no-sync pytest python/tests/ --doctest-modules python/lance_csr -v + run: uv run --no-sync pytest -n auto python/tests/ --doctest-modules python/lance_csr -v lint: runs-on: ubuntu-24.04 diff --git a/python/Makefile b/python/Makefile index 56aad1c..90c9319 100644 --- a/python/Makefile +++ b/python/Makefile @@ -16,7 +16,7 @@ install: sync $(RUN) maturin develop test: - $(RUN) pytest $(PYTEST_ARGS) python/tests --doctest-modules python/lance_csr + $(RUN) pytest -n auto $(PYTEST_ARGS) python/tests --doctest-modules python/lance_csr lint: $(RUN) ruff check python diff --git a/python/pyproject.toml b/python/pyproject.toml index dc1f246..40c12a7 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -53,6 +53,7 @@ dev = [ "ruff", "pyright", "pyarrow-stubs>=20.0.0.20260819", + "pytest-xdist>=3.8.0", ] [tool.ruff] diff --git a/python/uv.lock b/python/uv.lock index 13aab64..6a33d85 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -29,6 +29,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] +[[package]] +name = "execnet" +version = "2.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size = 166622, upload-time = "2025-11-12T09:56:37.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" }, +] + [[package]] name = "iniconfig" version = "2.3.1" @@ -54,6 +63,7 @@ dev = [ { name = "pyarrow-stubs" }, { name = "pyright" }, { name = "pytest" }, + { name = "pytest-xdist" }, { name = "ruff" }, ] @@ -70,6 +80,7 @@ dev = [ { name = "pyarrow-stubs", specifier = ">=20.0.0.20260819" }, { name = "pyright" }, { name = "pytest" }, + { name = "pytest-xdist", specifier = ">=3.8.0" }, { name = "ruff" }, ] @@ -543,6 +554,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, ] +[[package]] +name = "pytest-xdist" +version = "3.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "execnet" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz", hash = "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size = 88069, upload-time = "2025-07-01T13:30:59.346Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size = 46396, upload-time = "2025-07-01T13:30:56.632Z" }, +] + [[package]] name = "python-dateutil" version = "3.0.0"