* add get_object method for async grpc client (#1735) * expose `DELETE_OBJECT` in `AsyncGrpcClient` (#1718) * update generation for MRD (#1730) * Move Zonal Buckets features of `_experimental` (#1728) * add default user agent for grpc (#1726) * expose finalized_time in blob.py applicable for GET_OBJECT in ZB (#1719) * add context manager to mrd (#1724) * integrate writes strategy and appendable object writer (#1695) * Add support for opening via `write_handle` and fix `write_handle` type (#1715) * Add micro-benchmarks for writes comparing standard (regional) vs rapid (zonal) buckets. (#1707) * Add micro-benchmarks for reads comparing standard (regional) vs rapid (zonal) buckets. (#1697) * send `user_agent` to grpc channel (#1712) * add samples for appendable objects writes and reads (#1705) * add samples for appendable objects writes and reads * add support for `generation=0` to avoid overwriting existing objects and add `is_stream_open` support (#1709) * add support for `generation=0` to prevent overwriting existing objects * add `is_stream_open` property to AsyncAppendableObjectWriter for stream status check * receive eof while closing reads stream (#1733) * Change contructors of MRD and AAOW AsyncGrpcClient.grpc_client to AsyncGrpcClient (#1727) * instance grpc client once per process in benchmarks (#1725) * update write handle on every recv() (#1716) * Fix formatting in setup.py dependencies list (#1713) * implement requests_done method to signal end of requests in async streams. Gracefully close streams. (#1700) * implement requests_done method to signal end of requests in async streams. Gracefully close streams. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:google/python-google-cloud-storage?expand=0&rev=23
143 lines
4.9 KiB
RPMSpec
143 lines
4.9 KiB
RPMSpec
#
|
||
# spec file for package python-google-cloud-storage
|
||
#
|
||
# Copyright (c) 2026 SUSE LLC and contributors
|
||
#
|
||
# All modifications and additions to the file contributed by third parties
|
||
# remain the property of their copyright owners, unless otherwise agreed
|
||
# upon. The license for this file, and modifications and additions to the
|
||
# file, is the same license as for the pristine package itself (unless the
|
||
# license for the pristine package is not an Open Source License, in which
|
||
# case the license is the MIT License). An "Open Source License" is a
|
||
# license that conforms to the Open Source Definition (Version 1.9)
|
||
# published by the Open Source Initiative.
|
||
|
||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||
#
|
||
|
||
|
||
%define skip_python2 1
|
||
%global flavor @BUILD_FLAVOR@%{nil}
|
||
%if "%{flavor}" == "test"
|
||
%define test 1
|
||
%define pkg_suffix -test
|
||
%bcond_without test
|
||
%else
|
||
%define pkg_suffix %{nil}
|
||
%bcond_with test
|
||
%endif
|
||
%{?sle15_python_module_pythons}
|
||
Name: python-google-cloud-storage%{pkg_suffix}
|
||
Version: 3.9.0
|
||
Release: 0
|
||
Summary: Google Cloud Storage API python client library
|
||
License: Apache-2.0
|
||
URL: https://github.com/googleapis/python-storage
|
||
Source: https://files.pythonhosted.org/packages/source/g/google-cloud-storage/google_cloud_storage-%{version}.tar.gz
|
||
# PATCH-FIX-UPSTREAM demock.patch gh#googleapis/python-storage#770 mcepl@suse.com
|
||
# Don’t use external mock package
|
||
Patch1: demock.patch
|
||
BuildRequires: %{python_module grpcio >= 1.33.2 if %python-base < 3.14}
|
||
BuildRequires: %{python_module grpcio >= 1.75.1 if %python-base >= 3.14}
|
||
BuildRequires: %{python_module pip}
|
||
BuildRequires: %{python_module proto-plus >= 1.22.3 if %python-base < 3.13}
|
||
BuildRequires: %{python_module proto-plus >= 1.25.0 if %python-base >= 3.13}
|
||
BuildRequires: %{python_module setuptools}
|
||
BuildRequires: %{python_module wheel}
|
||
BuildRequires: fdupes
|
||
BuildRequires: python-rpm-macros
|
||
%if %python_version_nodots < 314
|
||
Requires: python-grpcio >= 1.33.2
|
||
%else
|
||
Requires: python-grpcio >= 1.75.1
|
||
%endif
|
||
%if %python_version_nodots < 313
|
||
Requires: python-proto-plus >= 1.22.3
|
||
%else
|
||
Requires: python-proto-plus >= 1.25.0
|
||
%endif
|
||
Requires: python-google-api-core >= 2.27.0
|
||
Requires: python-google-auth >= 2.26.1
|
||
Requires: python-google-cloud-core >= 2.4.2
|
||
Requires: python-google-crc32c >= 1.1.3
|
||
Requires: python-google-resumable-media >= 2.7.2
|
||
Requires: python-googleapis-common-protos
|
||
Requires: python-requests >= 2.22.0
|
||
BuildArch: noarch
|
||
%if 0%{?sle_version} >= 150400
|
||
Obsoletes: python3-google-cloud-storage < %{version}
|
||
%endif
|
||
# SECTION test requirements
|
||
%if %{with test}
|
||
BuildRequires: %{python_module google-api-core >= 2.27.0}
|
||
BuildRequires: %{python_module google-auth >= 2.26.1}
|
||
BuildRequires: %{python_module google-cloud-core >= 2.4.2}
|
||
BuildRequires: %{python_module google-cloud-iam >= 0.14.0}
|
||
BuildRequires: %{python_module google-cloud-storage}
|
||
BuildRequires: %{python_module google-crc32c >= 1.1.3}
|
||
BuildRequires: %{python_module google-resumable-media >= 2.7.2}
|
||
BuildRequires: %{python_module packaging}
|
||
BuildRequires: %{python_module pip}
|
||
BuildRequires: %{python_module pytest-asyncio}
|
||
BuildRequires: %{python_module pytest}
|
||
BuildRequires: %{python_module requests >= 2.22.0}
|
||
%endif
|
||
# /SECTION
|
||
%python_subpackages
|
||
|
||
%description
|
||
Google Cloud Storage allows you to store data on Google
|
||
infrastructure with very high reliability, performance and
|
||
availability, and can be used to distribute large data objects
|
||
to users via direct download. This package provides client to it.
|
||
|
||
%prep
|
||
%autosetup -p1 -n google_cloud_storage-%{version}
|
||
|
||
%if !%{with test}
|
||
%build
|
||
%pyproject_wheel
|
||
%endif
|
||
|
||
%if !%{with test}
|
||
%install
|
||
%pyproject_install
|
||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||
%endif
|
||
|
||
%if %{with test}
|
||
%check
|
||
# Set Fake default credentials for tests
|
||
mkdir -p $HOME/.config/gcloud
|
||
cat > $HOME/.config/gcloud/application_default_credentials.json <<EOF
|
||
{
|
||
"client_id": "111111111111-1qq1q1qq1qqq111qq1qqqq11q1qqqqqq.apps.googleusercontent.com",
|
||
"client_secret": "d-XXXXXXXXXXXXXXXXXXXXXX",
|
||
"refresh_token": "1//1111111111111111111111111111-XXXXXXXXX-AAAAAAAAAAA_BBBBBBBBBBBBBBBBBBBBBB-CCCCCCCCCCCCCCCCCCCCCCCCCC",
|
||
"type": "authorized_user"
|
||
}
|
||
EOF
|
||
|
||
export PYTEST_ADDOPTS="--import-mode=importlib" PYTHONPATH="."
|
||
# fails with the tests project env
|
||
WITHOUT_PROJECT="test_ctor_w_custom_endpoint_bypass_auth"
|
||
%pytest -k $WITHOUT_PROJECT tests/unit
|
||
|
||
# Some tests needs the GOOGLE_CLOUD_PROJECT environment variable
|
||
export GOOGLE_CLOUD_PROJECT="PROJECT"
|
||
%pytest -k "not (network or $WITHOUT_PROJECT)" tests/unit
|
||
%endif
|
||
|
||
%if !%{with test}
|
||
%files %{python_files}
|
||
%license LICENSE
|
||
%doc README.rst
|
||
%dir %{python_sitelib}/google
|
||
%dir %{python_sitelib}/google/cloud
|
||
%{python_sitelib}/google/cloud/storage
|
||
%{python_sitelib}/google/cloud/_storage_v2
|
||
%{python_sitelib}/google_cloud_storage-%{version}*-info
|
||
%endif
|
||
|
||
%changelog
|