diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index aa0bf9c..8b625f5 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.2 +Version: 1.18.3 Release: 1%{?dist} # Macro files @@ -191,6 +191,11 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %changelog +* Fri Jul 11 2025 Miro HronĨok - 1.18.3-1 +- %%pyproject_buildrequires: Do not generate BuildRequires from Requires core metadata fields +- That field is deprecated and should include importable module names, not distribution packages +- Related: rhbz#2378463 + * Mon May 19 2025 Maxwell G - 1.18.2-1 - Fix handling of config_settings in %%pyproject_buildrequires diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index f4c38ab..bba4f00 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -309,7 +309,7 @@ def parse_metadata_file(metadata_file): def requires_from_parsed_metadata_file(message): - return {k: message.get_all(k, ()) for k in ('Requires', 'Requires-Dist')} + return {k: message.get_all(k, ()) for k in ('Requires-Dist',)} def package_name_from_parsed_metadata_file(message): diff --git a/pyproject_buildrequires_testcases.yaml b/pyproject_buildrequires_testcases.yaml index bfbb5bd..ae26569 100644 --- a/pyproject_buildrequires_testcases.yaml +++ b/pyproject_buildrequires_testcases.yaml @@ -1608,3 +1608,23 @@ tox with dependency_groups: python3dist(pytest) >= 5 python3dist(pytest-mock) result: 0 + +Plain Requires fields in core metadata is ignored: + installed: + setuptools: 50 + wheel: 1 + include_runtime: true + setup.py: | + from setuptools import setup + setup( + name='test', + version='0.1', + requires=['ignore_me'], + ) + expected: + - | # setuptools 70+ + python3dist(setuptools) >= 40.8 + - | # setuptools < 70 + python3dist(setuptools) >= 40.8 + python3dist(wheel) + result: 0