Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .distro/python-scikit-build-core.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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


Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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
]


Expand Down Expand Up @@ -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]
Expand Down
19 changes: 19 additions & 0 deletions src/scikit_build_core/_compat/argparse.py
Original file line number Diff line number Diff line change
@@ -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
)
4 changes: 3 additions & 1 deletion src/scikit_build_core/build/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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",
)

Expand Down
4 changes: 2 additions & 2 deletions src/scikit_build_core/builder/wheel_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@


if __name__ == "__main__":
import argparse
from .._compat.argparse import ArgumentParser

Check warning on line 155 in src/scikit_build_core/builder/wheel_tag.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/builder/wheel_tag.py#L155

Added line #L155 was not covered by tests

parser = argparse.ArgumentParser()
parser = ArgumentParser(allow_abbrev=False)

Check warning on line 157 in src/scikit_build_core/builder/wheel_tag.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/builder/wheel_tag.py#L157

Added line #L157 was not covered by tests
parser.add_argument(
"--archs",
nargs="*",
Expand Down
4 changes: 2 additions & 2 deletions src/scikit_build_core/file_api/_cattrs_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def load_reply_dir(reply_dir: Path) -> Index:


if __name__ == "__main__":
import argparse
from .._compat.argparse import ArgumentParser

rich_print: Callable[[object], None]
try:
from rich import print as rich_print
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()

Expand Down
4 changes: 2 additions & 2 deletions src/scikit_build_core/file_api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions src/scikit_build_core/file_api/reply.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ def load_reply_dir(path: Path) -> Index:


if __name__ == "__main__":
import argparse
from .._compat.argparse import ArgumentParser

rich_print: Callable[[object], None]
try:
from rich import print as rich_print
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()

Expand Down
Loading