%global python3_pkgversion 3.11 Name: python-importlib-metadata Version: 7.1.0 Release: 2.ac16.py3.11%{?dist} Summary: Library to access the metadata for a Python package License: ASL 2.0 URL: https://importlib-metadata.readthedocs.io/ Source0: %{pypi_source importlib_metadata} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros # Test dependencies # Not loaded via %%pyproject_buildrequires -x testing because upstream # uses a lot unnecessary packages and some of them are not in Fedora. BuildRequires: python%{python3_pkgversion}-test BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(pyfakefs) BuildRequires: python%{python3_pkgversion}dist(jaraco-test) %description Library to access the metadata for a Python package. This package supplies third-party access to the functionality of importlib.metadata including improvements added to subsequent Python versions. %package -n python%{python3_pkgversion}-importlib-metadata Summary: %{summary} %description -n python%{python3_pkgversion}-importlib-metadata Library to access the metadata for a Python package. This package supplies third-party access to the functionality of importlib.metadata including improvements added to subsequent Python versions. %prep %autosetup -n importlib_metadata-%{version} %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files importlib_metadata %check # Ignored file uses pytest_perf not available in Fedora # test_find_local tries to install setuptools from PyPI %pytest --ignore exercises.py -k "not test_find_local" 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}-importlib-metadata -f %{pyproject_files} %license LICENSE %doc README.rst %changelog * Mon May 20 2024 Ding-Yi Chen - 7.1.0-2.ac16.py3.11 - Cut corner packaging