-
Notifications
You must be signed in to change notification settings - Fork 168
fix: allow Protobuf 6.x #1445
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: allow Protobuf 6.x #1445
Changes from 25 commits
4bb0dab
af28188
a0a6ce2
bb99680
152811a
1556b66
39b69ab
2a56aef
dbd1ca9
b992241
8bdf699
ad59b2e
d93e5ba
12d899c
4be916a
c7d5000
0f28113
b03754c
0942622
e833fd5
9a490e7
457db16
ec4a428
600d7bc
c326bf5
b6e0d0c
77a3dc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,11 +14,10 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Generated by synthtool. DO NOT EDIT! | ||
|
|
||
| from __future__ import absolute_import | ||
| import os | ||
| import pathlib | ||
| import re | ||
| import shutil | ||
|
|
||
| import nox | ||
|
|
@@ -29,16 +28,27 @@ | |
|
|
||
| DEFAULT_PYTHON_VERSION = "3.8" | ||
| SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] | ||
| UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
| CONFORMANCE_TEST_PYTHON_VERSIONS = ["3.8"] | ||
|
|
||
| _DEFAULT_STORAGE_HOST = "https://storage.googleapis.com" | ||
|
|
||
| CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() | ||
|
|
||
| # Error if a python version is missing | ||
| nox.options.error_on_missing_interpreters = True | ||
|
|
||
| nox.options.sessions = [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC this is setting a list of sessions to run by default (to exclude
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is correct. Also see https://nox.thea.codes/en/stable/tutorial.html#selecting-which-sessions-to-run |
||
| "blacken", | ||
| "conftest_retry", | ||
| "docfx", | ||
| "docs", | ||
| "lint", | ||
| "lint_setup_py", | ||
| "system", | ||
| "unit", | ||
| # cover must be last to avoid error `No data to report` | ||
| "cover", | ||
| ] | ||
|
|
||
|
|
||
| @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| def lint(session): | ||
|
|
@@ -159,8 +169,8 @@ def system(session): | |
| session.install( | ||
| "google-cloud-testutils", | ||
| "google-cloud-iam", | ||
| "google-cloud-pubsub < 2.0.0", | ||
| "google-cloud-kms < 2.0dev", | ||
| "google-cloud-pubsub", | ||
| "google-cloud-kms", | ||
| "brotli", | ||
| "-c", | ||
| constraints_path, | ||
|
|
@@ -300,3 +310,81 @@ def docfx(session): | |
| os.path.join("docs", ""), | ||
| os.path.join("docs", "_build", "html", ""), | ||
| ) | ||
|
|
||
|
|
||
| @nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1]) | ||
| @nox.parametrize( | ||
| "protobuf_implementation", | ||
| ["python", "upb"], | ||
| ) | ||
| def prerelease_deps(session, protobuf_implementation): | ||
| """Run all tests with prerelease versions of dependencies installed.""" | ||
|
|
||
| # Install all test dependencies | ||
| session.install("mock", "pytest", "pytest-cov", "brotli") | ||
|
|
||
| # Install dependencies needed for system tests | ||
| session.install( | ||
| "google-cloud-pubsub", | ||
| "google-cloud-kms", | ||
| "google-cloud-testutils", | ||
| "google-cloud-iam", | ||
| ) | ||
|
|
||
| # Install all dependencies | ||
| session.install("-e", ".[protobuf, tracing]") | ||
|
|
||
| prerel_deps = [ | ||
| "google-api-core", | ||
| "google-auth", | ||
| "google-cloud-core", | ||
| "google-crc32c", | ||
| "google-resumable-media", | ||
| "opentelemetry-api", | ||
| "protobuf", | ||
| ] | ||
|
|
||
| package_namespaces = { | ||
| "google-api-core": "google.api_core", | ||
| "google-auth": "google.auth", | ||
| "google-cloud-core": "google.cloud.version", | ||
| "opentelemetry-api": "opentelemetry.version", | ||
| "protobuf": "google.protobuf", | ||
| } | ||
|
|
||
| for dep in prerel_deps: | ||
| session.install("--pre", "--no-deps", "--upgrade", dep) | ||
| print(f"Installed {dep}") | ||
|
|
||
| version_namespace = package_namespaces.get(dep) | ||
|
|
||
| if version_namespace: | ||
| session.run( | ||
| "python", | ||
| "-c", | ||
| f"import {version_namespace}; print({version_namespace}.__version__)", | ||
| ) | ||
| # Remaining dependencies | ||
| other_deps = [ | ||
| "requests", | ||
| ] | ||
| session.install(*other_deps) | ||
|
|
||
| session.run( | ||
| "py.test", | ||
| "tests/unit", | ||
| env={ | ||
| "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, | ||
| }, | ||
| ) | ||
|
|
||
| session.run( | ||
| "py.test", | ||
| "--verbose", | ||
| f"--junitxml=system_{session.python}_sponge_log.xml", | ||
| os.path.join("tests", "system"), | ||
| *session.posargs, | ||
| env={ | ||
| "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, | ||
| }, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # This constraints file is used to check that lower bounds | ||
| # are correct in setup.py | ||
| # List all library dependencies and extras in this file. | ||
| # Pin the version to the lower bound. | ||
| # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", | ||
| # Then this file should have google-cloud-foo==1.14.0 | ||
| google-auth==2.26.1 | ||
| google-api-core==2.15.0 | ||
| google-cloud-core==2.4.2 | ||
| google-resumable-media==2.7.2 | ||
| requests==2.22.0 | ||
| google-crc32c==1.1.3 | ||
| protobuf==3.20.2 | ||
| opentelemetry-api==1.1.0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we've considered running
prerelease-depsin continuous instead of presubmits. This increases presubmit running time and the extra two runs of the system test suite are more prone to 429 errors and server-side resource overload etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in cl/738167833 and 77a3dc8