From c103d51c0db615c8e6d20de8a927a18e3ed9a0b5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Mar 2025 11:17:31 -0500 Subject: [PATCH 1/5] chore: bump pytest version and include pytest-xdist Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 3 +-- README.md | 2 +- noxfile.py | 2 +- pyproject.toml | 8 ++++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a172ae4e..ee4729ab8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,14 +121,13 @@ jobs: run: uv pip install -e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools] - pytest-xdist --system + --system - name: Install package (pip) if: matrix.python-version == 'pypy-3.8' run: pip install -e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools] - pytest-xdist - name: Test package if: "!contains(matrix.python_version, 'pypy')" diff --git a/README.md b/README.md index 8971bcd42..f28300e8f 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ strict-config = true experimental = false # If set, this will provide a method for backward compatibility. -minimum-version = "0.10" # current version +minimum-version = "0.11" # current version # The build directory. Defaults to a temporary directory, but can be set. build-dir = "" diff --git a/noxfile.py b/noxfile.py index 003fcaf00..49bfb5d70 100644 --- a/noxfile.py +++ b/noxfile.py @@ -74,7 +74,7 @@ def _run_tests( posargs.append("--cov-config=pyproject.toml") install_arg = f"-e.[{','.join(_extras)}]" - session.install(install_arg, *install_args, "pytest-xdist", silent=False) + session.install(install_arg, *install_args, silent=False) session.run("pytest", *run_args, *posargs, env=env) diff --git a/pyproject.toml b/pyproject.toml index 237f43d86..fbe7e682a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,8 +52,9 @@ test = [ "pip>=23; python_version<'3.13'", "pip>=24.1; python_version>='3.13'", "pybind11 >=2.11", - "pytest >=7.0", # 7.2+ recommended for better tracebacks with ExceptionGroup + "pytest >=7.2", "pytest-subprocess >=1.5", + 'pytest-xdist >=3.1', 'setuptools >=43; python_version<"3.9"', 'setuptools >=45; python_version=="3.9"', 'setuptools >=49; python_version>="3.10" and python_version<"3.12"', @@ -126,14 +127,13 @@ build.hooks.vcs.version-file = "src/scikit_build_core/_version.py" [tool.uv] dev-dependencies = ["scikit-build-core[test,test-hatchling,test-meta,test-numpy,test-schema,cov,dev]"] -environments = ["python_version >= '3.11'"] pip.reinstall-package = ["scikit-build-core"] workspace.members = ["tmp/hello/hello"] [tool.pytest.ini_options] -minversion = "7.0" -addopts = ["-rfEsX", "--strict-markers", "--strict-config"] +minversion = "7.2" +addopts = ["-ra", "--strict-markers", "--strict-config"] xfail_strict = true filterwarnings = [ "error", From bd705d5bd0b5660841d4147ec1ead36f111f9e59 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Mar 2025 16:18:17 -0500 Subject: [PATCH 2/5] ci: run in threads more often Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee4729ab8..46c5ab126 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: run: pip list - name: Test min package - run: pytest -ra --showlocals -Wdefault + run: pytest -n auto -ra --showlocals -Wdefault manylinux: name: Manylinux on 🐍 3.13 • Free-threaded @@ -222,7 +222,7 @@ jobs: run: /venv/bin/pip install -e .[test] ninja - name: Test package - run: /venv/bin/pytest + run: /venv/bin/pytest -n auto cygwin: name: Tests on 🐍 3.9 • cygwin @@ -246,7 +246,7 @@ jobs: - name: Test package run: - python3.9 -m pytest -ra --showlocals -m "not virtualenv" + python3.9 -m pytest -n auto -ra --showlocals -m "not virtualenv" --durations=20 msys: @@ -279,7 +279,7 @@ jobs: - name: Test package run: >- - python -m pytest -ra --showlocals -m "not broken_on_urct" + python -m pytest -n auto -ra --showlocals -m "not broken_on_urct" --durations=20 mingw64: @@ -312,7 +312,7 @@ jobs: - name: Test package run: >- - python -m pytest -ra --showlocals -m "not setuptools" --durations=20 + python -m pytest -n augo -ra --showlocals -m "not setuptools" --durations=20 env: SETUPTOOLS_USE_DISTUTILS: "local" From ee88e8a29eb7496e630b5c0c7acc95bf97a96ae1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 21:23:58 +0000 Subject: [PATCH 3/5] style: pre-commit fixes --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46c5ab126..19efb688b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -312,7 +312,8 @@ jobs: - name: Test package run: >- - python -m pytest -n augo -ra --showlocals -m "not setuptools" --durations=20 + python -m pytest -n augo -ra --showlocals -m "not setuptools" + --durations=20 env: SETUPTOOLS_USE_DISTUTILS: "local" From 3c53fc2e02c91614a9525faa8d70919d28cd18af Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Mar 2025 16:33:04 -0500 Subject: [PATCH 4/5] Apply suggestions from code review --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19efb688b..603275eee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -312,7 +312,7 @@ jobs: - name: Test package run: >- - python -m pytest -n augo -ra --showlocals -m "not setuptools" + python -m pytest -n auto -ra --showlocals -m "not setuptools" --durations=20 env: SETUPTOOLS_USE_DISTUTILS: "local" From 97bb9c0af4336ab42ba34a529244e8ee3f39faec Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Mar 2025 16:44:10 -0500 Subject: [PATCH 5/5] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 603275eee..9e809c583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,7 +222,7 @@ jobs: run: /venv/bin/pip install -e .[test] ninja - name: Test package - run: /venv/bin/pytest -n auto + run: /venv/bin/pytest cygwin: name: Tests on 🐍 3.9 • cygwin