From 526dd84c3bea13f1b888089ae32b16d9efe09825 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 21:57:34 +0000 Subject: [PATCH 1/2] chore(deps): update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.2 → v0.12.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.2...v0.12.7) - [github.com/pre-commit/mirrors-mypy: v1.16.1 → v1.17.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.16.1...v1.17.1) - [github.com/henryiii/validate-pyproject-schema-store: 2025.06.23 → 2025.07.28](https://github.com/henryiii/validate-pyproject-schema-store/compare/2025.06.23...2025.07.28) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 473cc04a2..ee8d422fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: exclude: "^tests" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.2 + rev: v0.12.7 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -59,7 +59,7 @@ repos: exclude: "^tests|src/scikit_build_core/resources/scikit-build.schema.json|^docs/projects.md" - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.17.1 hooks: - id: mypy exclude: | @@ -131,7 +131,7 @@ repos: additional_dependencies: ["cogapp>=3.5"] - repo: https://github.com/henryiii/validate-pyproject-schema-store - rev: 2025.06.23 + rev: 2025.07.28 hooks: - id: validate-pyproject From bcfdfece7cfccaf6f985d6c750c246ce96f15ad4 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 12 Aug 2025 12:38:13 -0400 Subject: [PATCH 2/2] chore: use 3.9 for mypy Signed-off-by: Henry Schreiner --- pyproject.toml | 2 +- src/scikit_build_core/builder/builder.py | 4 ++-- tests/test_editable.py | 16 ++++++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ddb9543eb..22785c4da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -177,7 +177,7 @@ exclude = [ '^tests/packages/extensionlib/*', ] mypy_path = ["$MYPY_CONFIG_FILE_DIR/src", "$MYPY_CONFIG_FILE_DIR/tests/utils"] -python_version = "3.8" +python_version = "3.9" warn_unused_configs = true warn_unreachable = false enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] diff --git a/src/scikit_build_core/builder/builder.py b/src/scikit_build_core/builder/builder.py index d05065fe8..dde36ddab 100644 --- a/src/scikit_build_core/builder/builder.py +++ b/src/scikit_build_core/builder/builder.py @@ -7,7 +7,7 @@ import sys import sysconfig from pathlib import Path -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from .. import __version__ from .._compat.importlib import metadata, resources @@ -85,7 +85,7 @@ def _filter_env_cmake_args(env_cmake_args: list[str]) -> Generator[str, None, No yield arg -def _sanitize_path(path: os.PathLike[str]) -> list[Path]: +def _sanitize_path(path: Any) -> list[Path]: # This handles classes like: # MultiplexedPath from importlib.resources.readers (3.11+) # MultiplexedPath from importlib.readers (3.10) diff --git a/tests/test_editable.py b/tests/test_editable.py index 573686052..9ff5b52dc 100644 --- a/tests/test_editable.py +++ b/tests/test_editable.py @@ -1,10 +1,12 @@ +from __future__ import annotations + import platform import sys import textwrap from pathlib import Path import pytest -from conftest import PackageInfo, process_package +from conftest import PackageInfo, VEnv, process_package @pytest.mark.compile @@ -160,8 +162,12 @@ def test_install_dir(isolated): def _setup_package_for_editable_layout_tests( - monkeypatch, tmp_path, editable, editable_mode, isolated -): + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + editable: bool, + editable_mode: str, + isolated: VEnv, +) -> None: editable_flag = ["-e"] if editable else [] config_mode_flags = [] @@ -177,6 +183,8 @@ def _setup_package_for_editable_layout_tests( package = PackageInfo("importlib_editable") process_package(package, tmp_path, m) + assert isolated.wheelhouse + ninja = [ "ninja" for f in isolated.wheelhouse.iterdir() @@ -211,7 +219,7 @@ def test_direct_import(monkeypatch, tmp_path, editable, editable_mode, isolated) if platform.system() == "Windows" and editable_mode == "inplace": pytest.xfail("Windows fails to import the top-level extension module") - _setup_package_for_editable_layout_tests( # type: ignore[no-untyped-call] + _setup_package_for_editable_layout_tests( monkeypatch, tmp_path, editable, editable_mode, isolated ) isolated.execute("import pkg")