Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: merge main branch into v1 (#438)
* fix: strip trailing _ from field mask paths (#228) * fix!: drop support for Python 2.7 / 3.5 (#212) Drop 'six' module Drop 'u"' prefixes for text Remove other Python 2.7 workarounds Drop use of 'pytz' Dxpand range to allow 'google-auth' 2.x versions Remove 'general_helpers.wraps': except for a backward-compatibility import, 'functools.wraps' does everything wee need on Python >= 3.6. Remove 'packaging' dependency Release-As: 2.0.0b1 Closes #74. Closes #215. * chore: release 2.0.0b1 (#243) * chore: remove non-custom rules from sync-repo-settings (#241) See https://github.com/googleapis/repo-automation-bots/blob/63c858e539e1f4d9bb8ea66e12f9c0a0de5fef55/packages/sync-repo-settings/src/required-checks.json#L40-L50 for defaults. * chore(python): avoid `.nox` directories when building docs (#249) Source-Link: googleapis/synthtool@7e1f6da Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d * chore: avoid duplicating pins of grpcio in noxfile (#246) Rely on the pins in 'setup.py' as the Source of Truth. See #234 (review) * chore: drop mention of Python 2.7 from templates (#252) Source-Link: googleapis/synthtool@facee4c Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore: update if_transient_error docs to match behaviour (#253) Fixes #185 🦕 * fix: bump grpcio version to use stable aio API (#234) * tests: silence a warning from 'charset_normalizer' (#247) * chore: release 2.0.0 (#254) :robot: I have created a release \*beep\* \*boop\* --- ## [2.0.0](https://www.github.com/googleapis/python-api-core/compare/v2.0.0-b1...v2.0.0) (2021-08-18) ### ⚠ BREAKING CHANGES * drop support for Python 2.7 / 3.5 ([#212](https://www.github.com/googleapis/python-api-core/issues/212)) ([a30f004](https://www.github.com/googleapis/python-api-core/commit/a30f004e74f709d46e905dd819c71f43354e9ac9)) ### Bug Fixes * bump grpcio version to use stable aio API ([#234](https://www.github.com/googleapis/python-api-core/issues/234)) ([bdbf889](https://www.github.com/googleapis/python-api-core/commit/bdbf889210b709d7c1945f2160bcba9161b4dd2e)) * strip trailing _ from field mask paths ([#228](https://www.github.com/googleapis/python-api-core/issues/228)) ([ff6ef1b](https://www.github.com/googleapis/python-api-core/commit/ff6ef1bd07fa68307b7c82c910416d770e7b3416)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * chore(python): disable dependency dashboard (#266) * chore: migrate default branch to main (#264) * tests: close coverage gap for race condition (#261) Closes #260 * fix: do not error on LROs with no response or error (#258) Co-authored-by: Tres Seaver <tseaver@palladion.com> * chore: release 2.0.1 (#267) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(python): group renovate prs (#270) * chore: remove obsolete dependency in setup.py (#269) Co-authored-by: Tres Seaver <tseaver@palladion.com> * chore: removing owlbot directives for conversion to main (#272) chore: removing owlbot directives for conversion to main * feat: add grpc transcoding + tests (#259) * feat: add grpc transcoding + tests * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: tweak for clarity / idiomatic usage * chore: attempt to appease Sphinx * feat: add grpc transcoding + tests * Add functions to properly handle subfields * Add unit tests for get_field and delete_field. * Add function docstrings and incorporate correct native dict functions. * Add function docstrings and incorporate correct native dict functions. * Increase code coverage * Increase code coverage * Increase code coverage * Reformat files Co-authored-by: Yonatan Getahun <yonmg@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tres Seaver <tseaver@palladion.com> * feat: Add helper function to format query_params for rest transport. (#275) Co-authored-by: Kenneth Bandes <kbandes@google.com> * chore: relocate owl bot post processor (#280) chore: relocate owl bot post processor * tests: add explicit unit tests for '_StreamedResponseIterator' class (#281) * chore: add default_version and codeowner_team to .repo-metadata.json (#282) * chore: add default_version and codeowner_team to .repo-metadata.json * Assign @googleapis/actools-python as codeowner * build: use trampoline_v2 for python samples and allow custom dockerfile (#283) Source-Link: googleapis/synthtool@a7ed11e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6e7328583be8edd3ba8f35311c76a1ecbc823010279ccb6ab46b7a76e25eafcc Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: add support for Python 3.10 (#284) Fix new deprecation warning for 'threading.Condition.notifyAll'. * chore: release 2.1.0 (#274) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(python): Add kokoro configs for python 3.10 samples testing (#285) Source-Link: googleapis/synthtool@c6e69c4 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:58f73ba196b5414782605236dd0712a73541b44ff2ff4d3a36ec41092dd6fa5b Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * fix: add mypy checking + 'py.typed' file (#290) * chore: release 2.1.1 (#291) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * tests: add testing w/o 'grpc' installed (#289) Closes #288. * feat: add 'GoogleAPICallError.error_details' property (#286) Based on 'google.rpc.status.details'. * chore(python): push cloud library docs to staging bucket for Cloud RAD (#295) Source-Link: googleapis/synthtool@7fd61f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore: release 2.2.0 (#293) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: revert "fix: do not error on LROs with no response or error" (#294) Reverts #258 From @TrucHLe > A while ago you helped me submit this pull request for the Python LRO client library. This was about making the LRO library not throw an error when receiving an empty LRO response. It turns out that the Python LRO library has always been behaving correctly by accepting empty LRO responses. It would just throw an error if the response field is NULL (see screenshot). > > Since then I've consulted other LRO client library owners (@vam-google ) and it turns out that the fault was in the CCAI Insights server code. CCAI Insights was returning NULL responses instead of empty responses (more context here b/202432905). Since then the issue has been fixed in our server and has rolled out to production, so reverting the Python LRO false fix wouldn't break our code sample. * chore: release 2.2.1 (#296) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: make 'gapic_v1.method.DEFAULT' a typed object (#292) FBO checkers which need to verify default values for 'retry' / 'timeout' * chore: release 2.2.2 (#302) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.2](https://www.github.com/googleapis/python-api-core/compare/v2.2.1...v2.2.2) (2021-11-02) ### Bug Fixes * make 'gapic_v1.method.DEFAULT' a typed object ([#292](https://www.github.com/googleapis/python-api-core/issues/292)) ([ffc51f0](https://www.github.com/googleapis/python-api-core/commit/ffc51f03c7ce5d9f009ba859b8df385d52925578)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * fix: handle bare 'grpc.Call' in 'from_grpc_error' (#298) * fix: handle bare 'grpc.Call' in 'from_grpc_error' Fixes: #297. * tests: add assertion for 'exception.details' * chore(python): add .github/CODEOWNERS as a templated file (#308) Source-Link: googleapis/synthtool@c5026b3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * ci: tweak mypy to check 'google.protobuf' (#310) Install the 'types-protobuf' package in support. * feat: add operations rest client to support long-running operations. (#311) * feat: add operations rest client to support long-running operations. * fix: address test coverage gaps in operations rest client. * fix: removed stray print statement. * fix: address lint, blacken, and mypy issues. * fix: address pytype, more coverage issues * fix: addressed additional pytype issues and one coverage line. * fix: renamed OperationsRestClient to AbstractOperationsClient. Co-authored-by: Kenneth Bandes <kbandes@google.com> * chore: release 2.3.0 (#314) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * ci: run lint / mypy / unit tests / coverage as GH actions (#287) Make GH Action checks required * feat: add support for 'error_info' (#315) * feat: Adds support for error_info. * chore: fixes pytype. Co-authored-by: Tres Seaver <tseaver@palladion.com> * fix: exclude function target from retry deadline exceeded exception message (#318) * Exclude function target from retry deadline exceeded exception message * apply similar patch in retry_async.py Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore: use python-samples-reviewers (#328) * chore: update release_level in repo-metadata.json (#326) * chore: update .repo-metadata.json * revert * remove api_shortname * feat: iterator for processing JSON responses in REST streaming. (#317) * feat: files for REST server streaming. * chore: release 2.4.0 (#316) * chore: release 2.4.0 * chore: delete #318 from log (already released) * Update changelog to include published versions * insert newline in changelog * insert newline in changelog Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * build: switch to release-please for tagging (#331) * docs: fix typo in library name (#332) * chore(python): update release.sh to use keystore (#333) Source-Link: googleapis/synthtool@69fda12 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore: move docs check from kokoro to GH actions (#334) * chore: move docs check from kokoro to GH actions * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix typo Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: add api_key to client options (#248) * feat: add api_key to client options * update * ci(python): run lint / unit tests / docs as GH actions (#336) * ci(python): run lint / unit tests / docs as GH actions Source-Link: googleapis/synthtool@57be0cd Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 * revert changes to unittest gh action * move mypy check into separate workflow * update .sync-repo-settings to reflect changes to gh checks * use python 3.7 for lint check Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * fix(deps): remove setuptools from dependencies (#339) * fix(deps): remove setuptools from dependencies Fixes #338 * chore: remove setuptools from constraints * chore(main): release 2.5.0 (#335) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(deps): update actions/setup-python action to v3 (#346) Source-Link: googleapis/synthtool@571ee2c Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:660abdf857d3ab9aabcd967c163c70e657fcc5653595c709263af5f3fa23ef67 * chore(deps): update all dependencies to v3 (#347) * chore(deps): update all dependencies to v3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: initial support for Extended Operations (#344) Certain APIs with Long-Running Operations deviate from the semantics in https://google.aip.dev/151 and instead define custom operation messages, aka Extended Operations. This change adds a PollingFuture subclass designed to be used with Extended Operations. It is analogous and broadly similar to google.api_core.operation.Operation and subclasses google.api_core.future.polling.PollingFuture. The full description of Extended Operation semantics is beyond the scope of this change. * chore(deps): update actions/checkout action to v3 (#349) Source-Link: googleapis/synthtool@ca87909 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6162c384d685c5fe22521d3f37f6fc732bf99a085f6d47b677dbcae97fc21392 * chore(main): release 2.6.0 (#350) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: Remove py2 tag from wheel (#343) Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore(main): release 2.6.1 (#352) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * feat: expose extra fields in ExtendedOperation (#351) The operation wrapped by ExtendedOperation may define other fields or methods that the user may wish to use. * chore(main): release 2.7.0 (#353) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: add more context to error message. (#340) Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore(main): release 2.7.1 (#354) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: allow grpc without grpcio-status (#355) * chore(python): use black==22.3.0 (#362) * chore(python): use black==22.3.0 Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe * ci: use black 22.3.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#363) Source-Link: googleapis/synthtool@7804ade Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d * chore(python): Enable size-label bot (#364) Source-Link: googleapis/synthtool@06e8279 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore(python): add license header to auto-label.yaml (#365) Source-Link: googleapis/synthtool@eb78c98 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * fix: remove dependency on pkg_resources (#361) Fixes #360 🦕 * chore(main): release 2.7.2 (#358) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(deps): update all dependencies (#367) * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore(python): use ubuntu 22.04 in docs image (#368) Source-Link: googleapis/synthtool@f15cc72 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd * fix: Avoid AttributeError if grpcio-status is not installed (#370) * test: use `not` instead of `is False` in assert (#366) * test: use == instead of is when comparing equality * use not instead of == * test: fix KeyError in test_rest_streaming.py (#373) * chore(main): release 2.7.3 (#371) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore: [autoapprove] update readme_gen.py to include autoescape True (#374) Source-Link: googleapis/synthtool@6b4d5a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore(python): auto approve template changes (#376) Source-Link: googleapis/synthtool@453a5d9 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 * feat: adds support for audience in client_options (#379) feat: adds support for audience in client_options. * chore(main): release 2.8.0 (#381) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix(deps): require protobuf>= 3.15.0, <4.0.0dev (#385) Also adds upper limits for extras. fix(deps): require googleapis-common-protos >= 1.56.2 * chore(main): release 2.8.1 (#386) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore: allow releases from older version branches (#388) * chore: allow releases from older version branches * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * docs: fix changelog header to consistent size (#394) * docs: Fix typo in the BackgroundConsumer docstring (#395) `UNAVAILABLE` instead of `UNVAILABLE` Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-api-core/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕 * chore: test minimum dependencies in python 3.7 (#397) * chore: test minimum dependencies in python 3.7 * remove duplicate entry * fix: drop support for grpc-gcp (#401) * fix(deps): allow protobuf < 5.0.0 (#400) * chore(main): release 2.8.2 (#396) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: require python 3.7+ (#410) * chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * require python 3.7+ in setup.py * remove python 3.6 sample configs * exclude templated README * remove python 3.6 from noxfile * remove python 3.6 from remaining files * remove testing/constraints-3.6.txt Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore(deps): update actions/setup-python action to v4 (#419) * chore(deps): update actions/setup-python action to v4 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * doc: Update gcloud command for ADC (#406) ADC login command for gcloud is `gcloud auth application-default auth login` Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore: remove 'pip install' statements from python_library templates [autoapprove] (#424) Source-Link: googleapis/synthtool@1f37ce7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8e84e0e0d71a0d681668461bba02c9e1394c785f31a10ae3470660235b673086 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore(python): exclude path in renovate.json [autoapprove] (#425) Source-Link: googleapis/synthtool@69fabae Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:562802bfac02e012a6ac34eda282f81d06e77326b82a32d7bbb1369ff552b387 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * chore(python): update dependency distlib (#429) Source-Link: googleapis/synthtool@c4dd595 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ce3c1686bc81145c81dd269bd12c4025c6b275b22d14641358827334fddb1d72 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: Make grpc transcode logic work in terms of protobuf python objects (#428) * feat: Make grpc transcode logic work in terms of protobuf python objects (for context: [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L44)) Previously it worked on dictionaries only, but that causes problems. In GAPIC the dictionaries are created through the same logic as JSON (there is no better built-in way), thus applying [protobuf json mapping](https://developers.google.com/protocol-buffers/docs/proto3#json) conversion logic in the process. Unfortunately converting a protobuf object to a dictionary and to JSON, although similar, are not the same thing. Specifically the `Timestamp`, `Duration`, `FieldMask`, `uint64`, `int64`, and `*Value` protobuf messages are converted to strings for JSON (instead of being properly converted to dicts for most of those types, and `int64/uint64` converted to `int` respectively). As a result a rountrip that GAPIC was relying on (protobuf object -> dict -> transcode -> protobuf object) did not work properly. For example, when converted to dictionary, every int64 field would be converted to `string` (because it is what proto-JSON mapping spec requires), but later, when we need to rebuild a message from a transcoded dictionary that would fail with the following error: ``` TypeError: '0' has type str, but expected one of: int ``` Note, `*Rules` thing from proto-plus does not help, becuase the type may happen inside common native protobuf stub messsages (like `google.type.Money`), fields of which are outside of scope of the proto-plus custom conversion logic. Also, this change greatly simplifies the procedure of transcodding, eliminating multiple conversion steps (to and from dictionaries multiple times) making the whole logic significanly more efficient (python gapics are nutoriously known to be slow due to proto-plus stuff, so efficiency is important) and robust (JSON conversion logic does not interfere anymore with pure protobuf objects grpc transcoding) * reformat code using black * reformat code according to flake8 Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore: fix path to requirements.txt in release script [autoapprove] (#430) Source-Link: googleapis/synthtool@fdba3ed Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1f0dbd02745fb7cf255563dab5968345989308544e52b7f460deadd5e78e63b0 * fix: restore support for grpcio-gcp (#418) docs: add a note that grpcio-gcp is only supported in environments with protobuf < 4.x.x docs: raise DeprecationWarning when 'grpcio-gcp' is used fix(deps): require protobuf >= 3.20.1 * chore(main): release 2.9.0 (#422) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(python): update .kokoro/requirements.txt (#431) Source-Link: googleapis/synthtool@703554a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: add 'strict' to flatten_query_params to lower-case bools (#433) * feat: add 'strict' to flatten_query_params to lower-case bools * pylint Co-authored-by: Anthonios Partheniou <partheniou@google.com> * chore(main): release 2.10.0 (#434) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore(python): exclude setup.py in renovate config (#436) Source-Link: googleapis/synthtool@56da63e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7 * enable github actions checks * remove constraints for python 3.8 * ci: fix cover Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Co-authored-by: Tres Seaver <tseaver@palladion.com> Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Lidi Zheng <lidiz@google.com> Co-authored-by: nicain <nicain.seattle@gmail.com> Co-authored-by: Yih-Jen Ku <yihjen.ku@gmail.com> Co-authored-by: Yonatan Getahun <yonmg@google.com> Co-authored-by: Ken Bandes <kbandes@comcast.net> Co-authored-by: Kenneth Bandes <kbandes@google.com> Co-authored-by: Jeffrey Rennie <rennie@google.com> Co-authored-by: Aza Tulepbergenov <aza.tulepber@gmail.com> Co-authored-by: Aza Tulepbergenov <atulep@google.com> Co-authored-by: Chris Wilson <46912004+sushicw@users.noreply.github.com> Co-authored-by: Tianzi Cai <tianzi@google.com> Co-authored-by: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Co-authored-by: WhiteSource Renovate <bot@renovateapp.com> Co-authored-by: Dov Shlachter <dovs@google.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Dorian Kind <dorian.kind@webrepublic.com> Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com> Co-authored-by: sai-sunder-s <4540365+sai-sunder-s@users.noreply.github.com> Co-authored-by: Vadym Matsishevskyi <25311427+vam-google@users.noreply.github.com> Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
- Loading branch information