Blame python-google-cloud-storage.spec

e93dd5a
%bcond_without  tests
4dfafb4
4dfafb4
%global         srcname     google-cloud-storage
4dfafb4
4dfafb4
Name:           python-%{srcname}
Packit 7ce69f2
Version:        2.13.0
3a0a765
Release:        %autorelease
4dfafb4
Summary:        Python Client for Google Cloud Storage
4dfafb4
1751c13
License:        Apache-2.0
403a802
URL:            https://github.com/googleapis/python-storage
403a802
Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz
4dfafb4
4dfafb4
BuildArch:      noarch
4dfafb4
4dfafb4
BuildRequires:  python3-devel
4dfafb4
4dfafb4
%if %{with tests}
4dfafb4
BuildRequires:  python3dist(pytest)
4dfafb4
BuildRequires:  python3dist(pytest-asyncio)
4dfafb4
%endif
4dfafb4
4dfafb4
%global _description %{expand:
4dfafb4
Google Cloud Storage allows you to store data on Google infrastructure with
4dfafb4
very high reliability, performance and availability, and can be used to
4dfafb4
distribute large data objects to users via direct download.}
4dfafb4
4dfafb4
%description %{_description}
4dfafb4
4dfafb4
4dfafb4
%package -n python3-%{srcname}
4dfafb4
Summary:        %{summary}
4dfafb4
%description -n python3-%{srcname} %{_description}
4dfafb4
4dfafb4
4dfafb4
%prep
403a802
%autosetup -n python-storage-%{version} -p1
4dfafb4
1e1463f
# Replace mock imports with unittest.mock.
1e1463f
grep -rl "^[[:space:]]*import mock" tests | \
1e1463f
    xargs sed -i -E 's/^([[:space:]]*)import mock/\1from unittest import mock/'
1e1463f
4dfafb4
4dfafb4
%generate_buildrequires
403a802
%pyproject_buildrequires
4dfafb4
4dfafb4
4dfafb4
%build
4dfafb4
%pyproject_wheel
4dfafb4
4dfafb4
4dfafb4
%install
4dfafb4
%pyproject_install
4dfafb4
%pyproject_save_files google
4dfafb4
4dfafb4
4dfafb4
%check
1e1463f
%pyproject_check_import
1e1463f
1e1463f
%if %{with tests}
e93dd5a
# NOTE(mhayden): Setting PYTHONUSERBASE as a hack for PEP 420 namespaces.
e93dd5a
# Thanks to churchyard for the fix.
e93dd5a
PYTHONUSERBASE=%{buildroot}%{_prefix} \
e93dd5a
    %pytest tests/unit \
e93dd5a
        -k "not test_create_bucket_w_custom_endpoint \
e93dd5a
            and not test_ctor_w_custom_endpoint_use_auth \
b81e860
            and not test_list_buckets_w_custom_endpoint \
b6594d1
            and not test_seek_fails \
b6594d1
            and not test_downloads_w_client_custom_headers"
4dfafb4
%endif
4dfafb4
4dfafb4
4dfafb4
%files -n python3-%{srcname} -f %{pyproject_files}
4dfafb4
%doc README.rst CHANGELOG.md
4dfafb4
%{python3_sitelib}/google_cloud_storage-%{version}-py%{python3_version}-nspkg.pth
4dfafb4
4dfafb4
4dfafb4
%changelog
3a0a765
%autochangelog