pyproject-rpm-macros/tests/python-ipykernel.spec
Karolina Surma d427052f40 Introduce %%pyproject_check_import
%%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
2022-01-26 11:31:17 +01:00

51 lines
1.3 KiB
RPMSpec

Name: python-ipykernel
Version: 5.2.1
Release: 0%{?dist}
Summary: IPython Kernel for Jupyter
License: BSD
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}
%generate_buildrequires
%pyproject_buildrequires -r
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files 'ipykernel*' +auto
%check
%pyproject_check_import -e '*.test*' -e 'ipykernel.gui*' -e 'ipykernel.pylab.backend_inline'
%files -n python3-ipykernel -f %{pyproject_files}
%license COPYING.md
%doc README.md