panpath 0.4.8__tar.gz → 0.4.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {panpath-0.4.8 → panpath-0.4.9}/PKG-INFO +1 -1
- {panpath-0.4.8 → panpath-0.4.9}/panpath/__init__.py +1 -1
- {panpath-0.4.8 → panpath-0.4.9}/panpath/clients.py +1 -1
- {panpath-0.4.8 → panpath-0.4.9}/panpath/gs_async_client.py +9 -2
- {panpath-0.4.8 → panpath-0.4.9}/panpath/gs_client.py +2 -2
- {panpath-0.4.8 → panpath-0.4.9}/panpath/s3_async_client.py +8 -2
- {panpath-0.4.8 → panpath-0.4.9}/panpath/s3_client.py +8 -2
- {panpath-0.4.8 → panpath-0.4.9}/pyproject.toml +1 -1
- {panpath-0.4.8 → panpath-0.4.9}/LICENSE +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/README.md +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/azure_async_client.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/azure_client.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/azure_path.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/base.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/cloud.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/exceptions.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/gs_path.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/local_path.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/py.typed +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/registry.py +0 -0
- {panpath-0.4.8 → panpath-0.4.9}/panpath/s3_path.py +0 -0
|
@@ -192,7 +192,7 @@ class SyncClient(Client, ABC):
|
|
|
192
192
|
raise ValueError(f"Invalid metadata format for: {path}")
|
|
193
193
|
target: Any = meta_dict.get(self.__class__.symlink_target_metaname, None)
|
|
194
194
|
if not target or not isinstance(target, str):
|
|
195
|
-
raise ValueError(f"Not a symlink: {path}")
|
|
195
|
+
raise ValueError(f"Not a symlink: {path!r}")
|
|
196
196
|
|
|
197
197
|
if any(target.startswith(f"{prefix}://") for prefix in self.__class__.prefix):
|
|
198
198
|
return str(target)
|
|
@@ -424,10 +424,17 @@ class AsyncGSClient(AsyncClient):
|
|
|
424
424
|
metadata = await self.get_metadata(path)
|
|
425
425
|
target = metadata.get("metadata", {}).get( # type: ignore[union-attr, call-overload]
|
|
426
426
|
self.__class__.symlink_target_metaname,
|
|
427
|
+
None,
|
|
427
428
|
)
|
|
428
429
|
if not target:
|
|
429
|
-
raise ValueError(f"Not a symlink: {path}")
|
|
430
|
-
|
|
430
|
+
raise ValueError(f"Not a symlink: {path!r}")
|
|
431
|
+
|
|
432
|
+
if any(target.startswith(f"{prefix}://") for prefix in self.__class__.prefix):
|
|
433
|
+
return target # type: ignore[no-any-return]
|
|
434
|
+
|
|
435
|
+
# relative path - construct full path
|
|
436
|
+
path = path.rstrip("/").rsplit("/", 1)[0]
|
|
437
|
+
return f"{path}/{target}"
|
|
431
438
|
|
|
432
439
|
async def symlink_to(self, path: str, target: str) -> None:
|
|
433
440
|
"""Create symlink by storing target in metadata.
|
|
@@ -302,9 +302,9 @@ class GSClient(SyncClient):
|
|
|
302
302
|
Symlink target path
|
|
303
303
|
"""
|
|
304
304
|
metadata = self.get_metadata(path)
|
|
305
|
-
target = metadata.get(self.__class__.symlink_target_metaname)
|
|
305
|
+
target = metadata.get(self.__class__.symlink_target_metaname, None)
|
|
306
306
|
if not target:
|
|
307
|
-
raise ValueError(f"Not a symlink: {path}")
|
|
307
|
+
raise ValueError(f"Not a symlink: {path!r}")
|
|
308
308
|
|
|
309
309
|
if any(target.startswith(f"{prefix}://") for prefix in self.__class__.prefix):
|
|
310
310
|
return target
|
|
@@ -427,8 +427,14 @@ class AsyncS3Client(AsyncClient):
|
|
|
427
427
|
metadata = await self.get_metadata(path)
|
|
428
428
|
target = metadata.get("Metadata", {}).get(self.__class__.symlink_target_metaname)
|
|
429
429
|
if not target:
|
|
430
|
-
raise ValueError(f"Not a symlink: {path}")
|
|
431
|
-
|
|
430
|
+
raise ValueError(f"Not a symlink: {path!r}")
|
|
431
|
+
|
|
432
|
+
if any(target.startswith(f"{p}://") for p in self.prefix):
|
|
433
|
+
return target # type: ignore[no-any-return]
|
|
434
|
+
|
|
435
|
+
# relative path - construct full path
|
|
436
|
+
path = path.rstrip("/").rsplit("/", 1)[0]
|
|
437
|
+
return f"{path}/{target}"
|
|
432
438
|
|
|
433
439
|
async def symlink_to(self, path: str, target: str) -> None:
|
|
434
440
|
"""Create symlink by storing target in metadata.
|
|
@@ -315,8 +315,14 @@ class S3Client(SyncClient):
|
|
|
315
315
|
self.__class__.symlink_target_metaname
|
|
316
316
|
)
|
|
317
317
|
if not target:
|
|
318
|
-
raise ValueError(f"Not a symlink: {path}")
|
|
319
|
-
|
|
318
|
+
raise ValueError(f"Not a symlink: {path!r}")
|
|
319
|
+
|
|
320
|
+
if any(target.startswith(f"{p}://") for p in self.prefix):
|
|
321
|
+
return target # type: ignore[no-any-return]
|
|
322
|
+
|
|
323
|
+
# relative path - construct full path
|
|
324
|
+
path = path.rstrip("/").rsplit("/", 1)[0]
|
|
325
|
+
return f"{path}/{target}"
|
|
320
326
|
|
|
321
327
|
def symlink_to(self, path: str, target: str) -> None:
|
|
322
328
|
"""Create symlink by storing target in metadata.
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "panpath"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.9"
|
|
8
8
|
description = "Universal sync/async local/cloud path library with pathlib-compatible interface"
|
|
9
9
|
authors = ["panpath contributors"]
|
|
10
10
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|