Blob Blame History Raw
Name:           python-absl-py
Version:        0.14.0
Release:        %autorelease
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/abseil-py/
Source0:        %{url}/archive/pypi-v%{version}/abseil-py-pypi-v%{version}.tar.gz

BuildRequires:  python3-devel

BuildArch:      noarch

%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     python3-absl-py
Summary:        %{summary}

%description -n python3-absl-py %{common_description}


%prep
%autosetup -n abseil-py-pypi-v%{version} -p1
cp -p absl/third_party/unittest3_backport/LICENSE LICENSE-PYTHON

# 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.


%generate_buildrequires
%pyproject_buildrequires -r


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files absl


%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 Fedora 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 python3-absl-py -f %{pyproject_files}
%doc AUTHORS
%doc absl/CHANGELOG.md
%doc CONTRIBUTING.md
%doc README.md
%doc smoke_tests


%changelog
%autochangelog