diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b8edda5..98994f4 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 + digest: sha256:2d816f26f728ac8b24248741e7d4c461c09764ef9f7be3684d557c9632e46dbd +# created: 2023-06-28T17:03:33.371210701Z diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index ecbcf0f..de9bf25 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -38,3 +38,12 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } + +# Store the packages we uploaded to PyPI. That way, we have a record of exactly +# what we published, which we can use to generate SBOMs and attestations. +action { + define_artifacts { + regex: "github/python-binary-authorization/**/*.tar.gz" + strip_prefix: "github/python-binary-authorization" + } +} diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 66a2172..c7929db 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -113,28 +113,26 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==39.0.1 \ - --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ - --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ - --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ - --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ - --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ - --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ - --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ - --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ - --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ - --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ - --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ - --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ - --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ - --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ - --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ - --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ - --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ - --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ - --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ - --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ - --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 +cryptography==41.0.0 \ + --hash=sha256:0ddaee209d1cf1f180f1efa338a68c4621154de0afaef92b89486f5f96047c55 \ + --hash=sha256:14754bcdae909d66ff24b7b5f166d69340ccc6cb15731670435efd5719294895 \ + --hash=sha256:344c6de9f8bda3c425b3a41b319522ba3208551b70c2ae00099c205f0d9fd3be \ + --hash=sha256:34d405ea69a8b34566ba3dfb0521379b210ea5d560fafedf9f800a9a94a41928 \ + --hash=sha256:3680248309d340fda9611498a5319b0193a8dbdb73586a1acf8109d06f25b92d \ + --hash=sha256:3c5ef25d060c80d6d9f7f9892e1d41bb1c79b78ce74805b8cb4aa373cb7d5ec8 \ + --hash=sha256:4ab14d567f7bbe7f1cdff1c53d5324ed4d3fc8bd17c481b395db224fb405c237 \ + --hash=sha256:5c1f7293c31ebc72163a9a0df246f890d65f66b4a40d9ec80081969ba8c78cc9 \ + --hash=sha256:6b71f64beeea341c9b4f963b48ee3b62d62d57ba93eb120e1196b31dc1025e78 \ + --hash=sha256:7d92f0248d38faa411d17f4107fc0bce0c42cae0b0ba5415505df72d751bf62d \ + --hash=sha256:8362565b3835ceacf4dc8f3b56471a2289cf51ac80946f9087e66dc283a810e0 \ + --hash=sha256:84a165379cb9d411d58ed739e4af3396e544eac190805a54ba2e0322feb55c46 \ + --hash=sha256:88ff107f211ea696455ea8d911389f6d2b276aabf3231bf72c8853d22db755c5 \ + --hash=sha256:9f65e842cb02550fac96536edb1d17f24c0a338fd84eaf582be25926e993dde4 \ + --hash=sha256:a4fc68d1c5b951cfb72dfd54702afdbbf0fb7acdc9b7dc4301bbf2225a27714d \ + --hash=sha256:b7f2f5c525a642cecad24ee8670443ba27ac1fab81bba4cc24c7b6b41f2d0c75 \ + --hash=sha256:b846d59a8d5a9ba87e2c3d757ca019fa576793e8758174d3868aecb88d6fc8eb \ + --hash=sha256:bf8fc66012ca857d62f6a347007e166ed59c0bc150cefa49f28376ebe7d992a2 \ + --hash=sha256:f5d0bf9b252f30a31664b6f64432b4730bb7038339bd18b1fafe129cfc2be9be # via # gcp-releasetool # secretstorage @@ -419,9 +417,9 @@ readme-renderer==37.3 \ --hash=sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273 \ --hash=sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343 # via twine -requests==2.28.1 \ - --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ - --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 +requests==2.31.0 \ + --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ + --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 # via # gcp-releasetool # google-api-core diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 093be7e..9464c4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.6.1" + ".": "1.6.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 00dba5d..4d36cae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.6.2](https://github.com/googleapis/python-binary-authorization/compare/v1.6.1...v1.6.2) (2023-07-04) + + +### Bug Fixes + +* Add async context manager return types ([#215](https://github.com/googleapis/python-binary-authorization/issues/215)) ([bb5e71d](https://github.com/googleapis/python-binary-authorization/commit/bb5e71d61ed841e62276104819630a5f76ffe68d)) + ## [1.6.1](https://github.com/googleapis/python-binary-authorization/compare/v1.6.0...v1.6.1) (2023-03-23) diff --git a/google/cloud/binaryauthorization/gapic_version.py b/google/cloud/binaryauthorization/gapic_version.py index b4028ab..c6e54fe 100644 --- a/google/cloud/binaryauthorization/gapic_version.py +++ b/google/cloud/binaryauthorization/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.1" # {x-release-please-version} +__version__ = "1.6.2" # {x-release-please-version} diff --git a/google/cloud/binaryauthorization_v1/gapic_version.py b/google/cloud/binaryauthorization_v1/gapic_version.py index b4028ab..c6e54fe 100644 --- a/google/cloud/binaryauthorization_v1/gapic_version.py +++ b/google/cloud/binaryauthorization_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.1" # {x-release-please-version} +__version__ = "1.6.2" # {x-release-please-version} diff --git a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py index fbb751d..6781b81 100644 --- a/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/binauthz_management_service_v1/async_client.py @@ -1109,7 +1109,7 @@ async def sample_delete_attestor(): metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "BinauthzManagementServiceV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py index a7289c3..650ba61 100644 --- a/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/system_policy_v1/async_client.py @@ -319,7 +319,7 @@ async def sample_get_system_policy(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SystemPolicyV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py index e52ec92..772e24d 100644 --- a/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py +++ b/google/cloud/binaryauthorization_v1/services/validation_helper_v1/async_client.py @@ -297,7 +297,7 @@ async def sample_validate_attestation_occurrence(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "ValidationHelperV1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1beta1/gapic_version.py b/google/cloud/binaryauthorization_v1beta1/gapic_version.py index b4028ab..c6e54fe 100644 --- a/google/cloud/binaryauthorization_v1beta1/gapic_version.py +++ b/google/cloud/binaryauthorization_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.1" # {x-release-please-version} +__version__ = "1.6.2" # {x-release-please-version} diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py index 0c5f741..0ab80ab 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py @@ -1122,7 +1122,7 @@ async def sample_delete_attestor(): metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "BinauthzManagementServiceV1Beta1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py index e496afe..da7cf16 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/system_policy_v1_beta1/async_client.py @@ -321,7 +321,7 @@ async def sample_get_system_policy(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "SystemPolicyV1Beta1AsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/noxfile.py b/noxfile.py index 95e58c5..7d411fe 100644 --- a/noxfile.py +++ b/noxfile.py @@ -305,10 +305,9 @@ def docfx(session): session.install("-e", ".") session.install( - "sphinx==4.0.1", + "gcp-sphinx-docfx-yaml", "alabaster", "recommonmark", - "gcp-sphinx-docfx-yaml", ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) @@ -380,6 +379,7 @@ def prerelease_deps(session): "grpcio!=1.52.0rc1", "grpcio-status", "google-api-core", + "google-auth", "proto-plus", "google-cloud-testutils", # dependencies of google-cloud-testutils" @@ -392,7 +392,6 @@ def prerelease_deps(session): # Remaining dependencies other_deps = [ "requests", - "google-auth", ] session.install(*other_deps) diff --git a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json index 9830aac..843d75d 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-binary-authorization", - "version": "1.6.1" + "version": "1.6.2" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json index a476868..7173451 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-binary-authorization", - "version": "1.6.1" + "version": "1.6.2" }, "snippets": [ { diff --git a/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py b/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py index 38c11e4..682efdc 100644 --- a/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py +++ b/tests/unit/gapic/binaryauthorization_v1/test_binauthz_management_service_v1.py @@ -1265,9 +1265,6 @@ def test_create_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.create_attestor(request) @@ -1520,9 +1517,6 @@ def test_get_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.get_attestor(request) @@ -1755,9 +1749,6 @@ def test_update_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) response = client.update_attestor(request) @@ -2379,9 +2370,11 @@ async def test_list_attestors_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_attestors(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3218,9 +3211,6 @@ def test_create_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3534,9 +3524,6 @@ def test_get_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3819,9 +3806,6 @@ def test_update_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_grafeas_note=resources.UserOwnedGrafeasNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj diff --git a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py index a8398a5..2d219d8 100644 --- a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py +++ b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py @@ -1277,9 +1277,6 @@ def test_create_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.create_attestor(request) @@ -1532,9 +1529,6 @@ def test_get_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.get_attestor(request) @@ -1767,9 +1761,6 @@ def test_update_attestor(request_type, transport: str = "grpc"): call.return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) response = client.update_attestor(request) @@ -2391,9 +2382,11 @@ async def test_list_attestors_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_attestors(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3231,9 +3224,6 @@ def test_create_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3549,9 +3539,6 @@ def test_get_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj @@ -3834,9 +3821,6 @@ def test_update_attestor_rest(request_type): return_value = resources.Attestor( name="name_value", description="description_value", - user_owned_drydock_note=resources.UserOwnedDrydockNote( - note_reference="note_reference_value" - ), ) # Wrap the value into a proper Response obj