%global python3_pkgversion 3.11 %global modname ipykernel # When we bootstrap new Python, we need to avoid a build dependnecy loop #bcond_without tests #bcond_without doc Name: python-%{modname} Version: 6.29.3 Release: 2.ac16.py3.11%{?dist} Summary: IPython Kernel for Jupyter License: BSD-3-Clause URL: https://github.com/ipython/%{modname} Source0: https://github.com/ipython/%{modname}/releases/download/v%{version}/%{modname}-%{version}.tar.gz # Compatibility with pytest 8 Patch: https://github.com/ipython/ipykernel/commit/a7d66a.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %global _description \ This package provides the IPython kernel for Jupyter. %description %{_description} %package -n python%{python3_pkgversion}-%{modname} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}} Requires: python-jupyter-filesystem %if %{with doc} BuildRequires: make BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx-autodoc-typehints BuildRequires: python%{python3_pkgversion}-sphinxcontrib-github-alt BuildRequires: python%{python3_pkgversion}-myst-parser BuildRequires: python%{python3_pkgversion}-pydata-sphinx-theme # for intersphinx: BuildRequires: python3-docs BuildRequires: python%{python3_pkgversion}-ipython-doc BuildRequires: python-jupyter-client-doc %endif Recommends: python%{python3_pkgversion}-matplotlib Recommends: python%{python3_pkgversion}-numpy Recommends: python%{python3_pkgversion}-pandas Recommends: python%{python3_pkgversion}-scipy Recommends: python%{python3_pkgversion}-pillow %description -n python%{python3_pkgversion}-%{modname} %{_description} %if %{with doc} %package doc Summary: Documentation for %{name} Requires: python3-docs Requires: python%{python3_pkgversion}-ipython-doc Requires: python-jupyter-client-doc %description doc This package contains the documentation of %{name}. %endif %prep %autosetup -p1 -n %{modname}-%{version} # Remove the dependency on debugpy. # See https://github.com/ipython/ipykernel/pull/767 sed -i '/"debugpy/d' pyproject.toml %if %{with doc} # Use local objects.inv for intersphinx: sed -e "s|\(('https://docs.python.org/3/', \)None)|\1'/usr/share/doc/python3-docs/html/objects.inv')|" \ -e "s|\(('https://ipython.readthedocs.io/en/latest', \)None)|\1'/usr/share/doc/python3-ipython-doc/html/objects.inv')|" \ -e "s|\(('https://jupyter.readthedocs.io/en/latest', \)None)|\1'/usr/share/doc/python-jupyter-client/html/objects.inv')|" \ -i docs/conf.py %endif %generate_buildrequires %pyproject_buildrequires %{?with_tests:-x test} %build %pyproject_wheel %if %{with doc} %make_build -C docs html %endif %install %pyproject_install %pyproject_save_files %{modname} %{modname}_launcher %if %{with doc} mkdir -p %{buildroot}%{_docdir}/%{name} cp -fpavr docs/_build/html %{buildroot}%{_docdir}/%{name} rm %{buildroot}%{_docdir}/%{name}/html/.buildinfo %endif # Install the kernel so it can be found # See https://bugzilla.redhat.com/show_bug.cgi?id=1327979#c19 %{python3} -m ipykernel install --prefix %{buildroot}%{_prefix} ls %{buildroot}%{_datadir}/jupyter/kernels/python3/ cat %{buildroot}%{_datadir}/jupyter/kernels/python3/kernel.json %check %if %{with tests} %pytest -Wdefault %else # datapub, pickleutil, serialize need ipyparallel # pylab needs matplotlib # trio needs trio # debugger needs debugpy # gui needs gobject %{pyproject_check_import \ -e %{modname}.datapub -e %{modname}.pickleutil -e %{modname}.serialize \ -e '%{modname}.pylab*' \ -e '%{modname}.trio*' \ -e %{modname}.debugger \ -e '%{modname}.gui*' \ -e '*.test*'} %endif for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{modname} %license LICENSE %doc CONTRIBUTING.md README.md %{python3_sitelib}/%{modname} %pycached %{python3_sitelib}/%{modname}_launcher.py %{python3_sitelib}/%{modname}*.dist-info/ %{_datadir}/jupyter/kernels/python3 %if %{with doc} %files doc %doc %{_docdir}/%{name}/html %endif %changelog * Fri May 17 2024 Ding-Yi Chen - 6.29.3-2.ac16.py3.11 - Cut corner packaging