Content-Length: 218548 | pFad | http://github.com/googleapis/google-cloud-python/issues/13643

51 Add `__version__` to retrieve the library version at runtime in all packages · Issue #13643 · googleapis/google-cloud-python · GitHub
Skip to content

Add __version__ to retrieve the library version at runtime in all packages #13643

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

Open
parthea opened this issue Mar 11, 2025 · 0 comments
Open
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@parthea
Copy link
Contributor

parthea commented Mar 11, 2025

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__'
@parthea parthea added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/issues/13643

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy