%global pypi_name rich %global python3_pkgversion 3.11 Name: python-%{pypi_name} Version: 13.7.1 Release: 2.ac12.py3.11%{?dist} Summary: Render rich text and beautiful formatting in the terminal # https://spdx.org/licenses/MIT.html License: MIT URL: https://github.com/Textualize/rich Source0: %{url}/archive/v%{version}/rich-%{version}.tar.gz # Fix tests with Python 3.13 - submitted upstream Patch: https://github.com/Textualize/rich/pull/3229.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros # for checks BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(setuptools) BuildRequires: python%{python3_pkgversion}dist(attrs) %description Rich is a Python library for rich text and beautiful formatting in the terminal. The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} # This was previously misnamed, remove the obsolete in Fedora 38, EPEL 10 Obsoletes: python-%{pypi_name} < 10.16.1-2 %description -n python%{python3_pkgversion}-%{pypi_name} Rich is a Python library for rich text and beautiful formatting in the terminal. The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box. %prep %autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files rich %check # add below to make sure initial build will catch runtime import errors %pyproject_check_import %pytest -vv 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} %license LICENSE %doc README.md %changelog * Tue Apr 16 2024 Ding-Yi Chen - 13.7.1-2.ac12.py3.11 - Cut corner packaging