diff --git a/.distro/python-scikit-build-core.spec b/.distro/python-scikit-build-core.spec index f7f4cc438..e1bf53ec3 100644 --- a/.distro/python-scikit-build-core.spec +++ b/.distro/python-scikit-build-core.spec @@ -1,5 +1,9 @@ %global debug_package %{nil} +# On epel python hatch/trove classifier check may fail because of old package +# Fedora checks should be sufficient though. +%bcond no_classifier_check 0%{?rhel} + Name: python-scikit-build-core Version: 0.0.0 Release: %autorelease @@ -46,10 +50,16 @@ cp -p src/scikit_build_core/_vendor/pyproject_metadata/LICENSE LICENSE-pyproject %generate_buildrequires +%if %{with no_classifier_check} +export HATCH_METADATA_CLASSIFIERS_NO_VERIFY=1 +%endif %pyproject_buildrequires -x test,test-meta,test-numpy %build +%if %{with no_classifier_check} +export HATCH_METADATA_CLASSIFIERS_NO_VERIFY=1 +%endif %pyproject_wheel diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84de6581c..36118b2bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,8 +52,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "pypy-3.10", "3.13"] - runs-on: [ubuntu-latest, macos-13] + python-version: ["3.8", "pypy-3.10", "3.13", "3.14"] + runs-on: [ubuntu-latest, macos-14] cmake-version: ["3.15.x"] include: @@ -76,7 +76,7 @@ jobs: runs-on: macos-13 cmake-version: "3.18.x" - python-version: "3.12" - runs-on: macos-14 + runs-on: macos-13 cmake-version: "3.29.x" - python-version: "3.10" runs-on: ubuntu-latest @@ -90,6 +90,10 @@ jobs: - python-version: "3.12" runs-on: windows-latest cmake-version: "3.26.x" + # TODO: CMake doesn't work with beta 1 on Windows + # - python-version: "3.14" + # runs-on: windows-latest + # cmake-version: "4.0.x" - python-version: "3.13" runs-on: windows-latest cmake-version: "3.26.x" @@ -99,9 +103,6 @@ jobs: - python-version: "3.13" runs-on: ubuntu-24.04-arm cmake-version: "3.31.x" - - python-version: "3.14" - runs-on: ubuntu-latest - cmake-version: "3.30.x" - python-version: "3.12" runs-on: windows-11-arm cmake-version: "4.0" diff --git a/pyproject.toml b/pyproject.toml index c776c69c0..924111bf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Development Status :: 4 - Beta", "Typing :: Typed", ] @@ -208,6 +209,7 @@ messages_control.disable = [ "unused-argument", # Handled by Ruff "redefined-builtin", # ExceptionGroup is a builtin "using-exception-groups-in-unsupported-version", # We are using a backport + "duplicate-code", # Trips up on version ] @@ -305,6 +307,7 @@ known-local-folder = ["pathutils"] "importlib.resources".msg = "Use scikit_build_core._compat.importlib.resources instead." "importlib_resources".msg = "Use scikit_build_core._compat.importlib.resources instead." "pyproject_metadata".msg = "Use scikit_build_core._vendor.pyproject_metadata instead." +"argparse.ArgumentParser".msg = "Use scikit_build_core._compat.argparse instead." [tool.ruff.lint.per-file-ignores] diff --git a/src/scikit_build_core/_compat/argparse.py b/src/scikit_build_core/_compat/argparse.py new file mode 100644 index 000000000..c50491309 --- /dev/null +++ b/src/scikit_build_core/_compat/argparse.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +import argparse +import functools +import sys + +__all__ = ["ArgumentParser"] + + +def __dir__() -> list[str]: + return __all__ + + +ArgumentParser = functools.partial(argparse.ArgumentParser) + +if sys.version_info >= (3, 14): + ArgumentParser = functools.partial( + ArgumentParser, color=True, suggest_on_error=True + ) diff --git a/src/scikit_build_core/build/__main__.py b/src/scikit_build_core/build/__main__.py index 0fa28fda9..b489e32f9 100644 --- a/src/scikit_build_core/build/__main__.py +++ b/src/scikit_build_core/build/__main__.py @@ -4,6 +4,7 @@ from typing import Literal from .._compat import tomllib +from .._compat.argparse import ArgumentParser from .._logging import rich_warning from ..builder._load_provider import process_dynamic_metadata from . import ( @@ -48,7 +49,8 @@ def get_requires(mode: Literal["sdist", "wheel", "editable"]) -> None: def main() -> None: - parser = argparse.ArgumentParser( + parser = ArgumentParser( + allow_abbrev=False, description="Build backend utilities", ) diff --git a/src/scikit_build_core/builder/wheel_tag.py b/src/scikit_build_core/builder/wheel_tag.py index 44f50a2fc..5d8769488 100644 --- a/src/scikit_build_core/builder/wheel_tag.py +++ b/src/scikit_build_core/builder/wheel_tag.py @@ -152,9 +152,9 @@ def as_tags_set(self) -> frozenset[packaging.tags.Tag]: if __name__ == "__main__": - import argparse + from .._compat.argparse import ArgumentParser - parser = argparse.ArgumentParser() + parser = ArgumentParser(allow_abbrev=False) parser.add_argument( "--archs", nargs="*", diff --git a/src/scikit_build_core/file_api/_cattrs_converter.py b/src/scikit_build_core/file_api/_cattrs_converter.py index 0a273f071..4abb62448 100644 --- a/src/scikit_build_core/file_api/_cattrs_converter.py +++ b/src/scikit_build_core/file_api/_cattrs_converter.py @@ -61,7 +61,7 @@ def load_reply_dir(reply_dir: Path) -> Index: if __name__ == "__main__": - import argparse + from .._compat.argparse import ArgumentParser rich_print: Callable[[object], None] try: @@ -69,7 +69,7 @@ def load_reply_dir(reply_dir: Path) -> Index: except ModuleNotFoundError: rich_print = builtins.print - parser = argparse.ArgumentParser() + parser = ArgumentParser(allow_abbrev=False) parser.add_argument("reply_dir", type=Path, help="Path to the reply directory") args = parser.parse_args() diff --git a/src/scikit_build_core/file_api/query.py b/src/scikit_build_core/file_api/query.py index b9321ddca..4c06e74dd 100644 --- a/src/scikit_build_core/file_api/query.py +++ b/src/scikit_build_core/file_api/query.py @@ -23,9 +23,9 @@ def stateless_query(build_dir: Path) -> Path: if __name__ == "__main__": - import argparse + from .._compat.argparse import ArgumentParser - parser = argparse.ArgumentParser() + parser = ArgumentParser(allow_abbrev=False) parser.add_argument("build_dir", type=Path, help="Path to the build directory") args = parser.parse_args() diff --git a/src/scikit_build_core/file_api/reply.py b/src/scikit_build_core/file_api/reply.py index b488a3e39..e10f2c7f9 100644 --- a/src/scikit_build_core/file_api/reply.py +++ b/src/scikit_build_core/file_api/reply.py @@ -111,7 +111,7 @@ def load_reply_dir(path: Path) -> Index: if __name__ == "__main__": - import argparse + from .._compat.argparse import ArgumentParser rich_print: Callable[[object], None] try: @@ -119,7 +119,7 @@ def load_reply_dir(path: Path) -> Index: except ModuleNotFoundError: rich_print = builtins.print - parser = argparse.ArgumentParser() + parser = ArgumentParser(allow_abbrev=False) parser.add_argument("reply_dir", type=Path, help="Path to the reply directory") args = parser.parse_args()