%global modname absl %global srcname %{modname}-py %global reponame abseil-py %global egginfo_name %(echo %{srcname} | tr - _) %undefine __pythondist_provides Name: python-%{srcname} Version: 1.0.0 Release: 1%{?dist} Summary: Abseil Python Common Libraries # Overall license is ASL 2.0. Contents of absl/third_party/unittest3_backport/ # are under the Python license (derived from the Python 3 standard library). License: ASL 2.0 and Python URL: https://github.com/abseil/%{reponame}/ Source0: %{url}/archive/pypi-v%{version}/%{reponame}-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel >= 3.4 BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-six %global common_description %{expand: This repository is a collection of Python library code for building Python applications. The code is collected from Google’s own Python code base, and has been extensively tested and used in production. Features: • Simple application startup • Distributed commandline flags system • Custom logging module with additional features • Testing utilities} %description %{common_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} Provides: python%{python3_version}dist(%{srcname}) = %{version} Provides: python%{python3_pkgversion}dist(%{srcname}) = %{version} Requires: python%{python3_pkgversion}-six %description -n python%{python3_pkgversion}-%{srcname} %{common_description} %prep %autosetup -n %{reponame}-%{version} # Despite the third_party/ prefix, absl/third_party/unittest3_backport/ is not # exactly a bundled library. On Python 3, it is merely a shim around the # unittest module from the Python standard library. On Python 2, it is a # backport of much of the added functionality from the Python 3 version of the # unittest module; while derived from some version of the Python 3 standard # library, this backport is specific to absl-py, is maintained in the same # source code repository, and appears not to be separately distributed or used # by any other software. %build %py3_build %install %py3_install %check # We cannot use smoke_tests/smoke_test.sh because it downloads things from the # Internet. We can, however, run the sample Python scripts manually, which is # better than nothing. PYTHONPATH=%{buildroot}/%{python3_sitelib}; export PYTHONPATH %{__python3} smoke_tests/sample_app.py --echo smoke %{__python3} smoke_tests/sample_test.py # Running the actual test suite requires bazel, which will almost certainly # never be packaged for EPEL due to its Byzantine mass of bundled # dependencies. It is possible to invoke the tests with another runner, such as # pytest, but there are many spurious failures due to the incorrect # environment, so it is useless to do so. %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc AUTHORS %doc CONTRIBUTING.md %doc README.md %doc smoke_tests %{python3_sitelib}/%{modname} %{python3_sitelib}/%{egginfo_name}-%{version}-py%{python3_version}.egg-info %changelog * Tue Jun 15 2021 Benjamin A. Beasley - 0.13.0-1 - Update to 0.13.0; closes RHBZ#1972146 * Wed Mar 10 2021 Benjamin A. Beasley - 0.12.0-2 - Add CHANGELOG.md, from absl/, to documentation * Wed Mar 10 2021 Benjamin A. Beasley - 0.12.0-1 - Update to 0.12.0 - Drop python-absl-py-0.11.0-python-3.10.patch, now upstreamed * Wed Mar 10 2021 Benjamin A. Beasley - 0.11.0-3 - Move BR’s back to top-level package - Fix bogus changelog versions * Thu Nov 26 2020 Benjamin A. Beasley - 0.11.0-2 - Remove EPEL conditionals from Fedora spec file * Wed Nov 25 2020 Benjamin A. Beasley - 0.11.0-1 - Initial package