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)
58 lines
1.4 KiB
RPMSpec
58 lines
1.4 KiB
RPMSpec
%global pypi_name pluggy
|
|
Name: python-%{pypi_name}
|
|
Version: 0.13.0
|
|
Release: 1%{?dist}
|
|
Summary: The plugin manager stripped of pytest specific details
|
|
|
|
License: MIT
|
|
URL: https://github.com/pytest-dev/pluggy
|
|
Source0: %{pypi_source}
|
|
|
|
BuildArch: noarch
|
|
BuildRequires: pyproject-rpm-macros
|
|
# we don't BR python3-devel here just for test purposes, but we recommend you do it
|
|
|
|
%description
|
|
A pure Python library. The package contains tox.ini. Does not contain executables.
|
|
Building this tests:
|
|
- generating runtime and testing dependencies
|
|
- running tests with %%tox
|
|
- the %%pyproject_save_files +auto option works without actual executables
|
|
- pyproject.toml with the setuptools backend and setuptools-scm
|
|
|
|
|
|
%package -n python3-%{pypi_name}
|
|
Summary: %{summary}
|
|
|
|
%description -n python3-%{pypi_name}
|
|
%{summary}.
|
|
|
|
|
|
%prep
|
|
%autosetup -p1 -n %{pypi_name}-%{version}
|
|
# Avoid pytest 8 for now.
|
|
# Once the compat package is removed from Fedora, we will update pluggy.
|
|
sed -i 's/{env:_PYTEST_DEP:pytest}$/{env:_PYTEST_DEP:pytest<8}/' tox.ini
|
|
|
|
|
|
%generate_buildrequires
|
|
%pyproject_buildrequires --tox
|
|
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
|
|
%install
|
|
%pyproject_install
|
|
# There are no executables, but we are allowed to pass +auto anyway
|
|
%pyproject_save_files pluggy +auto --assert-license
|
|
|
|
|
|
%check
|
|
%tox
|
|
|
|
|
|
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
|
%doc README.rst
|