%global srcname traitlets %global python3_pkgversion 3.11 Name: python-%{srcname} Version: 5.14.1 Release: %autorelease Summary: A lightweight derivative of Enthought Traits for configuring Python objects License: BSD-3-Clause URL: https://github.com/ipython/traitlets Source0: https://github.com/ipython/traitlets/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch %description A lightweight pure-Python derivative of Enthought Traits, used for configuring Python objects. This package powers the config system of IPython and Jupyter. %package -n python%{python3_pkgversion}-%{srcname} Summary: A lightweight derivative of Enthought Traits for configuring Python objects BuildRequires: python%{python3_pkgversion}-devel # For tests BuildRequires: python%{python3_pkgversion}-pytest %description -n python%{python3_pkgversion}-%{srcname} A lightweight pure-Python derivative of Enthought Traits, used for configuring Python objects. This package powers the config system of IPython and Jupyter. %prep %autosetup -p1 -n %{srcname}-%{version} # Remove tests of type annotations rm tests/test_typing.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files traitlets %check for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1%{python3_pkgversion}.mo/"<<<"$m"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s/(.*).([1-8]([^.]+)?)$/\1%{python3_pkgversion}.\2/"<<<"$m"); done for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s/(.*)$/\1%{python3_pkgversion}/"<<<"$b"); done %pytest -v %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc CHANGELOG.md README.md %license LICENSE %changelog * Tue Mar 26 2024 Ding-Yi Chen - 5.14.1-2.ac5 - Cut corner packaging