Skip to content

Commit

Permalink
no need to change
Browse files Browse the repository at this point in the history
  • Loading branch information
msmitherdc committed Nov 1, 2023
1 parent e7b4338 commit 15ec0a2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions cloudpathlib/azure/azblobclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _list_dir(
)

yield from (
(self.CloudPath(f"azure://{c.name}"), True)
(self.CloudPath(f"az://{c.name}"), True)
for c in self.service_client.list_containers()
)
return
Expand All @@ -194,7 +194,7 @@ def _list_dir(
continue

yield (
self.CloudPath(f"azure://{cloud_path.container}/{prefix}{parent}"),
self.CloudPath(f"az://{cloud_path.container}/{prefix}{parent}"),
True, # is a directory
)
yielded_dirs.add(parent)
Expand All @@ -203,7 +203,7 @@ def _list_dir(
if not recursive and "/" in o.name[len(prefix) :]:
continue

yield (self.CloudPath(f"azure://{cloud_path.container}/{o.name}"), False) # is a file
yield (self.CloudPath(f"az://{cloud_path.container}/{o.name}"), False) # is a file

def _move_file(
self, src: AzureBlobPath, dst: AzureBlobPath, remove_src: bool = True
Expand Down
2 changes: 1 addition & 1 deletion cloudpathlib/azure/azblobpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AzureBlobPath(CloudPath):
is used. See `AzureBlobClient`'s documentation for more details.
"""

cloud_prefix: str = "azure://"
cloud_prefix: str = "az://"
client: "AzureBlobClient"

@property
Expand Down
2 changes: 1 addition & 1 deletion cloudpathlib/local/implementations/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LocalAzureBlobPath(LocalPath):
substitute when writing tests.
"""

cloud_prefix: str = "azure://"
cloud_prefix: str = "az://"
_cloud_meta = local_azure_blob_implementation

@property
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/script/why_cloudpathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

from cloudpathlib import AzureBlobPath

azp = AzureBlobPath("azure://cloudpathlib-test-container/file.txt")
azp = AzureBlobPath("az://cloudpathlib-test-container/file.txt")
azp.name


Expand Down Expand Up @@ -149,7 +149,7 @@
from cloudpathlib import CloudPath

# Changing this root path is the ONLY change!
cloud_directory = CloudPath("azure://cloudpathlib-test-container/why_cloudpathlib/")
cloud_directory = CloudPath("az://cloudpathlib-test-container/why_cloudpathlib/")

upload = cloud_directory / "user_upload.txt"
upload.write_text("A user made this file!")
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/why_cloudpathlib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"source": [
"from cloudpathlib import AzureBlobPath\n",
"\n",
"azp = AzureBlobPath(\"azure://cloudpathlib-test-container/file.txt\")\n",
"azp = AzureBlobPath(\"az://cloudpathlib-test-container/file.txt\")\n",
"azp.name"
]
},
Expand Down Expand Up @@ -480,7 +480,7 @@
{
"data": {
"text/plain": [
"[AzureBlobPath('azure://cloudpathlib-test-container/file.txt')]"
"[AzureBlobPath('az://cloudpathlib-test-container/file.txt')]"
]
},
"execution_count": 19,
Expand Down Expand Up @@ -564,7 +564,7 @@
"from cloudpathlib import CloudPath\n",
"\n",
"# Changing this root path is the ONLY change!\n",
"cloud_directory = CloudPath(\"azure://cloudpathlib-test-container/why_cloudpathlib/\")\n",
"cloud_directory = CloudPath(\"az://cloudpathlib-test-container/why_cloudpathlib/\")\n",
"\n",
"upload = cloud_directory / \"user_upload.txt\"\n",
"upload.write_text(\"A user made this file!\")\n",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ requires-python = ">=3.7"
dependencies = [
"importlib_metadata ; python_version < '3.8'",
"typing_extensions>4 ; python_version < '3.11'",
"smart_open[all] >=6",
"smart_open >=6",
]

[project.optional-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_azure_specific.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def test_azureblobpath_properties(path_class, monkeypatch):
if not os.getenv("AZURE_STORAGE_CONNECTION_STRING"):
monkeypatch.setenv("AZURE_STORAGE_CONNECTION_STRING", "AccountName=fake;AccountKey=fake2;")

p = path_class("azure://mycontainer")
p = path_class("az://mycontainer")
assert p.blob == ""
assert p.container == "mycontainer"

p2 = path_class("azure://mycontainer/")
p2 = path_class("az://mycontainer/")
assert p2.blob == ""
assert p2.container == "mycontainer"

Expand Down
8 changes: 4 additions & 4 deletions tests/test_cloudpath_instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
@pytest.mark.parametrize(
"path_class, cloud_path",
[
(AzureBlobPath, "azure://b/k"),
(AzureBlobPath, "azure://b/k"),
(AzureBlobPath, "azure://b/k"),
(AzureBlobPath, "azure://b/k"),
(AzureBlobPath, "az://b/k"),
(AzureBlobPath, "az://b/k"),
(AzureBlobPath, "az://b/k"),
(AzureBlobPath, "az://b/k"),
(S3Path, "s3://b/k"),
(S3Path, "S3://b/k"),
(GSPath, "gs://b/k"),
Expand Down

0 comments on commit 15ec0a2

Please sign in to comment.