1
0

- Update to 0.10.5

* This version fixes an issue rebuilding if you have a build-dir
    set and are using isolated build environments. The cache is now
    correctly cleared if this occurs. An issue with a certain style
    of gitignore was also fixed.
- Version 0.10.4
  * This version fixes the logic for handling the sysconfig
    variables on Windows for the values that used to be only
    provided on UNIX. This mostly affects targeting the Stable ABI
    on Python 3.13. Editable install rebuilds now work if you have
    a wheel.install-dir set, too.
- Version 0.10.3
  * This release fixes an issue on Windows systems with non-utf-8
    default encodings for Python <3.14 when reading gitignores with
    special characters.
- Version 0.10.2
  * This release fixes a regression with 0.10 where a manually
    included file in an sdist would get included twice, affecting
    some tools (like uv).
- Version 0.10.1
  * Fix crash when building inside a submodule by @ausbin in #854
  * cmake.minimum-version logic issue by @henryiii in #853
- Version 0.10.0
  * This version adds auto CMake version discovery, opt-in auto
    minimum-version, rebuild on failure support, quite a few new
    override options greatly expanding the static config options
    for builds, more powerful regexs, and more.
  ## New features:
  * Auto CMake version by @henryiii in #804
  * Auto minimum-version by @henryiii in #798

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-scikit-build-core?expand=0&rev=11
This commit is contained in:
Steve Kowalik 2024-09-06 03:43:50 +00:00 committed by Git OBS Bridge
commit 445638345f
8 changed files with 665 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,366 @@
-------------------------------------------------------------------
Thu Sep 5 20:51:54 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 0.10.5
* This version fixes an issue rebuilding if you have a build-dir
set and are using isolated build environments. The cache is now
correctly cleared if this occurs. An issue with a certain style
of gitignore was also fixed.
- Version 0.10.4
* This version fixes the logic for handling the sysconfig
variables on Windows for the values that used to be only
provided on UNIX. This mostly affects targeting the Stable ABI
on Python 3.13. Editable install rebuilds now work if you have
a wheel.install-dir set, too.
- Version 0.10.3
* This release fixes an issue on Windows systems with non-utf-8
default encodings for Python <3.14 when reading gitignores with
special characters.
- Version 0.10.2
* This release fixes a regression with 0.10 where a manually
included file in an sdist would get included twice, affecting
some tools (like uv).
- Version 0.10.1
* Fix crash when building inside a submodule by @ausbin in #854
* cmake.minimum-version logic issue by @henryiii in #853
- Version 0.10.0
* This version adds auto CMake version discovery, opt-in auto
minimum-version, rebuild on failure support, quite a few new
override options greatly expanding the static config options
for builds, more powerful regexs, and more.
## New features:
* Auto CMake version by @henryiii in #804
* Auto minimum-version by @henryiii in #798
* Add fail setting to instant-fail build by @henryiii in #824
* Add messages config for failure/success by @henryiii in #825
* New color system for message config by @henryiii in #842
* Add if.abi-flags (for free-threaded) by @henryiii in #819
* Adding if.system-cmake and if.cmake-wheel by @henryiii in #826
* Add if.from-sdist for overrides by @henryiii in #812
* Add if.failed (retry) by @henryiii in #820
* Add if.scikit-build-version by @henryiii in #851
* Packages can also be specified via a table by @henryiii in #841
* Move cmake.targets and cmake.verbose to build.targets and
build.verbose by @henryiii in #793
* Support multipart regex using result= by @henryiii in #818
* Add remove= postprocess to regex by @henryiii in #828
## Fixes:
* Warn if cmake/ninja in build system requirements by @henryiii
in #803
* Detect manual generator setting for get_requires_* by @henryiii
in #840
* Support nested and local gitignores by @henryiii in #827
- Version 0.9.8
* This version ships a few more small fixes. Multi-target builds
were missing build arguments due to an exhausted generator. And
some packages seem to hard-code ${CMAKE_INSTALL_PREFIX} in the
install() call, which is an anti-pattern, but we can set that
variable too. More tests now run on Python 3.7.
## Fixes:
* Empty build arguments for some targets in multi-target build by
@junrushao in #784
* Support packages that hardcode CMAKE_INSTALL_PREFIX in their
install commands by @henryiii in #786
* Logger shouldn't warn for missing lib on UNIX by @henryiii in
* #787
## Tests:
* Use ZipFile instead of zipfile.Path to enable more tests on
Python 3.7 by @henryiii in #785
- Version 0.9.7
* Set CC and CXX from sysconfig if not set by @henryiii in #782
* musllinux tag incorrect by @henryiii in #773
* Logger unconditionally set to DEBUG in non-PEP 517 usage by
@henryiii in #779
- Version 0.9.6
* Improve error message when metadata.version.provider not set by
@thewtex in #762
* Only inject logic if cmake_* keywords present by @kiwifb in
#768
* Only replace color tags if the color is defined by @bnavigator
in #764
- Drop scikit-build-core-pr764-printversion.patch
-------------------------------------------------------------------
Sun Jun 9 18:50:49 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 0.9.5
* Support Windows free-threading by @henryiii in #759
* Strip whitespace around generator so that it's passed through
correctly by @vyasr in #748
- Version 0.9.4
* This version supports the newly available free-threading
variant of Python 3.13b1 (mostly related to skipping the stable
ABI). We test this via the manylinux/musllinux images. There's
also a new feature requested by third-party packagers; the
ability to pass args directly to the build tool
* Add build.tool-args by @henryiii in #733
## Fixes:
* Support free-threaded builds of Python 3.13+ on Linux by
@henryiii in #741
* Slightly better stable ABI behavior using PyPy by @henryiii in
#741
- Version 0.9.3
* This version ensures the Hatchling plugin correctly indicates
editable mode is not yet supported, supports CMAKE_ARGS that
have spaces, and has a bit of other minor cleanup.
## Fixes:
* Properly indicate lack of editable support in Hatch plugin by
@ofek in #728
* Don't generate entrypoints.txt if none set by @henryiii in #729
* Don't warn if lib not found on UNIX, just debug by @henryiii in
#730
* Support CMAKE_ARGS that may have spaces inside quotes by @vyasr
in #727
- Version 0.9.2
* Quick fix for quick fix in 0.9.1; if cmake is a broken script
(which can happen if you pip install outside an environment
then enter an environment, there was an unbound local error
instead of ignoring the broken cmake script.)
## Fixes:
* Unbound local error by @henryiii in #719
- Version 0.9.1
* Quick fix for Pyodide (WebAssembly) builds.
## Fixes:
* Try --version if -E capabilities fails by @henryiii in #717
- Version 0.9.0
* This version adds the ability to inherit in override tables,
matching a similar feature added to cibuildwheel 2.17's
overrides. You can now write out extra metadata to
${SKBUILD_METADATA_DIR}. A new Hatchling plugin is provided as
an experimental feature (will likely be made a separate package
in the future like the setuptools plugin).
* The meaning of wheel.exclude has been changed to match on the
wheel path, rather than the source path. We could not find any
projects that would be affected by this change, so it was not
added to the minimum-version protection policy. This now allows
you to ignore CMake outputs as well.
## Features:
* Preserve additivity of cmake.define across overrides tables by
@stubbiali in #564
* Add metadata dir access by @henryiii in #702
* Experimental hatchling builder by @henryiii and
@aryamanjeendgar in #637
* Vendor pyproject-metadata by @henryiii in #703
* Always require pathspec by @henryiii in #711
## Fixes:
* Exclude installed files if listed in exclude by @henryiii in
#652
* Make .git_archival.txt reproducible by @LecrisUT in #706
* Use cmake -E capabilities instead of cmake --version by
@KyleFromNVIDIA in #675
* Ensure many/musl tags not selected by @henryiii in #698
* purelib should set py3 tag if unset by @henryiii in #661
* Validate description for 0.9+ by @henryiii in #709
* Support bools in config settings by @henryiii in #712
## API changes:
* extra_settings for SettingsReader by @henryiii in #697
* GetRequires args changed by @henryiii in #699
* Make from_file a little more powerful by @henryiii in #700
* Metadata is part of the build backend by @henryiii in #708
- Version 0.8.2
* This version fixes a few small issues related to configuration.
The wheel tag is fixed when wheel.platlib is False, inplace
editable installs ignore build-dir, and install-dir no longer
affects the generate path.
## Fixes:
* Ensure wheel.platlib being false sets <abi>-<platform> as
"none-any" by @jcfr in #655
* Inplace editable install should ignore build-dir by @henryiii
in #644
* install-dir shouldn't affect generate path by @henryiii in #654
* Expand info printing by @henryiii in #651
- Version 0.8.1
* This version fixes two small issues with specific situations:
if ninja/cmake is present but not executable, and ninja on
Windows not respecting the build type.
## Fixes:
* Do not exit with exec permission error in ninja check by
@thewtex in #626
* Include CMAKE_BUILD_TYPE on Windows Ninja by @henryiii in #640
* Use - vs _ in error message by @nbelakovski in #638
* Make run command logged at info by @LecrisUT in #639
- Version 0.8.0
* This version replaces the cmake/ninja minimum-version config
option with a more powerful free-form version field.
Scikit-build-core will now respect CMAKE_EXECUTABLE for finding
CMake. You can override based on the build state, allowing
overrides for editable installs, for example. You can specify a
build tag (AKA build number). And you can define CMake
variables from environment variables.
## Features:
* Add build-tag by @henryiii in #612
* Add if.state to overrides by @henryiii in #600
* Add cmake.version and ninja.version by @henryiii in #602
* Support CMAKE_EXECUTABLE by @henryiii in #603
* Config to set CMake variables with environment variables by
@stubbiali in #565
## Fixes:
* Include license file entry in search by @henryiii in #601
* Make sure purelib is indicated by @henryiii in #613
* Project version should always be CMake parsable by @henryiii in
#608
- Version 0.7.1
* This is a quick fix for a downstream change in
hatch-fancy-pypi-readme that broke our plugin wrapper.
## Fixes:
* Patch for change in hatch-fancy-pypi-readme by @henryiii in
#593
- Version 0.7.0
* This release features several large improvements to overrides:
a new if.any group to allow selections based on any item being
true, and a new if.env option for selecting an override based
on environment variables. You can now build pure Python
packages with wheel.cmake = false, perfect for providing a
slower pure Python version of a package on unsupported systems
via overrides.
* There's also a new inplace mode for editable installs, which
has drawbacks but feels like the classic "--inplace" setting in
setuptools and can enable some tooling that would otherwise not
support modern editable installs to work. If you are using
Cython to access .pxd files, modern ("redirect") editable
installs now support that. And to help avoid collisions with a
future user feature, config settings can now be passed with an
optional namespace, skbuild., as well.
## Features:
* Add inplace mode for editable installs by @henryiii in #553
* Add wheel.exclude by @henryiii in #560
* Support cmake-less runs (for overrides) by @henryiii in #550
* Support if.any by @henryiii in #548
* Support if.env by @henryiii in #549
* Support namespaced config settings (skbuild.) by @henryiii in
#556
## Fixes:
* Correct issue with editable template & add more tests by
@henryiii in #552
* Support editable installs of Cython .pxd files by @vyasr in
#516
- Version 0.6.1
## Fixes:
* Editable package imports fix (regression in 0.6.0) by @henryiii
in #546
* Filter CMAKE_ARGS and debug printout by @henryiii in #543
- Version 0.6.0
* This release features overrides, a system similar to mypy and
cibuildwheel's overrides, allowing static configuration of
special cases, like different settings per operating system or
Python version ranges. It also features preliminary support for
importlib.resources in editable mode.
## Features:
* Adding overrides by @henryiii in #514
* Overrides platform node by @0xTowel in #526
* Support importlib.resources in editable installs by @LecrisUT
in #399
## Fixes:
* Better handling for -G by @henryiii in #483
* Nicer error message when SCM version missing by @henryiii in
#528
* (schema) Fix a typo and better metadata support by @henryiii in
#522
* (setuptools) Remove DEBUG envvar by @henryiii in #527
- Version 0.5.1
## Features:
* Add {build_type} and {state} to build-dir by @henryiii in #504
* Include 'python' dir as an auto search path by @henryiii in
#499
## Fixes:
* Parse CMake version strings containing '-' by @jllllll in #508
* Set NumPy include directory if known by @henryiii in #482
* Adapt for setuptools_scm 8 writing change by @henryiii in #509
* (setuptools) Support build_type set in toml by @henryiii in
#498
- Version 0.5.0
* This release sees the addition of a generated schema, which has
also been contributed to SchemaStore, enabling
tool.scikit-build to be understood by most editors. There's
also now a way to enable CMake during the SDist step, a new
regex plugin, and a mechanism to write metadata to a file
without having to depend on the plugin.
## Features:
* Add option to run CMake during SDist creation by @henryiii in
#454
* Add a schema for validate-pyproject by @henryiii in #447, #450,
#455
* Added regex plugin and dynamic-metadata rewrite by @henryiii in
#457
* Add configuration option to write metadata to file by @henryiii
in #459
## Fixes:
* Normalize sdist names by @henryiii in #434
* Report cmake/ninja required if already present by @henryiii in
#462
- Version 0.4.8
* This release focus on two fixes that correct some interference
issues with other setuptools plugins. A few new features were
added (opt-in only): the ability to select build targets,
install components, and opt-in --strip (will be opt-out in 0.5
if the minimum-version is set to 0.5+ or unset).
## Features:
* Add build target support by @henryiii in #432
* Add component support and strip support by @henryiii in #430
## Fixes:
* (setuptools) Avoid instantiating build too soon by @henryiii in
#443
* (setuptools) Avoid interfering with other setuptools plugins by
@henryiii in #414
* Only link to valid module paths (not things like gitignore) in
editable installs by @henryiii in #444
- Add scikit-build-core-pr764-printversion.patch
* gh#scikit-build/scikit-build-core#764
-------------------------------------------------------------------
Mon Apr 8 10:39:28 UTC 2024 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons
-------------------------------------------------------------------
Fri Jun 30 18:52:43 UTC 2023 - Atri Bhattacharya <badshah400@gmail.com>
- Update to version 0.4.7:
* remove SKBUILD_STATE unused message when building
[gh#scikit-build/scikit-build-core#401].
* logging environment should use reprs
[gh#scikit-build/scikit-build-core#409].
- Add %{name}.rpmlintrc file to suppress false positives about
missing required or left-over python modules.
- Disable an additional sdist test that requires access to the
network.
- Rebase scikit-build-core-offline-wheelhouse.patch so that it
applies cleanly against updated sources.
-------------------------------------------------------------------
Thu Apr 6 07:20:09 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.2.2:
* zipinfo should report regular files
* Support running in environments with SOURCE_DATE_EPOCH set
* Report self version too
* refactor: use from_pyproject
* Add {wheel_tag} for build-dir
* Support for conda's CMAKE_SYSTEM_PROCESSOR
* Print out paths
* docs: update readme for 3.26 backport
* tests: support running tests with system cmake3 visible
* tests: nicer exit, minor refactors
* refactor: minor changes & nicer environment logging printout
* Local build directory setting & build reuse
* Add prepare_metadata_for_build_wheel
* Native wheel writer implementation
* Use 3.26 dev version port of FindPython
* tests: allow pytest 7.0+ instead of 7.2+
* tests: include cmake and ninja if missing in nox
* tests: simpler pytest-subprocess
* chore: Python 3.11 Self usage
* chore: fix Ruff configuration
* chore: minor adjustments to wheel returns
* chore: remove duplicate Ruff code
* fix: handle local cmake dir for search
* fix: avoid resolving cmake/ninja paths
* tests: add isolated marker to test_pep518_sdist
-------------------------------------------------------------------
Fri Jan 27 17:59:12 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Initial specfile for v0.1.5
- New build backend. First user: python-awkward-cpp
- Add patch: scikit-build-core-offline-wheelhouse.patch for
offline wheelhouse in testing

View File

@ -0,0 +1,127 @@
#
# spec file for package python-scikit-build-core
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-scikit-build-core
Version: 0.10.5
Release: 0
Summary: Build backend for CMake based projects
License: Apache-2.0
URL: https://github.com/scikit-build/scikit-build-core
Source0: https://files.pythonhosted.org/packages/source/s/scikit_build_core/scikit_build_core-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE scikit-build-core-offline-wheelhouse.patch provide the testing wheels without runtime download code@bnavigator.de
Patch1: scikit-build-core-offline-wheelhouse.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatch-vcs}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module packaging >= 21.3}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: cmake >= 3.15
Requires: python-packaging >= 21.3
Requires: python-pathspec >= 0.10.1
Requires: (python-exceptiongroup >= 1 if python-base < 3.11)
Requires: (python-importlib-metadata >= 4.13 if python-base < 3.8)
Requires: (python-importlib-resources >= 1.3 if python-base < 3.9)
Requires: (python-tomli >= 1.2.2 if python-base < 3.11)
Requires: (python-typing-extensions >= 3.10.0 if python-base < 3.9)
Recommends: ninja
Recommends: python-rich
Provides: python-scikit_build_core = %{version}-%{release}
# SECTION require runtime
BuildRequires: %{python_module exceptiongroup >= 1 if %python-base < 3.11}
BuildRequires: %{python_module importlib-metadata >= 4.13 if %python-base < 3.8}
BuildRequires: %{python_module importlib-resources >= 1.3 if %python-base < 3.9}
BuildRequires: %{python_module pathspec >= 0.10.1}
BuildRequires: %{python_module tomli >= 1.2.2 if %python-base < 3.11}
BuildRequires: %{python_module typing-extensions >= 3.10.0 if %python-base < 3.9}
BuildRequires: cmake >= 3.15
BuildArch: noarch
# /SECITON
# SECTION test requirements
BuildRequires: %{python_module build >= 0.8}
BuildRequires: %{python_module cattrs >= 22.2.0}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module distlib >= 0.3.5}
BuildRequires: %{python_module pybind11-devel >= 2.11}
BuildRequires: %{python_module pytest >= 7.2}
BuildRequires: %{python_module pytest-subprocess >= 1.5.0}
BuildRequires: %{python_module rich}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module virtualenv >= 20.20}
BuildRequires: %{python_module wheel}
BuildRequires: gcc-c++
BuildRequires: ninja
# /SECTION
%python_subpackages
%description
Python CMake adaptor and Python API for plugins
Features over classic Scikit-build:
- Better warnings, errors, and logging
- No warning about unused variables
- Automatically adds Ninja and/or CMake only as required
- No dependency on setuptools, distutils, or wheel in build mode.
- Powerful config system, including config options support in build mode.
- Automatic inclusion of site-packages in CMAKE_PREFIX_PATH
- FindPython is backported if running on CMake < 3.24 (included via hatchling in a submodule, configurable)
- Limited API / Stable ABI and pythonless tags supported via config option
- No slow generator search, ninja/make or MSVC used by default, respects CMAKE_GENERATOR
- SDists are reproducible by default (UNIX, Python 3.9+)
%package pyproject
Summary: The scikit_build_core[pyproject] extra
Requires: python-scikit-build-core = %{version}
Provides: python-scikit_build_core-pyproject = %{version}-%{release}
%description pyproject
Python CMake adaptor and Python API for plugins: The extra requirement to build PEP518 wheels and sdists
%prep
%autosetup -p1 -n scikit_build_core-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# A writable temp dir is required for some tests
mkdir ./tmp
export PYTEST_DEBUG_TEMPROOT=./tmp
# no wheel dependencies for isolated build provided
donttestmark="isolated"
# different hash due to different build environment:
donttest="test_pep517_sdist_hash or test_pep518_sdist"
%pytest -m "not ($donttestmark)" -k "not ($donttest)"
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/scikit_build_core
%{python_sitelib}/scikit_build_core-%{version}.dist-info
%files %{python_files pyproject}
%license LICENSE
%doc README.md
%changelog

