This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
chore: librarian generate pull request: 20260325T203946Z #1783
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,10 +43,46 @@ | |
| "google-crc32c >= 1.1.3, < 2.0.0", | ||
| ] | ||
| extras = { | ||
| # TODO: Make these extra dependencies as mandatory once gRPC out of | ||
| # experimental in this SDK. More info in b/465352227 | ||
| "grpc": [ | ||
| "google-api-core[grpc] >= 2.27.0, < 3.0.0", | ||
| "grpcio >= 1.33.2, < 2.0.0; python_version < '3.14'", | ||
| "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", | ||
| "grpcio-status >= 1.76.0, < 2.0.0", | ||
| "proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'", | ||
| "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", | ||
| "protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", | ||
| "grpc-google-iam-v1 >= 0.14.0, <1.0.0", | ||
| ], | ||
| "protobuf": ["protobuf >= 3.20.2, < 7.0.0"], | ||
| "tracing": [ | ||
| "opentelemetry-api >= 1.1.0, < 2.0.0", | ||
| ], | ||
| "testing": [ | ||
| "google-cloud-testutils", | ||
| "numpy", | ||
| "psutil", | ||
| "py-cpuinfo", | ||
| "pytest-benchmark", | ||
| "PyYAML", | ||
| "mock", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-asyncio", | ||
| "pytest-rerunfailures", | ||
| "pytest-xdist", | ||
| "google-cloud-testutils", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "google-cloud-iam", | ||
| "google-cloud-pubsub", | ||
| "google-cloud-kms", | ||
| "brotli", | ||
| "coverage", | ||
| "pyopenssl", | ||
| "opentelemetry-sdk", | ||
| "flake8", | ||
| "black", | ||
| ], | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -99,7 +135,7 @@ | |
| packages=packages, | ||
| install_requires=dependencies, | ||
| extras_require=extras, | ||
| python_requires=">=3.7", | ||
| python_requires=">=3.10", | ||
| include_package_data=True, | ||
| zip_safe=False, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -184,34 +184,6 @@ def _get_default_mtls_endpoint(api_endpoint): | |||||
| _DEFAULT_ENDPOINT_TEMPLATE = "storage.{UNIVERSE_DOMAIN}" | ||||||
| _DEFAULT_UNIVERSE = "googleapis.com" | ||||||
|
|
||||||
| @staticmethod | ||||||
| def _use_client_cert_effective(): | ||||||
| """Returns whether client certificate should be used for mTLS if the | ||||||
| google-auth version supports should_use_client_cert automatic mTLS enablement. | ||||||
|
|
||||||
| Alternatively, read from the GOOGLE_API_USE_CLIENT_CERTIFICATE env var. | ||||||
|
|
||||||
| Returns: | ||||||
| bool: whether client certificate should be used for mTLS | ||||||
| Raises: | ||||||
| ValueError: (If using a version of google-auth without should_use_client_cert and | ||||||
| GOOGLE_API_USE_CLIENT_CERTIFICATE is set to an unexpected value.) | ||||||
| """ | ||||||
| # check if google-auth version supports should_use_client_cert for automatic mTLS enablement | ||||||
| if hasattr(mtls, "should_use_client_cert"): | ||||||
| return mtls.should_use_client_cert() | ||||||
| else: | ||||||
| # if unsupported, fallback to reading from env var | ||||||
| use_client_cert_str = os.getenv( | ||||||
| "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" | ||||||
| ).lower() | ||||||
| if use_client_cert_str not in ("true", "false"): | ||||||
| raise ValueError( | ||||||
| "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be" | ||||||
| " either `true` or `false`" | ||||||
| ) | ||||||
| return use_client_cert_str == "true" | ||||||
|
|
||||||
| @classmethod | ||||||
| def from_service_account_info(cls, info: dict, *args, **kwargs): | ||||||
| """Creates an instance of this client using the provided credentials | ||||||
|
|
@@ -418,16 +390,20 @@ def get_mtls_endpoint_and_cert_source( | |||||
| ) | ||||||
| if client_options is None: | ||||||
| client_options = client_options_lib.ClientOptions() | ||||||
| use_client_cert = StorageClient._use_client_cert_effective() | ||||||
| use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value of the
Suggested change
|
||||||
| use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") | ||||||
| if use_client_cert not in ("true", "false"): | ||||||
| raise ValueError( | ||||||
| "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" | ||||||
| ) | ||||||
| if use_mtls_endpoint not in ("auto", "never", "always"): | ||||||
| raise MutualTLSChannelError( | ||||||
| "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" | ||||||
| ) | ||||||
|
|
||||||
| # Figure out the client cert source to use. | ||||||
| client_cert_source = None | ||||||
| if use_client_cert: | ||||||
| if use_client_cert == "true": | ||||||
| if client_options.client_cert_source: | ||||||
| client_cert_source = client_options.client_cert_source | ||||||
| elif mtls.has_default_client_cert_source(): | ||||||
|
|
@@ -459,14 +435,20 @@ def _read_environment_variables(): | |||||
| google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT | ||||||
| is not any of ["auto", "never", "always"]. | ||||||
| """ | ||||||
| use_client_cert = StorageClient._use_client_cert_effective() | ||||||
| use_client_cert = os.getenv( | ||||||
| "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" | ||||||
| ).lower() | ||||||
| use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() | ||||||
| universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") | ||||||
| if use_client_cert not in ("true", "false"): | ||||||
| raise ValueError( | ||||||
| "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" | ||||||
| ) | ||||||
| if use_mtls_endpoint not in ("auto", "never", "always"): | ||||||
| raise MutualTLSChannelError( | ||||||
| "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" | ||||||
| ) | ||||||
| return use_client_cert, use_mtls_endpoint, universe_domain_env | ||||||
| return use_client_cert == "true", use_mtls_endpoint, universe_domain_env | ||||||
|
|
||||||
| @staticmethod | ||||||
| def _get_client_cert_source(provided_cert_source, use_cert_flag): | ||||||
|
|
@@ -2899,8 +2881,9 @@ def bidi_read_object( | |||||
| across several messages. If an error occurs with any request, | ||||||
| the stream closes with a relevant error code. Since you can have | ||||||
| multiple outstanding requests, the error response includes a | ||||||
| ``BidiReadObjectRangesError`` field detailing the specific error | ||||||
| for each pending ``read_id``. | ||||||
| ``BidiReadObjectError`` proto in its ``details`` field, | ||||||
| reporting the specific error, if any, for each pending | ||||||
| ``read_id``. | ||||||
|
|
||||||
| **IAM Permissions**: | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
conftest_retry_bidisession runspytestin a loop for each test file. This is inefficient as it incurspyteststartup overhead for each file. You can improve performance by runningpytestonce with all test files passed as arguments.