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

fix: regenerate pb2 files using the latest version of grpcio-tools #95

Merged
merged 11 commits into from
Mar 22, 2022

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Mar 17, 2022

Fixes #91 🦕
Fixes #94 🦕

BEGIN_COMMIT_OVERRIDE
fix: regenerate pb2 files using the latest version of grpcio-tools

fix(deps): require protobuf >=1.15.0
END_COMMIT_OVERRIDE

@parthea parthea requested a review from a team as a code owner March 17, 2022 21:19
@parthea parthea force-pushed the use-the-latest-version-of-grpcio-tools branch from 972027a to 9aef768 Compare March 17, 2022 21:20
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 17, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 17, 2022
@parthea
Copy link
Contributor Author

parthea commented Mar 17, 2022

I'll check to make sure the Kokoro test fails before adding the commit to require protobuf >=1.15.0

@parthea
Copy link
Contributor Author

parthea commented Mar 17, 2022

The unit-3.6 test didn't fail as I expected. It turns out that this test passes locally but other unit-3.x tests fail.
I updated the constraints files for other python versions to see if I can can re-create the test failure in Kokoro

@parthea
Copy link
Contributor Author

parthea commented Mar 17, 2022

I tested unit-3.6/3.7/3.8/3.9 and only unit-3.9 failed.

nox > Running session unit-3.9
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/unit-3-9
nox > python -m pip install asyncmock pytest-asyncio
nox > python -m pip install mock pytest pytest-cov
nox > python -m pip install -e .
nox > python -m pip install e . -c /tmpfs/src/github/python-api-common-protos/testing/constraints-3.9.txt
nox > py.test --quiet --cov=google/cloud --cov=tests/unit --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=0 tests/unit
F                                                                        [100%]
=================================== FAILURES ===================================
______________________________ test_error_reason _______________________________

    def test_error_reason():
>       from google.api import error_reason_pb2

tests/unit/test_google_api_error_reason.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    """Generated protocol buffer code."""
    from google.protobuf.internal import enum_type_wrapper
    from google.protobuf import descriptor as _descriptor
    from google.protobuf import descriptor_pool as _descriptor_pool
    from google.protobuf import message as _message
    from google.protobuf import reflection as _reflection
    from google.protobuf import symbol_database as _symbol_database

    # @@protoc_insertion_point(imports)

    _sym_db = _symbol_database.Default()


    DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
        b"\n\x1dgoogle/api/error_reason.proto\x12\ngoogle.api*\xc4\x04\n\x0b\x45rrorReason\x12\x1c\n\x18\x45RROR_REASON_UNSPECIFIED\x10\x00\x12\x14\n\x10SERVICE_DISABLED\x10\x01\x12\x14\n\x10\x42ILLING_DISABLED\x10\x02\x12\x13\n\x0f\x41PI_KEY_INVALID\x10\x03\x12\x1b\n\x17\x41PI_KEY_SERVICE_BLOCKED\x10\x04\x12!\n\x1d\x41PI_KEY_HTTP_REFERRER_BLOCKED\x10\x07\x12\x1e\n\x1a\x41PI_KEY_IP_ADDRESS_BLOCKED\x10\x08\x12\x1f\n\x1b\x41PI_KEY_ANDROID_APP_BLOCKED\x10\t\x12\x1b\n\x17\x41PI_KEY_IOS_APP_BLOCKED\x10\r\x12\x17\n\x13RATE_LIMIT_EXCEEDED\x10\x05\x12\x1b\n\x17RESOURCE_QUOTA_EXCEEDED\x10\x06\x12 \n\x1cLOCATION_TAX_POLICY_VIOLATED\x10\n\x12\x17\n\x13USER_PROJECT_DENIED\x10\x0b\x12\x16\n\x12\x43ONSUMER_SUSPENDED\x10\x0c\x12\x14\n\x10\x43ONSUMER_INVALID\x10\x0e\x12\x1c\n\x18SECURITY_POLICY_VIOLATED\x10\x0f\x12\x18\n\x14\x41\x43\x43\x45SS_TOKEN_EXPIRED\x10\x10\x12#\n\x1f\x41\x43\x43\x45SS_TOKEN_SCOPE_INSUFFICIENT\x10\x11\x12\x19\n\x15\x41\x43\x43OUNT_STATE_INVALID\x10\x12\x12!\n\x1d\x41\x43\x43\x45SS_TOKEN_TYPE_UNSUPPORTED\x10\x13\x42p\n\x0e\x63om.google.apiB\x10\x45rrorReasonProtoP\x01ZCgoogle.golang.org/genproto/googleapis/api/error_reason;error_reason\xa2\x02\x04GAPIb\x06proto3"
    )

>   _ERRORREASON = DESCRIPTOR.enum_types_by_name["ErrorReason"]
E   AttributeError: 'NoneType' object has no attribute 'enum_types_by_name'

google/api/error_reason_pb2.py:36: AttributeError

noxfile.py Outdated
@@ -72,6 +72,7 @@ def default(session):
)


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"])
Copy link
Contributor

Choose a reason for hiding this comment

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

This package has no tests, so it instead runs the unit and system tests of client libraries that take a dependency instead.

This session not meant to be directly run as a session. If you look below at test, it calls unit() and system().

noxfile.py Outdated
@@ -55,7 +55,7 @@ def default(session):

# Install googleapis-api-common-protos
# This *must* be the last install command to get the package from source.
session.install("e", "..", "-c", constraints_path)
session.install("e", ".", "-c", constraints_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

With the changes in noxfile.py, I believe the tests are installing googleapis-common-protos from PyPI instead of source.

Note in the log python -m pip install -e . comes after cd python-texttospeech, so . is python-texttospeech, .. is python-api-common-protos.

nox > Session test-3.9(pubsub) was successful.
nox > Running session test-3.9(texttospeech)
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/test-3-9-texttospeech
nox > git -C python-texttospeech pull
Already up to date.
nox > cd python-texttospeech
nox > python -m pip install asyncmock pytest-asyncio
nox > python -m pip install mock pytest pytest-cov
nox > python -m pip install -e . 
nox > python -m pip install e . -c /tmpfs/src/github/python-api-common-protos/testing/constraints-3.9.txt
nox > py.test --quiet --cov=google/cloud --cov=tests/unit --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=0 tests/unit

noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
@parthea parthea requested a review from busunkim96 March 21, 2022 22:00
@parthea parthea merged commit f04ed64 into main Mar 22, 2022
@parthea parthea deleted the use-the-latest-version-of-grpcio-tools branch March 22, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants