Blob Blame History Raw
%bcond tests 1

Version:        2.7.1
Name:           python-google-resumable-media
Release:        %autorelease
Summary:        Utilities for Google media downloads and resumable uploads

License:        Apache-2.0
Source:         %{url}/archive/v%{version}/google-resumable-media-python-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist brotli}

%global _description %{expand:

%description %{_description}

%package -n python3-google-resumable-media
Summary:        %{summary}

%description -n python3-google-resumable-media %{_description}

# We don’t build a metapackage for the aiohttp extra because it currently
# requires google-auth 1.x, and Fedora has version 2.x.
# Please consider supporting google-auth 2.x
%pyproject_extras_subpkg -n python3-google-resumable-media requests

%autosetup -n google-resumable-media-python-%{version}

%pyproject_buildrequires -x requests


%pyproject_save_files -l google

%if %{with tests}
# Work around an usual pytest/PEP 420 issue where pytest can't import the
# installed module. Thanks to mhroncok for the help!
mv google{,_}
%pytest tests/unit
mv google{_,}

%files -n python3-google-resumable-media -f %{pyproject_files}
%doc README.rst