Skip to content

Commit 20b7260

Browse files
authored
fix: harden version data gathering against DistributionNotFound (#212)
1 parent 4f75a75 commit 20b7260

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎google/cloud/firestore_v1/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
"""Python idiomatic client for Google Cloud Firestore."""
2020

21-
from pkg_resources import get_distribution
2221

23-
__version__ = get_distribution("google-cloud-firestore").version
22+
import pkg_resources
23+
24+
try:
25+
__version__ = pkg_resources.get_distribution("google-cloud-firestore").version
26+
except pkg_resources.DistributionNotFound:
27+
__version__ = None
2428

2529
from google.cloud.firestore_v1 import types
2630
from google.cloud.firestore_v1._helpers import GeoPoint

0 commit comments

Comments
 (0)