All public parametric macros now accept long options in addition
to short options. For example, %pyproject_buildrequires --no-runtime
is equivalent to %pyproject_buildrequires -R.
This is implemented via a Lua option parser (pyproject_getopt.lua)
installed to %{_rpmluadir}/fedora/rpm/. All macros use (-) to opt out
of RPM native getopt and call the Lua parser for validation, mutual
exclusion checks, and value extraction.
Other changes:
- Toxenv construction inlined in Lua, replacing pyproject_construct_toxenv.py
- Added --config-settings and --directory long forms to Python argparse
- Renamed --read-pyproject-dependencies to --pyproject-dependencies
(this was not part of API and now it is, so I picked a shorter name)
- Added test_getopt_consistency.py to assert option mappings match
across macros.pyproject, Python scripts, and README.md
- Converted ~half of test specs to use long options
- Documented all short/long mappings in README.md
- All Python scripts expose their argparser() functions fer easier consistency asserts
Co-Authored-By: Maxwell G <maxwell@gtmx.me>
Assisted-By: Claude Opus 4.6
(cherry picked from Fedora commit 6d3ad45c08)
Overrides are declared in %prep and automatically apply to both
BuildRequires (via %pyproject_buildrequires) and runtime Requires
(by patching installed .dist-info/METADATA during %pyproject_install).
Supported actions: drop_upper, drop_lower, drop_constraints,
set_upper, set_lower, and ignore. For == and ~=, drop_upper/drop_lower
decompose into half-bounds following PEP 440 semantics.
The :br_only suffix restricts an override to BuildRequires only,
for multi-wheel specs where a sibling package must be kept as a
runtime dependency.
Resolves: rhbz#2386906
Assisted-by: Claude (Anthropic)
Made-with: Cursor
(cherry picked from Fedora commit 5d9798f289)
It is not available in EPEL 10 and we can avoid it by excluding more imports,
which is what this spec file tests anyway.
(cherry picked from commit 459cda2e67)
- The -l flag can be used to assert at least 1 License-File was detected
- The -L flag explicitly disables this check (which remains the default)
Co-Authored-By: Maxwell G <maxwell@gtmx.me>
%%pyproject_save_files newly saves also a list of importable modules.
The list is used by %%pyproject_check_import to invoke the import test
on each module name.
%%pyproject_check_import accepts two options:
-t: filter only top-level modules
-e: exclude module names matching the given glob from the import check
Related: rhbz#1950291