-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Create a macro utility function to parse the version of dependencies #16302
Description
See this comment from PR googleapis/gapic-generator-python#1999 related to duplication of code to extract the version.
We're using this construct to get the version number of a dependency in other places as well. We should factor it out into a static member function that can be called like this is_version_atleast(api_core_version, (2,19,0))
No need to block this PR, but we should at least file an issue. And come to think of it, we should consider wherever we have version strings, to have the SoT be a tuple like (2, 19, 0, "rc0"). The version string can then be automatically constructed from the tuple, and we would continue to export it. But we would also export the tuple. This would get rid of string splitting/manipulation in various places of the generated code.