google-cloud-python
google-cloud-python copied to clipboard
Add `__version__` to retrieve the library version at runtime in all packages
It's possible to query the client library version at runtime using __version__ for most packages, however __version__ is not available in all packages.
As an example, the following works for google-cloud-access-approval
> import google.cloud.accessapproval
> google.cloud.accessapproval.__version__
'1.16.0'
We should add this functionality to the remaining packages along with a unit test.
googleapis-common-protos
> import google.api
> google.api.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'google.api' has no attribute '__version__'
grpc-google-iam-v1
> import google.iam.v1
> google.iam.v1.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'google.iam.v1' has no attribute '__version__'
google-cloud-audit-log
> import google.cloud.audit
> google.cloud.audit.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'google.cloud.audit' has no attribute '__version__'
google-cloud-access-context-manager
> import google.identity.accesscontextmanager.v1
> google.identity.accesscontextmanager.v1.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'google.identity.accesscontextmanager.v1' has no attribute '__version__'