| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b551dc commit 1230e17
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | "api_id": "storage.googleapis.com", | |
| 13 | 13 | "requires_billing": true, | |
| 14 | 14 | "default_version": "v2", | |
| 15 | - "codeowner_team": "@googleapis/yoshi-python @googleapis/gcs-sdk-team @googleapis/gcs-fs", | ||
| 15 | + "codeowner_team": "@googleapis/cloud-sdk-python-team @googleapis/gcs-team @googleapis/gcs-fs", | ||
| 16 | 16 | "api_shortname": "storage", | |
| 17 | 17 | "api_description": "is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally." | |
| 18 | 18 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,6 +41,12 @@ | |||
| 41 | 41 | "README.rst", | |
| 42 | 42 | # Exclude autogenerated default import `google.cloud.storage` | |
| 43 | 43 | "google/cloud/storage/*", | |
| 44 | + # Temporarily exclude google/cloud/_storage_v2/services/storage/client.py | ||
| 45 | + # and tests/unit/gapic due to customization. | ||
| 46 | + # This exclusion will be removed in the google-cloud-python migration PR | ||
| 47 | + # When librarian.py is dropped. | ||
| 48 | + "tests/unit/gapic/*", | ||
| 49 | + "google/cloud/storage_v2/services/storage/client.py", | ||
| 44 | 50 | # Exclude autogenerated constraints files for Python 3.7/3.9 | |
| 45 | 51 | "testing/constraints-3.7.txt", | |
| 46 | 52 | "testing/constraints-3.9.txt", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,6 @@ | |||
| 17 | 17 | from __future__ import absolute_import | |
| 18 | 18 | import os | |
| 19 | 19 | import pathlib | |
| 20 | - import re | ||
| 21 | 20 | import shutil | |
| 22 | 21 | ||
| 23 | 22 | import nox | |
@@ -28,7 +27,13 @@ | |||
| 28 | 27 | ||
| 29 | 28 | DEFAULT_PYTHON_VERSION = "3.14" | |
| 30 | 29 | SYSTEM_TEST_PYTHON_VERSIONS = ["3.10", "3.14"] | |
| 31 | - UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| 30 | + UNIT_TEST_PYTHON_VERSIONS = [ | ||
| 31 | + "3.10", | ||
| 32 | + "3.11", | ||
| 33 | + "3.12", | ||
| 34 | + "3.13", | ||
| 35 | + "3.14", | ||
| 36 | + ] | ||
| 32 | 37 | CONFORMANCE_TEST_PYTHON_VERSIONS = ["3.12"] | |
| 33 | 38 | ||
| 34 | 39 | CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() | |
@@ -39,6 +44,7 @@ | |||
| 39 | 44 | nox.options.sessions = [ | |
| 40 | 45 | "blacken", | |
| 41 | 46 | "conftest_retry", | |
| 47 | + "conftest_retry_bidi", | ||
| 42 | 48 | "docfx", | |
| 43 | 49 | "docs", | |
| 44 | 50 | "lint", | |
@@ -61,9 +67,7 @@ def lint(session): | |||
| 61 | 67 | Returns a failure if the linters find linting errors or sufficiently | |
| 62 | 68 | serious code quality issues. | |
| 63 | 69 | """ | |
| 64 | - # Pin flake8 to 6.0.0 | ||
| 65 | - # See https://github.com/googleapis/python-storage/issues/1102 | ||
| 66 | - session.install("flake8==6.0.0", BLACK_VERSION) | ||
| 70 | + session.install("flake8", BLACK_VERSION) | ||
| 67 | 71 | session.run( | |
| 68 | 72 | "black", | |
| 69 | 73 | "--check", | |
@@ -116,6 +120,8 @@ def default(session, install_extras=True): | |||
| 116 | 120 | ||
| 117 | 121 | session.install("-e", ".", "-c", constraints_path) | |
| 118 | 122 | ||
| 123 | + session.run("python", "-m", "pip", "freeze") | ||
| 124 | + | ||
| 119 | 125 | # This dependency is included in setup.py for backwards compatibility only | |
| 120 | 126 | # and the client library is expected to pass all tests without it. See | |
| 121 | 127 | # setup.py and README for details. | |
@@ -180,7 +186,14 @@ def system(session): | |||
| 180 | 186 | # 2021-05-06: defer installing 'google-cloud-*' to after this package, | |
| 181 | 187 | # in order to work around Python 2.7 googolapis-common-protos | |
| 182 | 188 | # issue. | |
| 183 | - session.install("mock", "pytest", "pytest-rerunfailures", "-c", constraints_path) | ||
| 189 | + session.install( | ||
| 190 | + "mock", | ||
| 191 | + "pytest", | ||
| 192 | + "pytest-rerunfailures", | ||
| 193 | + "pytest-asyncio", | ||
| 194 | + "-c", | ||
| 195 | + constraints_path, | ||
| 196 | + ) | ||
| 184 | 197 | session.install("-e", ".", "-c", constraints_path) | |
| 185 | 198 | session.install( | |
| 186 | 199 | "google-cloud-testutils", | |
@@ -207,30 +220,75 @@ def system(session): | |||
| 207 | 220 | @nox.session(python=CONFORMANCE_TEST_PYTHON_VERSIONS) | |
| 208 | 221 | def conftest_retry(session): | |
| 209 | 222 | """Run the retry conformance test suite.""" | |
| 210 | - conformance_test_folder_path = os.path.join("tests", "conformance") | ||
| 211 | - conformance_test_folder_exists = os.path.exists(conformance_test_folder_path) | ||
| 223 | + json_conformance_tests = "tests/conformance/test_conformance.py" | ||
| 212 | 224 | # Environment check: only run tests if found. | |
| 213 | - if not conformance_test_folder_exists: | ||
| 225 | + if not os.path.exists(json_conformance_tests): | ||
| 214 | 226 | session.skip("Conformance tests were not found") | |
| 215 | 227 | ||
| 228 | + constraints_path = str( | ||
| 229 | + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" | ||
| 230 | + ) | ||
| 231 | + | ||
| 216 | 232 | # Install all test dependencies and pytest plugin to run tests in parallel. | |
| 217 | 233 | # Then install this package in-place. | |
| 218 | - session.install("pytest", "pytest-xdist") | ||
| 219 | - session.install("-e", ".") | ||
| 234 | + session.install( | ||
| 235 | + "pytest", | ||
| 236 | + "pytest-xdist", | ||
| 237 | + "-c", | ||
| 238 | + constraints_path, | ||
| 239 | + ) | ||
| 240 | + session.install("-e", ".", "-c", constraints_path) | ||
| 220 | 241 | ||
| 221 | 242 | # Run #CPU processes in parallel if no test session arguments are passed in. | |
| 222 | 243 | if session.posargs: | |
| 223 | 244 | test_cmd = [ | |
| 224 | - "py.test", | ||
| 225 | - "--quiet", | ||
| 226 | - conformance_test_folder_path, | ||
| 245 | + "pytest", | ||
| 246 | + "-vv", | ||
| 247 | + "-s", | ||
| 248 | + json_conformance_tests, | ||
| 227 | 249 | *session.posargs, | |
| 228 | 250 | ] | |
| 229 | 251 | else: | |
| 230 | - test_cmd = ["py.test", "-n", "auto", "--quiet", conformance_test_folder_path] | ||
| 252 | + test_cmd = ["pytest", "-vv", "-s", "-n", "auto", json_conformance_tests] | ||
| 253 | + | ||
| 254 | + # Run pytest against the conformance tests. | ||
| 255 | + session.run(*test_cmd, env={"DOCKER_API_VERSION": "1.39"}) | ||
| 256 | + | ||
| 231 | 257 | ||
| 232 | - # Run py.test against the conformance tests. | ||
| 233 | - session.run(*test_cmd) | ||
| 258 | + @nox.session(python=CONFORMANCE_TEST_PYTHON_VERSIONS) | ||
| 259 | + def conftest_retry_bidi(session): | ||
| 260 | + """Run the retry conformance test suite.""" | ||
| 261 | + | ||
| 262 | + constraints_path = str( | ||
| 263 | + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" | ||
| 264 | + ) | ||
| 265 | + | ||
| 266 | + # Install all test dependencies and pytest plugin to run tests in parallel. | ||
| 267 | + # Then install this package in-place. | ||
| 268 | + session.install( | ||
| 269 | + "pytest", | ||
| 270 | + "pytest-xdist", | ||
| 271 | + "pytest-asyncio", | ||
| 272 | + "grpcio", | ||
| 273 | + "grpcio-status", | ||
| 274 | + "grpc-google-iam-v1", | ||
| 275 | + "-c", | ||
| 276 | + constraints_path, | ||
| 277 | + ) | ||
| 278 | + session.install("-e", ".", "-c", constraints_path) | ||
| 279 | + | ||
| 280 | + bidi_tests = [ | ||
| 281 | + "tests/conformance/test_bidi_reads.py", | ||
| 282 | + "tests/conformance/test_bidi_writes.py", | ||
| 283 | + ] | ||
| 284 | + for test_file in bidi_tests: | ||
| 285 | + session.run( | ||
| 286 | + "pytest", | ||
| 287 | + "-vv", | ||
| 288 | + "-s", | ||
| 289 | + test_file, | ||
| 290 | + env={"DOCKER_API_VERSION": "1.39"}, | ||
| 291 | + ) | ||
| 234 | 292 | ||
| 235 | 293 | ||
| 236 | 294 | @nox.session(python=DEFAULT_PYTHON_VERSION) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,10 +43,46 @@ | |||
| 43 | 43 | "google-crc32c >= 1.1.3, < 2.0.0", | |
| 44 | 44 | ] | |
| 45 | 45 | extras = { | |
| 46 | + # TODO: Make these extra dependencies as mandatory once gRPC out of | ||
| 47 | + # experimental in this SDK. More info in b/465352227 | ||
| 48 | + "grpc": [ | ||
| 49 | + "google-api-core[grpc] >= 2.27.0, < 3.0.0", | ||
| 50 | + "grpcio >= 1.33.2, < 2.0.0; python_version < '3.14'", | ||
| 51 | + "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", | ||
| 52 | + "grpcio-status >= 1.76.0, < 2.0.0", | ||
| 53 | + "proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'", | ||
| 54 | + "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", | ||
| 55 | + "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", | ||
| 56 | + "grpc-google-iam-v1 >= 0.14.0, <1.0.0", | ||
| 57 | + ], | ||
| 46 | 58 | "protobuf": ["protobuf >= 3.20.2, < 7.0.0"], | |
| 47 | 59 | "tracing": [ | |
| 48 | 60 | "opentelemetry-api >= 1.1.0, < 2.0.0", | |
| 49 | 61 | ], | |
| 62 | + "testing": [ | ||
| 63 | + "google-cloud-testutils", | ||
| 64 | + "numpy", | ||
| 65 | + "psutil", | ||
| 66 | + "py-cpuinfo", | ||
| 67 | + "pytest-benchmark", | ||
| 68 | + "PyYAML", | ||
| 69 | + "mock", | ||
| 70 | + "pytest", | ||
| 71 | + "pytest-cov", | ||
| 72 | + "pytest-asyncio", | ||
| 73 | + "pytest-rerunfailures", | ||
| 74 | + "pytest-xdist", | ||
| 75 | + "google-cloud-testutils", | ||
| 76 | + "google-cloud-iam", | ||
| 77 | + "google-cloud-pubsub", | ||
| 78 | + "google-cloud-kms", | ||
| 79 | + "brotli", | ||
| 80 | + "coverage", | ||
| 81 | + "pyopenssl", | ||
| 82 | + "opentelemetry-sdk", | ||
| 83 | + "flake8", | ||
| 84 | + "black", | ||
| 85 | + ], | ||
| 50 | 86 | } | |
| 51 | 87 | ||
| 52 | 88 | ||
@@ -99,7 +135,7 @@ | |||
| 99 | 135 | packages=packages, | |
| 100 | 136 | install_requires=dependencies, | |
| 101 | 137 | extras_require=extras, | |
| 102 | - python_requires=">=3.7", | ||
| 138 | + python_requires=">=3.10", | ||
| 103 | 139 | include_package_data=True, | |
| 104 | 140 | zip_safe=False, | |
| 105 | 141 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li | |||
| 2 | 2 | libraries: | |
| 3 | 3 | - id: google-cloud-storage | |
| 4 | 4 | version: 3.10.1 | |
| 5 | - last_generated_commit: 5400ccce473c439885bd6bf2924fd242271bfcab | ||
| 5 | + last_generated_commit: b3f7a1f7550d68ec7d92d12eb21092930ce16ede | ||
| 6 | 6 | apis: | |
| 7 | 7 | - path: google/storage/v2 | |
| 8 | 8 | service_config: storage_v2.yaml | |
@@ -22,10 +22,18 @@ libraries: | |||
| 22 | 22 | - ^renovate.json | |
| 23 | 23 | - ^setup.py | |
| 24 | 24 | - ^docs/summary_overview.md | |
| 25 | - - ^google/cloud/_storage_v2 | ||
| 25 | + - ^google/cloud/_storage_v2/__init__.py | ||
| 26 | + - ^google/cloud/_storage_v2/gapic | ||
| 27 | + - ^google/cloud/_storage_v2/py.typed | ||
| 28 | + - ^google/cloud/_storage_v2/samples/generated_samples | ||
| 29 | + - ^google/cloud/_storage_v2/services/__init__.py | ||
| 30 | + - ^google/cloud/_storage_v2/services/storage/transports | ||
| 31 | + - ^google/cloud/_storage_v2/services/storage/__init__.py | ||
| 32 | + - ^google/cloud/_storage_v2/services/storage/async_client.py | ||
| 33 | + - ^google/cloud/_storage_v2/services/storage/pagers.py | ||
| 34 | + - ^google/cloud/_storage_v2/types | ||
| 26 | 35 | - ^samples/generated_samples | |
| 27 | 36 | - ^testing/constraints-3.8.txt | |
| 28 | 37 | - ^testing/constraints-3.1.* | |
| 29 | 38 | - ^tests/__init__.py | |
| 30 | - - ^tests/unit/gapic | ||
| 31 | 39 | tag_format: v{version} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2472,8 +2472,9 @@ def bidi_read_object( | |||
| 2472 | 2472 | across several messages. If an error occurs with any request, | |
| 2473 | 2473 | the stream closes with a relevant error code. Since you can have | |
| 2474 | 2474 | multiple outstanding requests, the error response includes a | |
| 2475 | - ``BidiReadObjectRangesError`` field detailing the specific error | ||
| 2476 | - for each pending ``read_id``. | ||
| 2475 | + ``BidiReadObjectError`` proto in its ``details`` field, | ||
| 2476 | + reporting the specific error, if any, for each pending | ||
| 2477 | + ``read_id``. | ||
| 2477 | 2478 | ||
| 2478 | 2479 | **IAM Permissions**: | |
| 2479 | 2480 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -946,8 +946,9 @@ def bidi_read_object( | |||
| 946 | 946 | across several messages. If an error occurs with any request, | |
| 947 | 947 | the stream closes with a relevant error code. Since you can have | |
| 948 | 948 | multiple outstanding requests, the error response includes a | |
| 949 | - ``BidiReadObjectRangesError`` field detailing the specific error | ||
| 950 | - for each pending ``read_id``. | ||
| 949 | + ``BidiReadObjectError`` proto in its ``details`` field, | ||
| 950 | + reporting the specific error, if any, for each pending | ||
| 951 | + ``read_id``. | ||
| 951 | 952 | ||
| 952 | 953 | **IAM Permissions**: | |
| 953 | 954 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -971,8 +971,9 @@ def bidi_read_object( | |||
| 971 | 971 | across several messages. If an error occurs with any request, | |
| 972 | 972 | the stream closes with a relevant error code. Since you can have | |
| 973 | 973 | multiple outstanding requests, the error response includes a | |
| 974 | - ``BidiReadObjectRangesError`` field detailing the specific error | ||
| 975 | - for each pending ``read_id``. | ||
| 974 | + ``BidiReadObjectError`` proto in its ``details`` field, | ||
| 975 | + reporting the specific error, if any, for each pending | ||
| 976 | + ``read_id``. | ||
| 976 | 977 | ||
| 977 | 978 | **IAM Permissions**: | |
| 978 | 979 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -489,6 +489,11 @@ class ComposeObjectRequest(proto.Message): | |||
| 489 | 489 | Optional. The checksums of the complete | |
| 490 | 490 | object. This is validated against the combined | |
| 491 | 491 | checksums of the component objects. | |
| 492 | + delete_source_objects (bool): | ||
| 493 | + Whether the source objects should be deleted | ||
| 494 | + in the compose request. | ||
| 495 | + | ||
| 496 | + This field is a member of `oneof`_ ``_delete_source_objects``. | ||
| 492 | 497 | """ | |
| 493 | 498 | ||
| 494 | 499 | class SourceObject(proto.Message): | |
@@ -580,6 +585,11 @@ class ObjectPreconditions(proto.Message): | |||
| 580 | 585 | number=10, | |
| 581 | 586 | message="ObjectChecksums", | |
| 582 | 587 | ) | |
| 588 | + delete_source_objects: bool = proto.Field( | ||
| 589 | + proto.BOOL, | ||
| 590 | + number=11, | ||
| 591 | + optional=True, | ||
| 592 | + ) | ||
| 583 | 593 | ||
| 584 | 594 | ||
| 585 | 595 | class DeleteObjectRequest(proto.Message): | |
@@ -1460,18 +1470,18 @@ class ReadRange(proto.Message): | |||
| 1460 | 1470 | ``ReadObjectRequest`` with ``read_offset`` = -5 and | |
| 1461 | 1471 | ``read_length`` = 3 would return bytes 10 through 12 of the | |
| 1462 | 1472 | object. Requesting a negative offset with magnitude larger | |
| 1463 | - than the size of the object returns the entire object. A | ||
| 1464 | - ``read_offset`` larger than the size of the object results | ||
| 1465 | - in an ``OutOfRange`` error. | ||
| 1473 | + than the size of the object is equivalent to ``read_offset`` | ||
| 1474 | + = 0. A ``read_offset`` larger than the size of the object | ||
| 1475 | + results in an ``OutOfRange`` error. | ||
| 1466 | 1476 | read_length (int): | |
| 1467 | 1477 | Optional. The maximum number of data bytes the server is | |
| 1468 | 1478 | allowed to return across all response messages with the same | |
| 1469 | 1479 | ``read_id``. A ``read_length`` of zero indicates to read | |
| 1470 | 1480 | until the resource end, and a negative ``read_length`` | |
| 1471 | - causes an error. If the stream returns fewer bytes than | ||
| 1472 | - allowed by the ``read_length`` and no error occurred, the | ||
| 1473 | - stream includes all data from the ``read_offset`` to the | ||
| 1474 | - resource end. | ||
| 1481 | + causes an ``OutOfRange`` error. If the stream returns fewer | ||
| 1482 | + bytes than allowed by the ``read_length`` and no error | ||
| 1483 | + occurred, the stream includes all data from the | ||
| 1484 | + ``read_offset`` to the resource end. | ||
| 1475 | 1485 | read_id (int): | |
| 1476 | 1486 | Required. Read identifier provided by the client. When the | |
| 1477 | 1487 | client issues more than one outstanding ``ReadRange`` on the | |
@@ -4364,7 +4374,10 @@ class ObjectContexts(proto.Message): | |||
| 4364 | 4374 | ||
| 4365 | 4375 | Attributes: | |
| 4366 | 4376 | custom (MutableMapping[str, google.cloud._storage_v2.types.ObjectCustomContextPayload]): | |
| 4367 | - Optional. User-defined object contexts. | ||
| 4377 | + Optional. User-defined object contexts. The maximum key or | ||
| 4378 | + value size is ``256`` characters. The maximum number of | ||
| 4379 | + entries is ``50``. The maximum total serialized size of all | ||
| 4380 | + entries is ``25KiB``. | ||
| 4368 | 4381 | """ | |
| 4369 | 4382 | ||
| 4370 | 4383 | custom: MutableMapping[str, "ObjectCustomContextPayload"] = proto.MapField( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,8 +67,6 @@ def lint(session): | |||
| 67 | 67 | Returns a failure if the linters find linting errors or sufficiently | |
| 68 | 68 | serious code quality issues. | |
| 69 | 69 | """ | |
| 70 | - # Pin flake8 to 6.0.0 | ||
| 71 | - # See https://github.com/googleapis/python-storage/issues/1102 | ||
| 72 | 70 | session.install("flake8", BLACK_VERSION) | |
| 73 | 71 | session.run( | |
| 74 | 72 | "black", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments