pyproject-rpm-macros/tests/python-ipykernel.spec
Charalampos Stratakis b7f03fc84c Add %pyproject_patch_dependency macro for overriding dependency constraints
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)
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 -r
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l 'ipykernel*' +auto
%check
%pyproject_check_import -e '*.test*' -e 'ipykernel.gui*' -e 'ipykernel.pylab.*' -e 'ipykernel.trio*' -e 'ipykernel.datapub' -e 'ipykernel.pickleutil' -e 'ipykernel.serialize'
%files -n python3-ipykernel -f %{pyproject_files}
%doc README.md