View File

@ -0,0 +1,57 @@
Index: scikit_build_core-0.10.5/tests/conftest.py
===================================================================
--- scikit_build_core-0.10.5.orig/tests/conftest.py
+++ scikit_build_core-0.10.5/tests/conftest.py
@@ -35,51 +35,7 @@ BASE = DIR.parent
@pytest.fixture(scope="session")
def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path:
- wheelhouse = tmp_path_factory.mktemp("wheelhouse")
-
- subprocess.run(
- [
- sys.executable,
- "-m",
- "pip",
- "wheel",
- "--wheel-dir",
- str(wheelhouse),
- f"{BASE}",
- ],
- check=True,
- )
- packages = [
- "build",
- "cython",
- "hatchling",
- "pip",
- "pybind11",
- "setuptools",
- "virtualenv",
- "wheel",
- ]
-
- if importlib.util.find_spec("cmake") is not None:
- packages.append("cmake")
-
- if importlib.util.find_spec("ninja") is not None:
- packages.append("ninja")
-
- subprocess.run(
- [
- sys.executable,
- "-m",
- "pip",
- "download",
- "-q",
- "-d",
- str(wheelhouse),
- *packages,
- ],
- check=True,
- )
- return wheelhouse
+ return os.getcwd() + '/build'
class VEnv:

