pyproject-rpm-macros/tests/python-ipykernel.spec
Miro Hrončok ef9de25d3f Add long option support for all public parametric macros
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)
2026-08-19 17:32:22 +02:00

54 lines
1.5 KiB
RPMSpec

Name: python-ipykernel
Version: 6.11.0
Release: 0%{?dist}
Summary: IPython Kernel for Jupyter
License: BSD-3-Clause
URL: https://github.com/ipython/ipykernel
Source0: https://github.com/ipython/ipykernel/archive/v%{version}/ipykernel-%{version}.tar.gz
BuildArch: noarch
BuildRequires: pyproject-rpm-macros
BuildRequires: python3-devel
%description
This package contains data files.
Building this tests that data files are not listed when +auto is not used
with %%pyproject_save_files.
Run %%pyproject_check_import on installed package and exclude unwanted modules
(if they're not excluded, build fails).
- We don't want to pull test dependencies just to check import
- The others fail to find `gi` and `matplotlib` which weren't declared
in the upstream metadata
%package -n python3-ipykernel
Summary: %{summary}
%description -n python3-ipykernel
...
%prep
%autosetup -p1 -n ipykernel-%{version}
# Remove the dependency on debugpy.
# See https://github.com/ipython/ipykernel/pull/767
%pyproject_patch_dependency debugpy:ignore
%generate_buildrequires
%pyproject_buildrequires --runtime
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files --assert-license 'ipykernel*' +auto
%check
%pyproject_check_import --exclude '*.test*' --exclude 'ipykernel.gui*' --exclude 'ipykernel.pylab.*' --exclude 'ipykernel.trio*' --exclude 'ipykernel.datapub' --exclude 'ipykernel.pickleutil' --exclude 'ipykernel.serialize'
%files -n python3-ipykernel -f %{pyproject_files}
%doc README.md