Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: merge main branch into v1 #438

Merged
merged 113 commits into from
Sep 6, 2022
Merged

feat: merge main branch into v1 #438

merged 113 commits into from
Sep 6, 2022

Conversation

parthea
Copy link
Collaborator

@parthea parthea commented Sep 6, 2022

For google-api-core we did not make breaking changes in the main branch beyond removing support for 2.7. This PR ports all of the features from the main branch into the v1 branch.

busunkim96 and others added 30 commits August 3, 2021 11:47
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.
Source-Link: googleapis/synthtool@7e1f6da
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d
Rely on the pins in 'setup.py' as the Source of Truth.

See #234 (review)
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>
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: Tres Seaver <tseaver@palladion.com>
chore: removing owlbot directives for conversion to main
* 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>
…275)

Co-authored-by: Kenneth Bandes <kbandes@google.com>
chore: relocate owl bot post processor
…282)

* chore: add default_version and codeowner_team to .repo-metadata.json

* Assign @googleapis/actools-python as codeowner
…le (#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>
Fix new deprecation warning for 'threading.Condition.notifyAll'.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
gcf-owl-bot bot and others added 15 commits August 9, 2022 21:44
* 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

* 🦉 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>
ADC login command for gcloud is `gcloud auth application-default auth login`

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
…[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>
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>
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>
…cts (#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>
…430)

Source-Link: googleapis/synthtool@fdba3ed
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1f0dbd02745fb7cf255563dab5968345989308544e52b7f460deadd5e78e63b0
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
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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

* pylint

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@56da63e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Sep 6, 2022
@google-cla
Copy link

google-cla bot commented Sep 6, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@parthea
Copy link
Collaborator Author

parthea commented Sep 6, 2022

It should be ok to ignore the CLA in this case, as these commits were already merged in main.

@parthea parthea marked this pull request as ready for review September 6, 2022 14:54
@parthea parthea requested review from a team as code owners September 6, 2022 14:54
Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@parthea parthea merged commit a175ce5 into v1 Sep 6, 2022
@parthea parthea deleted the merge-main branch September 6, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.