%global python3_pkgversion 3.11 # Unset -s on python shebang - ensure that extensions installed with pip # to user locations are seen and properly loaded %global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//) Name: python-jupyter-core Version: 5.7.2 Release: 2.ac16.py3.11%{?dist} Summary: The base package for Jupyter projects License: BSD URL: http://jupyter.org Source0: %{pypi_source jupyter_core} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python3-docs 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 BuildRequires: pyproject-rpm-macros #bcond_without tests %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest %endif %description Core common functionality of Jupyter projects. This package contains base application classes and configuration inherited by other projects. %package -n python%{python3_pkgversion}-jupyter-core Summary: The base package for Jupyter projects %description -n python%{python3_pkgversion}-jupyter-core Core common functionality of Jupyter projects. This package contains base application classes and configuration inherited by other projects. %package -n python-jupyter-core-doc Summary: Documentation of the base package for Jupyter projects %description -n python-jupyter-core-doc Core common functionality of Jupyter projects. This package contains documentation for the base application classes and configuration inherited by other jupyter projects. %package -n python-jupyter-filesystem Summary: Jupyter filesystem layout %description -n python-jupyter-filesystem This package provides directories required by other packages that add extensions to Jupyter. %prep %autosetup -p1 -n jupyter_core-%{version} # Use local objects.inv for intersphinx: sed -i "s|{'https://docs.python.org/3/': None}|{'https://docs.python.org/3/': '/usr/share/doc/python3-docs/html/objects.inv'}|" docs/conf.py %py3_shebang_fix jupyter_core/troubleshoot.py %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel # generate html docs PYTHONPATH=. sphinx-build-%{python3_pkgversion} docs html # remove the sphinx-build-%{python3_pkgversion} leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install %pyproject_save_files jupyter jupyter_core # Create directories for python-jupyter-filesystem package mkdir -p %{buildroot}%{_datadir}/jupyter mkdir %{buildroot}%{_datadir}/jupyter/kernels mkdir -p %{buildroot}%{_datadir}/jupyter/labextensions/@jupyter mkdir %{buildroot}%{_datadir}/jupyter/nbextensions mkdir -p %{buildroot}%{_sysconfdir}/jupyter mkdir %{buildroot}%{_sysconfdir}/jupyter/jupyter_notebook_config.d mkdir %{buildroot}%{_sysconfdir}/jupyter/jupyter_server_config.d mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig/common.d mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig/edit.d mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig/notebook.d mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig/terminal.d mkdir %{buildroot}%{_sysconfdir}/jupyter/nbconfig/tree.d %if %{with tests} %check # deselected tests unset PATH env variables and can only run when installed # test_jupyter_path_(no)_user_site are deselected because we change # user install location path in Fedora, for reference see: # https://src.fedoraproject.org/rpms/python3.10/blob/rawhide/f/00251-change-user-install-location.patch %pytest -Wdefault -v \ --deselect "tests/test_command.py::test_not_on_path" \ --deselect "tests/test_command.py::test_path_priority" \ --deselect "tests/test_command.py::test_argv0" \ --deselect "tests/test_paths.py::test_jupyter_path_prefer_env" \ --deselect "tests/test_paths.py::test_jupyter_path_user_site" \ --deselect "tests/test_paths.py::test_jupyter_path_no_user_site" \ ; %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-core -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/jupyter-%{python3_pkgversion} %{_bindir}/jupyter-migrate-%{python3_pkgversion} %{_bindir}/jupyter-troubleshoot-%{python3_pkgversion} %files -n python-jupyter-core-doc %doc html %files -n python-jupyter-filesystem %{_datadir}/jupyter %{_sysconfdir}/jupyter %changelog * Thu May 09 2024 Ding-Yi Chen - 5.7.2-2.ac16.py3.11 - Cut corner packaging