From 1191910294d8cfc87222caa602ceeb1b9da5708d Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 1 Feb 2025 15:41:34 +0000 Subject: [PATCH 1/2] Parallel tests --- .github/workflows/main.yml | 20 ++++++++++---------- pyproject.toml | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c22e7c66ad..ba64d790098 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: - name: Install Docutils ${{ matrix.docutils }} run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0" - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -108,7 +108,7 @@ jobs: - name: Install Docutils ${{ matrix.docutils }} run: python -m pip install --upgrade "docutils~=${{ matrix.docutils }}.0" - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -140,7 +140,7 @@ jobs: python -m pip install --upgrade pip python -m pip install .[test] - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -173,7 +173,7 @@ jobs: sed -i 's/flit_core>=3.7/flit_core @ git+https:\/\/github.com\/pypa\/flit.git#subdirectory=flit_core/' pyproject.toml python -m pip install .[test] - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -202,7 +202,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -231,7 +231,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -268,7 +268,7 @@ jobs: - name: Install Docutils' HEAD run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils" - name: Test with pytest - run: python -m pytest -vv + run: python -m pytest -n logical --dist=worksteal -vv env: PYTHONWARNINGS: "error" # treat all warnings as errors DO_EPUBCHECK: "1" @@ -301,7 +301,7 @@ jobs: uv pip install .[test] --resolution lowest-direct uv pip install alabaster==1.0.0 - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -330,7 +330,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -vv --durations 25 + run: python -m pytest -n logical --dist=worksteal -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors DO_EPUBCHECK: "1" @@ -361,7 +361,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] pytest-cov - name: Test with pytest - run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml + run: python -m pytest -n logical --dist=worksteal -vv --cov . --cov-append --cov-config pyproject.toml env: VIRTUALENV_SYSTEM_SITE_PACKAGES: "1" - name: codecov diff --git a/pyproject.toml b/pyproject.toml index d93f8064f10..abd31b8653d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,7 @@ lint = [ ] test = [ "pytest>=8.0", + "pytest-xdist[psutil]>=3.4", "defusedxml>=0.7.1", # for secure XML/HTML parsing "cython>=3.0", "setuptools>=70.0", # for Cython compilation From 89fa6bed1c797f0e30fb6aeae0ed50d3e8a2c813 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 1 Feb 2025 15:44:43 +0000 Subject: [PATCH 2/2] Revert macOS & Windows --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba64d790098..f47d1f84e77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -202,7 +202,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -n logical --dist=worksteal -vv --durations 25 + run: python -m pytest -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -231,7 +231,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -n logical --dist=worksteal -vv --durations 25 + run: python -m pytest -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors @@ -330,7 +330,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] - name: Test with pytest - run: python -m pytest -n logical --dist=worksteal -vv --durations 25 + run: python -m pytest -vv --durations 25 env: PYTHONWARNINGS: "error" # treat all warnings as errors DO_EPUBCHECK: "1" @@ -361,7 +361,7 @@ jobs: - name: Install dependencies run: uv pip install .[test] pytest-cov - name: Test with pytest - run: python -m pytest -n logical --dist=worksteal -vv --cov . --cov-append --cov-config pyproject.toml + run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml env: VIRTUALENV_SYSTEM_SITE_PACKAGES: "1" - name: codecov