%global python3_pkgversion 3.11 %global pypi_name jupyter_packaging Name: python-jupyter-packaging Version: 0.12.3 Release: 2.ac16.py3.11%{?dist} Summary: Tools to help build and install Jupyter Python packages License: BSD-3-Clause URL: https://github.com/jupyter/jupyter-packaging Source0: %{pypi_source} BuildArch: noarch %global _description %{expand: This package contains utilities for making Python packages with and without accompanying JavaScript packages.} %description %_description %package -n python%{python3_pkgversion}-jupyter-packaging Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros %description -n python%{python3_pkgversion}-jupyter-packaging %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} # Drop dependencies on coverage, linters etc. sed -Ei 's/"(coverage|pre-commit|pytest-cov)",//g' pyproject.toml %generate_buildrequires %pyproject_buildrequires -w -x test %install %pyproject_install %pyproject_save_files %{pypi_name} %check # Some tests are trying to install packages to /usr # - https://github.com/jupyter/jupyter-packaging/issues/63 %pytest -k "\ not test_build_package and \ not test_create_cmdclass and \ not test_deprecated_metadata and \ not test_develop and \ not test_install and \ not test_install_hybrid and \ not test_run \ " \ -W "ignore:pkg_resources is deprecated as an API:DeprecationWarning" # ^^^ # Workaround pkg_resources deprecation warning leaking from # setuptools: # https://github.com/pypa/setuptools/issues/3878 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-packaging -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Mon May 20 2024 Ding-Yi Chen - 0.12.3-2.ac16.py3.11 - Cut corner packaging