Blob Blame History Raw
%global pypi_name importlib_metadata
%global pkg_name  importlib-metadata

Name:           python-%{pkg_name}
Version:        0.23
Release:        5%{?dist}
Summary:        Read metadata from Python packages

License:        Apache-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
BuildRequires:  python%{python3_pkgversion}-zipp >= 0.5
%{?el7: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}
Requires:	python%{python3_pkgversion}-zipp
%{?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/

%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}-py?.?.egg-info/

%changelog
* Sat Jan 13 2024 Frank Crawford <frank@crawford.emu.id.au> - 0.23-5
- Add requirement for python3-zipp package for EL7 - BZ2257443

* Thu Jan 05 2023 Frank Crawford <frank@crawford.emu.id.au> - 0.23-4
- Reenable test as dependencies now available
- SPDX license update

* Mon Dec 26 2022 Than Ngo <than@redhat.com> - 0.23-3
- disable test due to missing dep

* Sat Sep 03 2022 Frank Crawford <frank@crawford.emu.id.au> - 0.23-2
- Initial package for EPEL7

* Wed Sep 18 2019 Miro Hrončok <mhroncok@redhat.com> - 0.23-1
- Update to 0.23

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Wed Jun 26 2019 Miro Hrončok <mhroncok@redhat.com> - 0.18-1
- Initial package