From a7d5f09d8e843c200c6d7ff53759f21c73929e81 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 19 May 2025 16:47:47 -0500 Subject: [PATCH] pyproject_buildrequires: don't pass config_settings as kwarg PEP 517 says that the argument should be named config_settings but pip/pyproject-hooks and other build frontends just pass it as a positional argument, so some build backends name this argument other things. Even though those build backends are wrong, it still makes sense to align pyproject-rpm-macros with what the other frontends do. Ref: https://github.com/PyO3/maturin/pull/2612 Ref: https://github.com/Rogdham/pyzstd/pull/2 (cherry picked from Fedora commit 570b5a6ee6015c9cdb86f649b9dbdac93a0c4531) --- pyproject-rpm-macros.spec | 5 ++++- pyproject_buildrequires.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 560af17..aa0bf9c 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -14,7 +14,7 @@ License: MIT # Increment Y and reset Z when new macros or features are added # Increment Z when this is a bugfix or a cosmetic change # Dropping support for EOL Fedoras is *not* considered a breaking change -Version: 1.18.1 +Version: 1.18.2 Release: 1%{?dist} # Macro files @@ -191,6 +191,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %changelog +* Mon May 19 2025 Maxwell G - 1.18.2-1 +- Fix handling of config_settings in %%pyproject_buildrequires + * Fri Mar 21 2025 Miro HronĨok - 1.18.1-1 - Fix reverted conditional in %%pyproject_buildrequires -t/-e Fedora version comparison diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 4ed7950..f4c38ab 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -299,7 +299,7 @@ def get_backend(requirements): def generate_build_requirements(backend, requirements): get_requires = getattr(backend, 'get_requires_for_build_wheel', None) if get_requires: - new_reqs = get_requires(config_settings=requirements.config_settings) + new_reqs = get_requires(requirements.config_settings) requirements.extend(new_reqs, source='get_requires_for_build_wheel') requirements.check(source='get_requires_for_build_wheel') @@ -334,7 +334,7 @@ def generate_run_requirements_hook(backend, requirements): 'table, you can use the -p flag to read them. ' 'Alternatively, use the -R flag not to generate runtime dependencies.' ) - dir_basename = prepare_metadata('.', config_settings=requirements.config_settings) + dir_basename = prepare_metadata('.', requirements.config_settings) with open(dir_basename + '/METADATA') as metadata_file: name, requires = package_name_and_requires_from_metadata_file(metadata_file) for key, req in requires.items():