Blame python-google-resumable-media.spec

295b47f
# tests are enabled by default
295b47f
%bcond_without tests
295b47f
295b47f
%global         srcname     google-resumable-media
295b47f
%global         forgeurl    https://github.com/googleapis/google-resumable-media-python
b51f270
Version:        2.3.3
295b47f
%global         tag         v%{version}
295b47f
%forgemeta
295b47f
295b47f
Name:           python-%{srcname}
42c2d7c
Release:        %autorelease
295b47f
Summary:        Utilities for Google media downloads and resumable uploads
295b47f
295b47f
License:        ASL 2.0
295b47f
URL:            %forgeurl
295b47f
Source0:        %forgesource
b51f270
# Opened upstream PR to fix mock import:
b51f270
# https://github.com/googleapis/google-resumable-media-python/pull/329
b51f270
Patch0:         https://github.com/googleapis/google-resumable-media-python/pull/329.patch
295b47f
295b47f
BuildArch:      noarch
295b47f
ca18c85
BuildRequires:  python3-devel
295b47f
295b47f
%if %{with tests}
f6e05fa
BuildRequires:  python3dist(aiohttp)
295b47f
BuildRequires:  python3dist(google-auth)
295b47f
BuildRequires:  python3dist(pytest)
f6e05fa
BuildRequires:  python3dist(requests)
f6e05fa
BuildRequires:  python3dist(urllib3)
295b47f
%endif
295b47f
295b47f
%global _description %{expand:
295b47f
Utilities for Google media downloads and resumable uploads}
295b47f
295b47f
%description %{_description}
295b47f
295b47f
295b47f
%package -n python3-%{srcname}
295b47f
Summary:        %{summary}
295b47f
f6e05fa
%description -n python3-%{srcname} %{_description}
295b47f
295b47f
295b47f
%prep
f6e05fa
%forgeautosetup -p1
295b47f
295b47f
295b47f
%generate_buildrequires
295b47f
%pyproject_buildrequires -r
295b47f
295b47f
295b47f
%build
295b47f
%pyproject_wheel
295b47f
295b47f
295b47f
%install
295b47f
%pyproject_install
295b47f
%pyproject_save_files google
295b47f
295b47f
295b47f
%if %{with tests}
295b47f
%check
f6e05fa
# Work around an usual pytest/PEP 420 issue where pytest can't import the
f6e05fa
# installed module. Thanks to mhroncok for the help!
f6e05fa
mv google{,_}
f6e05fa
%pytest --disable-warnings tests/unit
f6e05fa
mv google{_,}
295b47f
%endif
295b47f
295b47f
295b47f
%files -n python3-%{srcname} -f %{pyproject_files}
295b47f
%license LICENSE
295b47f
%doc README.rst CHANGELOG.md
295b47f
%{python3_sitelib}/google_resumable_media-%{version}-py%{python3_version}-nspkg.pth
295b47f
295b47f
295b47f
%changelog
42c2d7c
%autochangelog