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 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")