We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7b7da28 + 05127ca commit 493e7feCopy full SHA for 493e7fe
1 file changed
bids2table/_pathlib.py
@@ -1,13 +1,20 @@
1
from pathlib import Path
2
3
try:
4
- from cloudpathlib import AnyPath, CloudPath, GSClient, S3Client
+ from cloudpathlib import AnyPath, CloudPath, S3Client
5
6
_CLOUDPATHLIB_AVAILABLE = True
7
-
8
- # Set default clients for cloud paths
9
S3Client(no_sign_request=True).set_as_default_client()
10
- GSClient().set_as_default_client()
+
+ # Necessary while s3 dependencies can be installed without gcs dependencies
+ try:
11
+ from cloudpathlib import GSClient
12
13
+ GSClient().set_as_default_client()
14
+ # Using generalized Exception here, as DefaultCredentialsError is not available for
15
+ # import if GSClient is not available
16
+ except Exception:
17
+ pass
18
19
except ImportError:
20
AnyPath = CloudPath = Path
0 commit comments