View File

@ -0,0 +1,85 @@
From bc81cb1250ab4488fef55c081feccf6620e28144 Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Sun, 9 Jun 2024 22:07:19 +0200
Subject: [PATCH 1/3] Only replace rich if the color is defined
---
src/scikit_build_core/_logging.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/scikit_build_core/_logging.py b/src/scikit_build_core/_logging.py
index c449c74f..ad1433b7 100644
--- a/src/scikit_build_core/_logging.py
+++ b/src/scikit_build_core/_logging.py
@@ -116,10 +116,16 @@ def colors() -> dict[str, str]:
return _COLORS
return _NO_COLORS
+def _sub_rich(m: re.Match) -> str:
+ try:
+ r = "".join(colors()[x] for x in m.group(1).split())
+ except KeyError:
+ r = m.group(0)
+ return r
def _process_rich(msg: object) -> str:
return ANY_ESCAPE.sub(
- lambda m: "".join(colors()[x] for x in m.group(1).split()),
+ _sub_rich,
str(msg),
)
From aa97911dacb0460f9d6eef27240bee92894aa364 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Sun, 9 Jun 2024 20:11:51 +0000
Subject: [PATCH 2/3] style: pre-commit fixes
---
src/scikit_build_core/_logging.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/scikit_build_core/_logging.py b/src/scikit_build_core/_logging.py
index ad1433b7..a824ac24 100644
--- a/src/scikit_build_core/_logging.py
+++ b/src/scikit_build_core/_logging.py
@@ -116,6 +116,7 @@ def colors() -> dict[str, str]:
return _COLORS
return _NO_COLORS
+
def _sub_rich(m: re.Match) -> str:
try:
r = "".join(colors()[x] for x in m.group(1).split())
@@ -123,6 +124,7 @@ def _sub_rich(m: re.Match) -> str:
r = m.group(0)
return r
+
def _process_rich(msg: object) -> str:
return ANY_ESCAPE.sub(
_sub_rich,
From bbbd406e90a7f3e001bf7c7df367e97af5cf32ba Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Sun, 9 Jun 2024 22:25:27 +0200
Subject: [PATCH 3/3] Fix typing annotation
---
src/scikit_build_core/_logging.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scikit_build_core/_logging.py b/src/scikit_build_core/_logging.py
index a824ac24..66957d32 100644
--- a/src/scikit_build_core/_logging.py
+++ b/src/scikit_build_core/_logging.py
@@ -117,7 +117,7 @@ def colors() -> dict[str, str]:
return _NO_COLORS
-def _sub_rich(m: re.Match) -> str:
+def _sub_rich(m: re.Match[Any]) -> str:
try:
r = "".join(colors()[x] for x in m.group(1).split())
except KeyError:

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1c3187bbf40fa0445e1c0562c87e9f5c17939a0df6b0141e5951dfebcb92d0e
size 253285

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a4cb119cc968fe87ae05582979657cc0e7be45655798446eabbe490e61ce072
size 228404