@@ -89,13 +89,14 @@ def __new__(cls, value, doc=None):
8989 HTTPS = "https" , "Remote https path, assumes everything packed in one zip file."
9090 S3 = "s3" , "Remote s3 path, assumes everything packed in one zip file."
9191 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."
9293 FILE = "file" , "File storage path, assumes everything packed in one zip file."
9394
9495 @classmethod
9596 def remote_protocols (cls ):
9697 # Returns a list of protocols that support remote storage
9798 # 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 ]
99100
100101
101102def _xor_bytes (left : bytes , right : bytes ) -> bytes :
@@ -719,6 +720,16 @@ async def download_and_unpack_package(
719720 "to fetch URIs in Google Cloud Storage bucket."
720721 + install_warning
721722 )
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+ )
722733 elif protocol == Protocol .FILE :
723734 pkg_uri = pkg_uri [len ("file://" ) :]
724735
0 commit comments