f61ea26
Name:           python-absl-py
5b6bd2c
Version:        0.15.0
6aeeb10
Release:        %autorelease
2c52330
Summary:        Abseil Python Common Libraries
2c52330
2c52330
# Overall license is ASL 2.0. Contents of absl/third_party/unittest3_backport/
2c52330
# are under the Python license (derived from the Python 3 standard library).
2c52330
License:        ASL 2.0 and Python
f61ea26
URL:            https://github.com/abseil/abseil-py/
f61ea26
Source0:        %{url}/archive/pypi-v%{version}/abseil-py-pypi-v%{version}.tar.gz
2c52330
96009eb
BuildRequires:  python3-devel
2c52330
2c52330
BuildArch:      noarch
2c52330
2c52330
%global common_description %{expand:
2c52330
This repository is a collection of Python library code for building Python
2c52330
applications. The code is collected from Google’s own Python code base, and has
2c52330
been extensively tested and used in production.
2c52330
2c52330
Features:
2c52330
2c52330
  • Simple application startup
2c52330
  • Distributed commandline flags system
2c52330
  • Custom logging module with additional features
2c52330
  • Testing utilities}
2c52330
2c52330
%description %{common_description}
2c52330
2c52330
f61ea26
%package -n     python3-absl-py
2c52330
Summary:        %{summary}
2c52330
5b6bd2c
%py_provides python3-absl
5b6bd2c
f61ea26
%description -n python3-absl-py %{common_description}
2c52330
2c52330
2c52330
%prep
f61ea26
%autosetup -n abseil-py-pypi-v%{version} -p1
2c52330
cp -p absl/third_party/unittest3_backport/LICENSE LICENSE-PYTHON
2c52330
2c52330
# Despite the third_party/ prefix, absl/third_party/unittest3_backport/ is not
2c52330
# exactly a bundled library. On Python 3, it is merely a shim around the
2c52330
# unittest module from the Python standard library. On Python 2, it is a
2c52330
# backport of much of the added functionality from the Python 3 version of the
2c52330
# unittest module; while derived from some version of the Python 3 standard
2c52330
# library, this backport is specific to absl-py, is maintained in the same
2c52330
# source code repository, and appears not to be separately distributed or used
2c52330
# by any other software.
2c52330
2c52330
acd8547
%generate_buildrequires
acd8547
%pyproject_buildrequires -r
acd8547
acd8547
2c52330
%build
8d50056
%pyproject_wheel
2c52330
2c52330
2c52330
%install
8d50056
%pyproject_install
f61ea26
%pyproject_save_files absl
2c52330
2c52330
2c52330
%check
2c52330
# We cannot use smoke_tests/smoke_test.sh because it downloads things from the
2c52330
# Internet. We can, however, run the sample Python scripts manually, which is
2c52330
# better than nothing.
2c52330
PYTHONPATH=%{buildroot}/%{python3_sitelib}; export PYTHONPATH
2c52330
%{__python3} smoke_tests/sample_app.py --echo smoke 
2c52330
%{__python3} smoke_tests/sample_test.py
2c52330
2c52330
# Running the actual test suite requires bazel, which will almost certainly
2c52330
# never be packaged for Fedora due to its Byzantine mass of bundled
2c52330
# dependencies. It is possible to invoke the tests with another runner, such as
2c52330
# pytest, but there are many spurious failures due to the incorrect
2c52330
# environment, so it is useless to do so.
2c52330
2c52330
f61ea26
%files -n python3-absl-py -f %{pyproject_files}
2c52330
%doc AUTHORS
928146d
%doc absl/CHANGELOG.md
2c52330
%doc CONTRIBUTING.md
2c52330
%doc README.md
2c52330
%doc smoke_tests
2c52330
2c52330
2c52330
%changelog
6aeeb10
%autochangelog