%global python3_pkgversion 3.11 %global pypi_name ipywidgets Name: python-%{pypi_name} Version: 8.1.2 Release: 2.ac16.py3.11%{?dist} Summary: IPython HTML widgets for Jupyter License: BSD-3-Clause URL: http://ipython.org Source0: %{pypi_source} # Compatibility with pytest 8 Patch: https://github.com/jupyter-widgets/ipywidgets/pull/3903.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %description Interactive HTML widgets for Jupyter notebooks and the IPython kernel. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} %description -n python%{python3_pkgversion}-%{pypi_name} Interactive HTML widgets for Jupyter notebooks and the IPython kernel. %prep %autosetup -p3 -n %{pypi_name}-%{version} # Jupyterlab_widgets is a new dependency in ipywidgets 7.6 # and it contains code which enables widgets in Jupyter lab # not requiring any manual steps. But we don't have Jupyter lab # in Fedora yet so we do not need this package at all. sed -i "/jupyterlab_widgets/d" setup.cfg sed -i -re "/widgetsnbextension/d" setup.cfg %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check 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}-%{pypi_name} -f %{pyproject_files} %doc README.md %changelog * Mon May 20 2024 Ding-Yi Chen - 8.1.2-2.ac16.py3.11 - Cut corner packaging