@@ -89,13 +89,14 @@ def __new__(cls, value, doc=None):
89
89
HTTPS = "https" , "Remote https path, assumes everything packed in one zip file."
90
90
S3 = "s3" , "Remote s3 path, assumes everything packed in one zip file."
91
91
GS = "gs" , "Remote google storage path, assumes everything packed in one zip file."
92
+ OBS = "obs" , "Remote huawei obs path, assumes everything packed in one zip file."
92
93
FILE = "file" , "File storage path, assumes everything packed in one zip file."
93
94
94
95
@classmethod
95
96
def remote_protocols (cls ):
96
97
# Returns a list of protocols that support remote storage
97
98
# These protocols should only be used with paths that end in ".zip" or ".whl"
98
- return [cls .HTTPS , cls .S3 , cls .GS , cls .FILE ]
99
+ return [cls .HTTPS , cls .S3 , cls .GS , cls .FILE , cls . OBS ]
99
100
100
101
101
102
def _xor_bytes (left : bytes , right : bytes ) -> bytes :
@@ -719,6 +720,16 @@ async def download_and_unpack_package(
719
720
"to fetch URIs in Google Cloud Storage bucket."
720
721
+ install_warning
721
722
)
723
+ elif protocol == Protocol .OBS :
724
+ try :
725
+ from obs import ObsClient # noqa: F401
726
+ from smart_open import open as open_file
727
+ except ImportError :
728
+ raise ImportError (
729
+ "You must `pip install smart_open` and "
730
+ "`pip install esdk-obs-python` to fetch URIs in obs "
731
+ "bucket. " + install_warning
732
+ )
722
733
elif protocol == Protocol .FILE :
723
734
pkg_uri = pkg_uri [len ("file://" ) :]
724
735
0 commit comments