ap-client 0.5.3.dev0__tar.gz → 0.5.3.dev2__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.
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/PKG-INFO +1 -1
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/ossutil_io.py +7 -28
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/pyproject.toml +1 -1
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/__init__.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/akpool_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/api.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/cli.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/config.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/dataset_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/dataset_register.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/exporter.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/fs_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/instance_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/irepo_sdk.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/managed_ak.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/manifest_view.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/ossutil_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/profile_commands.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/repo_read_guard.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/share_api.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/split_publish.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/tbb.py +0 -0
- {ap_client-0.5.3.dev0 → ap_client-0.5.3.dev2}/ap_client/waiter.py +0 -0
|
@@ -265,7 +265,6 @@ class OssFiles:
|
|
|
265
265
|
state_dir: Path | None = None,
|
|
266
266
|
):
|
|
267
267
|
self.repo, self.binding = repo, binding
|
|
268
|
-
self._datasets: dict[str, str] = {}
|
|
269
268
|
self.encoding_type = None
|
|
270
269
|
self.payer = None
|
|
271
270
|
self.disable_crc64 = False
|
|
@@ -285,41 +284,18 @@ class OssFiles:
|
|
|
285
284
|
def resolve(self, value: str, **kwargs) -> RemotePath:
|
|
286
285
|
return self.binding.resolve(value, encoding_type=self.encoding_type, **kwargs)
|
|
287
286
|
|
|
288
|
-
def _dataset_for(self, scope: str
|
|
287
|
+
def _dataset_for(self, scope: str) -> str | None:
|
|
289
288
|
if not scope.startswith(self.binding.prefix):
|
|
290
289
|
raise OssUsageError("OSS path is outside repo-config prefix")
|
|
291
|
-
relative = scope[len(self.binding.prefix) :]
|
|
292
|
-
|
|
293
|
-
if not parts:
|
|
294
|
-
raise OssUsageError("Specify a path within a Dataset, for example a/b/")
|
|
295
|
-
candidates = ["/".join(parts[:2]), parts[0]] if len(parts) >= 2 else [parts[0]]
|
|
296
|
-
for name in dict.fromkeys(candidates):
|
|
297
|
-
namespace = self.binding.prefix + name + "/"
|
|
298
|
-
if not scope.startswith(namespace):
|
|
299
|
-
continue
|
|
300
|
-
if name in self._datasets:
|
|
301
|
-
return self._datasets[name]
|
|
302
|
-
try:
|
|
303
|
-
series = self.repo.datasets.get(name, fallback_to_oss=False)
|
|
304
|
-
except Exception as exc:
|
|
305
|
-
if getattr(exc, "biz_code", None) not in (92001, 94021):
|
|
306
|
-
raise
|
|
307
|
-
continue
|
|
308
|
-
if getattr(series, "dataset_name", None) != name:
|
|
309
|
-
raise OssOperationError("Dataset metadata does not match the requested path")
|
|
310
|
-
self._datasets[name] = name
|
|
311
|
-
return name
|
|
312
|
-
if list_only and scope.startswith(self.binding.prefix + candidates[0] + "/"):
|
|
313
|
-
# The server owns discovery authorization for an unregistered namespace.
|
|
314
|
-
return candidates[0]
|
|
315
|
-
raise OssUsageError("OSS path does not identify a registered Dataset")
|
|
290
|
+
relative = scope[len(self.binding.prefix) :].rstrip("/")
|
|
291
|
+
return "/".join(relative.split("/")[:2]) if relative else None
|
|
316
292
|
|
|
317
293
|
def _credentials(self, scope: str, permission: str, list_only: bool) -> dict:
|
|
318
294
|
cred = dict(
|
|
319
295
|
self.repo.transport.get_oss_credentials(
|
|
320
296
|
self.binding.bucket,
|
|
321
297
|
scope,
|
|
322
|
-
dataset_name=self._dataset_for(scope
|
|
298
|
+
dataset_name=self._dataset_for(scope),
|
|
323
299
|
permission=permission,
|
|
324
300
|
list_only=list_only,
|
|
325
301
|
)
|
|
@@ -445,6 +421,9 @@ class OssFiles:
|
|
|
445
421
|
include: tuple[str, ...] = (),
|
|
446
422
|
exclude: tuple[str, ...] = (),
|
|
447
423
|
) -> dict:
|
|
424
|
+
# A Dataset root is a directory even when the user omits its trailing slash.
|
|
425
|
+
if remote.path and not remote.path.endswith("/") and len(remote.path.split("/")) == 2:
|
|
426
|
+
remote = self.binding.resolve(remote.path, directory=True)
|
|
448
427
|
if marker:
|
|
449
428
|
marker = self.resolve(marker, prefix=True).key
|
|
450
429
|
if not marker.startswith(remote.key):
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ap-client"
|
|
7
|
-
version = "0.5.3.
|
|
7
|
+
version = "0.5.3.dev2"
|
|
8
8
|
description = "Agent Platform API Client & CLI"
|
|
9
9
|
readme = { text = "A lightweight Python SDK and command line interface for Agent Platform. It provides helpers for configuring API access and managing templates, datasets, jobs, and groups.", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.10"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|