%global python3_pkgversion 3.11 # Unset -s on python shebang - ensure that extensions installed with pip # to user locations are seen and properly loaded %undefine _py3_shebang_s Name: python-jupyter-client Version: 8.6.1 Release: 2.ac16.py3.11%{?dist} Summary: Jupyter protocol implementation and client libraries License: BSD URL: https://jupyter.org Source0: %{pypi_source jupyter_client} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel #bcond_without doc #bcond_without tests %if %{with tests} # The zmq tests are split in RPM only, the dependency is not tracked on Python level: BuildRequires: python%{python3_pkgversion}-zmq-tests # Optional test dependency, look for test_datetimes_msgpack BuildRequires: python%{python3_pkgversion}dist(msgpack) # For test_load_ips BuildRequires: /usr/sbin/ip BuildRequires: /usr/sbin/ifconfig %endif %description This package contains the reference implementation of the Jupyter protocol. It also provides client and kernel management APIs for working with kernels. It also provides the `jupyter kernelspec` entrypoint for installing kernelspecs for use with Jupyter frontends. %package -n python%{python3_pkgversion}-jupyter-client Summary: %{summary} # It fallbacks to ifconfig without this, and ifconfig is deprecated Recommends: python3-netifaces %description -n python%{python3_pkgversion}-jupyter-client This package contains the reference implementation of the Jupyter protocol. It also provides client and kernel management APIs for working with kernels. It also provides the `jupyter kernelspec` entrypoint for installing kernelspecs for use with Jupyter frontends. %if %{with doc} %package -n python-jupyter-client-doc Summary: Documentation of the Jupyter protocol reference implementation %description -n python-jupyter-client-doc Documentation of the reference implementation of the Jupyter protocol %endif %prep %autosetup -p1 -n jupyter_client-%{version} # Drop dependencies on coverage, linters etc. sed -Ei '/"\b(codecov|coverage|mypy|pre-commit|pytest-cov)\b",/d' pyproject.toml %if %{with doc} # Use local objects.inv for intersphinx: sed -i "s|\(('http://ipython.readthedocs.io/en/stable/', \)None)|\1'/usr/share/doc/python3-ipython-doc/html/objects.inv')|" docs/conf.py %endif %generate_buildrequires %pyproject_buildrequires -w %{?with_tests:-x test} %{?with_doc:-x docs} %build %pyproject_wheel %if %{with doc} PYTHONPATH=build/lib/ sphinx-build-%{python3_pkgversion} docs html # remove the sphinx-build-%{python3_pkgversion} leftovers rm -r html/.{doctrees,buildinfo} %endif %install %pyproject_install %pyproject_save_files jupyter_client %if %{with tests} %check # The two tests testing signals for kernels are flaky because # if it takes the kernel more than one second to respond, it's killed. # The tests work fine outside mock. # test_open_tunnel needs ssh and internet connections. %pytest -Wdefault -v -k "not test_signal_kernel_subprocesses and not test_async_signal_kernel_subprocesses and not test_open_tunnel" %endif %global _docdir_fmt %{name} 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}-jupyter-client -f %{pyproject_files} %doc README.md %{_bindir}/jupyter-kernel-%{python3_pkgversion} %{_bindir}/jupyter-kernelspec-%{python3_pkgversion} %{_bindir}/jupyter-run-%{python3_pkgversion} %if %{with doc} %files -n python-jupyter-client-doc %doc html %endif %changelog * Thu May 16 2024 Ding-Yi Chen - 8.6.1-2.ac16.py3.11 - Cut corner packaging