Skip to content

Conversation

vchudnov-g
Copy link
Contributor

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.

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jul 30, 2025
@vchudnov-g
Copy link
Contributor Author

Both the package dependency and the Python run-time checks depend on googleapis/python-api-core#832

@product-auto-label product-auto-label bot added size: m Pull request size is medium. size: l Pull request size is large. and removed size: s Pull request size is small. size: m Pull request size is medium. labels Jul 31, 2025
return parse_version(version_string)

try:
_dependency_package = "google.protobuf"
Copy link
Contributor Author

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?

@vchudnov-g
Copy link
Contributor Author

This PR will now do basic checks even if api_core is not updated, so it is no longer dependent on googleapis/python-api-core#832.

There are still some presubmit failures that I will continue investigating.

@vchudnov-g vchudnov-g marked this pull request as ready for review August 1, 2025 04:35
@vchudnov-g vchudnov-g requested a review from a team as a code owner August 1, 2025 04:35
@parthea parthea assigned vchudnov-g and unassigned parthea Aug 28, 2025
@vchudnov-g vchudnov-g force-pushed the python-version-support-check branch from bfd6f29 to dce9bdf Compare August 28, 2025 20:34
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.

2 participants