-
Notifications
You must be signed in to change notification settings - Fork 72
feat: check Python and dependency versions in generated GAPICs #2419
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
base: main
Are you sure you want to change the base?
Conversation
Both the package dependency and the Python run-time checks depend on googleapis/python-api-core#832 |
The preferred method is still to sue the code in api_core, but we have a (repetitive) fallback in case users haven't installed the new version that implements that functionality.
return parse_version(version_string) | ||
|
||
try: | ||
_dependency_package = "google.protobuf" |
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.
Is this the correct package name? It falls through to the except
clause for me when I run the integration tests. Do I need to create a real GAPIC to test this properly?
This PR will now do basic checks even if There are still some presubmit failures that I will continue investigating. |
Add a check to generated GAPICs to emit the appropriate usage warnings (most prominently, deprecation messages) for unsupported Python runtime versions and dependency versions.
The intent is that before we stop allowing some old versions of a package dependency, we'll have at least one release that adds a warning saying those versions of the dependency are deprecated, before we actually disallow those versions of the dependency in future versions of the GAPICs.
For Python run-times, once we depend on
google.api_core
after the run-time checks have been implemented (in googleapis/python-api-core#832), these usage/deprecation warnings will be automatic. All we need to do is update the dates for (future) Python versions hard-coded therein.