%{?python_enable_dependency_generator} %global pypi_name importlib_metadata %global pkg_name importlib-metadata %global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 Name: python-%{pkg_name} Version: 1.7.0 Release: 1%{?dist} Summary: Read metadata from Python packages License: ASL 2.0 URL: http://importlib-metadata.readthedocs.io/ Source0: %{pypi_source} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools-scm BuildRequires: python%{python3_pkgversion}-packaging # Not available for El8 #BuildRequires: python%%{python3_pkgversion}-pyfakefs BuildRequires: python%{python3_pkgversion}-zipp >= 0.5 %{?el8:BuildRequires: python%{python3_pkgversion}-importlib-resources} %description importlib_metadata is a library which provides an API for accessing an installed package’s metadata, such as its entry points or its top-level name. This functionality intends to replace most uses of pkg_resources entry point API and metadata API. Along with importlib.resources in Python 3.7 and newer (backported as importlib_resources for older versions of Python), this can eliminate the need to use the older and less efficient pkg_resources package. %package -n python%{python3_pkgversion}-%{pkg_name} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pkg_name}} %description -n python%{python3_pkgversion}-%{pkg_name} importlib_metadata is a library which provides an API for accessing an installed package’s metadata, such as its entry points or its top-level name. This functionality intends to replace most uses of pkg_resources entry point API and metadata API. Along with importlib.resources in Python 3.7 and newer (backported as importlib_resources for older versions of Python), this can eliminate the need to use the older and less efficient pkg_resources package. %prep %autosetup -n %{pypi_name}-%{version} %build %py3_build %install %py3_install # Don't ship docs sources rm -r %{buildroot}/%{python3_sitelib}/%{pypi_name}/docs/ # Missing deps for tests: pyfakefs #%%check #%%{__python3} setup.py test %files -n python%{python3_pkgversion}-%{pkg_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{pypi_name}/ %{python3_sitelib}/%{pypi_name}-%{version}-py3.11.egg-info/ %changelog