-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix #215: Helper for int and double now work as expected. #216
Conversation
As I noted on #215, I don't believe this change is necessary. Current releases of protobuf do return the (potentially coerced) value from the checker. |
Ah you're right. Didn't realize that. However, after some digging... I'm on Ubuntu 13.10, with the python-protobuf package installed (via apt, not pip) and it returns None :( This makes me think the patch might be a good idea...
|
Ubuntu 13.10 is not an LTS release (12.04 and 14.04 are nearest). That is possibly the reason for out of date packages. UPDATE: 13.10 was EOL'd in July - https://wiki.ubuntu.com/Releases UPDATE (Again): The versions on the LTS releases are:
But at the end of the day, the version in PyPI is up to date, so we need not really worry (other than the version conflict with |
Centos / RHEL 6: python-protobuf-2.3.0 As I noted on #215, looks like we either need to pin our dependency ('protobuf >= 2.6.0') or else apply the patch to handle older protobuf versions. |
I'm inclined to go with pinning the dependency. Using the system Python site library is not the way to run an app on any platform. The question we should ask is: does 2.6 run on RHEL6 etc? With one caveat, we make it very clear what the problem is when an earlier library version is installed. Returning None unexpectedly is the most malicious outcome a piece of Python code can do. Suggest: check library version somewhere in the code and explicitly give an error. |
I'm +1 on pinning the dependency, and +1 on being compatible with the old I have a hunch this will be a really subtle error, and since Google did some weird stuff with the For reference, here's what happens when I try to install the newer version of protobuf (and therefore what will happen if I do
I had to do....
to get things to work.. this is far from a good experience just to get the right version of protobuf on a machine :( |
@jgeewax This dependency is a problem with I brought this up in #91 and also pointed out a thread on their forum. Also, if we are pinning the dependency, then why worry about backwards compatibility? |
@@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val): | |||
elif isinstance(val, float): | |||
name, value = 'double', val | |||
elif isinstance(val, (int, long)): | |||
name, value = 'integer', INT64(val) | |||
check_int64_value(val) # This will raise an exception if invalid. | |||
name, value = 'integer', val |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@dhermes we worry, because setup.py is not the only way to install things. |
This is my current feeling(s) on the matter. @aliafshar How does one control the other ways to install things in a new release? (i.e. some of the broken things are already out there and not easy to pull back in / revise.) |
I've updated setup.py to pin protobuf at 2.5.0 per our discussion on #215. I think this is the best "solution" to the problem given where we are today. |
@@ -7,7 +7,7 @@ | |||
|
|||
from gcloud.datastore.key import Key | |||
|
|||
INT64 = Int64ValueChecker().CheckValue | |||
check_int64_value = Int64ValueChecker().CheckValue |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@aliafshar what other ways do we care about? .deb and .rpm packagers will use the 'install_requires' from setup.py to compute dependencies on the relevant packaged libraries. If we are worrying about developers who have older versions of protobuf installed in their system site-pacakges (e.g., via .deb or .rpm), then ISTM we need to teach them about working in a virtualenv, isolating any cruft in /usr/lib. |
@jgeewax Pinning protobuf at 2.5.0 can't be the right thing: even if we merge your patch, the code still works fine with 2.6.0. |
So how about protobuf >= 2.5.0 ? That way, older Ubuntu versions don't require a newer version (which gives lots of errors while installing) and newer versions are happy. Sound good? |
|
@dhermes I can't replicate that in a clean virtualenv (tox wouldn't be passing, either):
|
I copied and pasted the output of installing on Ubuntu 13.10 (no virtual environment which unfortunately is how many of our users will install this...). I think the best bet is to do |
So the versions in the
So what is happening is that It seems the issue happens in the That is the only hard dependency of the protobuf package: UPDATE: I completely wiped all my installed dependencies on Ubuntu 14.04 and |
See discussion on Issue googleapis#215 for details.
Making our code work with protobuf 2.5 and 2.6 isn't a bad thing IMO. I've updated the path with two things:
Problem solved? |
@@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val): | |||
elif isinstance(val, float): | |||
name, value = 'double', val | |||
elif isinstance(val, (int, long)): | |||
name, value = 'integer', INT64(val) | |||
INT_VALUE_CHECKER.CheckValue(val) # This will raise an exception if invalid. | |||
name, value = 'integer', val |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Yes, it seems in protocolbuffers/protobuf#36 that the install issue will "go away" very shortly so IMO this is enough. LGTM (pending my tiny "typecast" comment). |
#216) 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>
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 414026488 Source-Link: googleapis/googleapis@26ab5dd Source-Link: googleapis/googleapis-gen@d4c1a64 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRjMWE2NDZiNDA1NmU1OThlYmEwMTIxM2FmMzUwYmQ4ZjZhNjk1MiJ9 docs: reformat comments
🤖 I have created a release *beep* *boop* --- ## [1.8.0](googleapis/python-dialogflow-cx@v1.7.0...v1.8.0) (2022-01-14) ### Features * **v3:** added `TelephonyTransferCall` in response message ([#216](googleapis/python-dialogflow-cx#216)) ([76dae8b](googleapis/python-dialogflow-cx@76dae8b)) * **v3:** added the display name of the current page in webhook requests ([#221](googleapis/python-dialogflow-cx#221)) ([aa91b72](googleapis/python-dialogflow-cx@aa91b72)) * **v3:** allow setting custom CA for generic webhooks ([#214](googleapis/python-dialogflow-cx#214)) ([8f3dc03](googleapis/python-dialogflow-cx@8f3dc03)) * **v3beta1:** added `TelephonyTransferCall` in response message ([#217](googleapis/python-dialogflow-cx#217)) ([e24bdfd](googleapis/python-dialogflow-cx@e24bdfd)) * **v3beta1:** added the display name of the current page in webhook requests ([#222](googleapis/python-dialogflow-cx#222)) ([5956179](googleapis/python-dialogflow-cx@5956179)) * **v3:** release CompareVersions API ([8f3dc03](googleapis/python-dialogflow-cx@8f3dc03)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: googleapis/googleapis-gen@61ef576 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: googleapis/googleapis-gen@61ef576 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: googleapis/googleapis-gen@ab0e217 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * fix docs build Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
* chore(deps): update all dependencies to v2.56.0 * revert Co-authored-by: Anthonios Partheniou <[email protected]>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
) Source-Link: googleapis/synthtool@c1dd87e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-storage](https://togithub.com/googleapis/python-storage) | `==1.39.0` -> `==1.40.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.40.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.40.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.40.0/compatibility-slim/1.39.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/1.40.0/confidence-slim/1.39.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/python-storage</summary> ### [`v1.40.0`](https://togithub.com/googleapis/python-storage/blob/master/CHANGELOG.md#​1400-httpswwwgithubcomgoogleapispython-storagecomparev1390v1400-2021-06-30) [Compare Source](https://togithub.com/googleapis/python-storage/compare/v1.39.0...v1.40.0) ##### Features - add preconditions and retry configuration to blob.create_resumable_upload_session ([#​484](https://www.github.com/googleapis/python-storage/issues/484)) ([0ae35ee](https://www.github.com/googleapis/python-storage/commit/0ae35eef0fe82fe60bc095c4b183102bb1dabeeb)) - add public access prevention to bucket IAM configuration ([#​304](https://www.github.com/googleapis/python-storage/issues/304)) ([e3e57a9](https://www.github.com/googleapis/python-storage/commit/e3e57a9c779d6b87852063787f19e27c76b1bb14)) ##### Bug Fixes - replace default retry for upload operations ([#​480](https://www.github.com/googleapis/python-storage/issues/480)) ([c027ccf](https://www.github.com/googleapis/python-storage/commit/c027ccf4279fb05e041754294f10744b7d81beea)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-dataproc).
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@7ff4aad Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244
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> Co-authored-by: Anthonios Partheniou <[email protected]>
* feat: Add support for python 3.11 chore: Update gapic-generator-python to v1.8.0 PiperOrigin-RevId: 500768693 Source-Link: googleapis/googleapis@190b612 Source-Link: googleapis/googleapis-gen@7bf29a4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2JmMjlhNDE0YjllY2FjMzE3MGYwYjY1YmRjMmE5NTcwNWMwZWYxYSJ9 * 🦉 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>
Source-Link: googleapis/synthtool@0941ef3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@f15cc72 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd
Source-Link: googleapis/synthtool@06e8279 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce
Source-Link: googleapis/synthtool@dd05f9d Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore: add aap-dpes to codeowners Removing cicd and adding aap-dpes. * 🦉 Updates from OwlBot 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 <[email protected]>
Source-Link: https://togithub.com/googleapis/synthtool/commit/7197a001ffb6d8ce7b0b9b11c280f0c536c1033a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320
* fix(deps): allow protobuf 3.19.5 * explicitly exclude protobuf 4.21.0
fix(deps): require proto-plus >= 1.22.0
Source-Link: googleapis/synthtool@dd05f9d Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
No description provided.