ap-client 0.6.1.dev8__tar.gz → 0.6.1.dev10__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.
Files changed (26) hide show
  1. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/PKG-INFO +3 -3
  2. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/dataset_commands.py +5 -4
  3. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/dataset_name.py +3 -3
  4. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/dataset_register.py +4 -3
  5. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/irepo_sdk.py +39 -1
  6. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/ossutil_io.py +8 -1
  7. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/pyproject.toml +3 -3
  8. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/__init__.py +0 -0
  9. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/akpool_commands.py +0 -0
  10. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/api.py +0 -0
  11. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/cli.py +0 -0
  12. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/config.py +0 -0
  13. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/dfs_commands.py +0 -0
  14. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/exporter.py +0 -0
  15. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/fs_commands.py +0 -0
  16. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/instance_commands.py +0 -0
  17. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/instance_options.py +0 -0
  18. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/managed_ak.py +0 -0
  19. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/manifest_view.py +0 -0
  20. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/ossutil_hash.py +0 -0
  21. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/profile_commands.py +0 -0
  22. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/repo_read_guard.py +0 -0
  23. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/share_api.py +0 -0
  24. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/split_publish.py +0 -0
  25. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/tbb.py +0 -0
  26. {ap_client-0.6.1.dev8 → ap_client-0.6.1.dev10}/ap_client/waiter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ap-client
3
- Version: 0.6.1.dev8
3
+ Version: 0.6.1.dev10
4
4
  Summary: Agent Platform API Client & CLI
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: irepo-artifact==0.2.2
@@ -10,9 +10,9 @@ Requires-Dist: rich>=13.0.0
10
10
  Requires-Dist: typer>=0.9.0
11
11
  Requires-Dist: websockets>=13.0
12
12
  Provides-Extra: all
13
- Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.0; extra == 'all'
13
+ Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.1.dev0; extra == 'all'
14
14
  Provides-Extra: dataset
15
- Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.0; extra == 'dataset'
15
+ Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.1.dev0; extra == 'dataset'
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  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.
@@ -1286,7 +1286,8 @@ def dataset_get(
1286
1286
 
1287
1287
  def dataset_create(
1288
1288
  dataset: str = typer.Argument(
1289
- ..., help="Dataset name: L1 or L1/L2 (e.g. my-bench or alibaba/my-bench)"
1289
+ ..., help="Dataset name: L1, L1/L2, or a deeper path "
1290
+ "(e.g. my-bench, alibaba/my-bench, or gdpval/synthetic/my-bench)"
1290
1291
  ),
1291
1292
  benchmark: str = typer.Option(..., "--benchmark", help="Benchmark name or source_id"),
1292
1293
  description: Optional[str] = typer.Option(None, "--description", help="Dataset description"),
@@ -1323,9 +1324,9 @@ def dataset_create(
1323
1324
  ) from exc
1324
1325
  except DatasetNameError:
1325
1326
  raise _fail(
1326
- f"Failed to create dataset {dataset}: the name must be one segment (L1) "
1327
- "or two segments (L1/L2)",
1328
- "e.g. my-bench or your-team/my-bench",
1327
+ f"Failed to create dataset {dataset}: the name must be one or more "
1328
+ "canonical path segments",
1329
+ "e.g. my-bench, your-team/my-bench, or gdpval/synthetic/my-bench",
1329
1330
  exit_code=2,
1330
1331
  )
1331
1332
  series = DatasetSeries(
@@ -1,9 +1,9 @@
1
1
  """DatasetName 解析 Adapter:唯一入口委托给已安装的 InstanceRepo SDK。
2
2
 
3
3
  AP CLI 不维护第三套 dataset 名解析:``instance_repo.paths.DatasetName`` 是客户端
4
- 路径契约的唯一事实源(L1 单段 ``A`` / 两段 ``A/B``,与 apiserver 的 namespace
5
- guard 及 conformance 契约对齐)。SDK 缺失或过旧(没有 ``DatasetName.parse``
6
- 能力)时,给出明确的升级提示,不静默降级、不本地重写解析规则。
4
+ 路径契约的唯一事实源(单段 ``A`` / 两段 ``A/B`` / 多段树形 ``A/B/C``,与
5
+ apiserver 的 namespace guard 及 conformance 契约对齐)。SDK 缺失或过旧(没有
6
+ ``DatasetName.parse`` 能力)时,给出明确的升级提示,不静默降级、不本地重写解析规则。
7
7
  """
8
8
 
9
9
  from __future__ import annotations
@@ -119,9 +119,10 @@ def _create_owned_dataset(repo: Any, dataset: str, benchmark_id: str) -> dict:
119
119
  ) from exc
120
120
  except DatasetNameError:
121
121
  raise datasets._fail(
122
- f"Failed to create dataset {dataset}: the name must be one segment (L1) "
123
- "or two segments (L1/L2)",
124
- "Use a dataset name such as my-bench or your-team/my-bench",
122
+ f"Failed to create dataset {dataset}: the name must be one or more "
123
+ "canonical path segments",
124
+ "Use a dataset name such as my-bench, your-team/my-bench, "
125
+ "or gdpval/synthetic/my-bench",
125
126
  exit_code=2,
126
127
  )
127
128
 
@@ -955,7 +955,9 @@ def load_repo(
955
955
  _Transport = None
956
956
  if _Transport is not None:
957
957
  kwargs["transport"] = _Transport(
958
- cfg.base_url, cfg.token_key or "", env=api_env,
958
+ cfg.base_url,
959
+ cfg.token_key or "",
960
+ env=api_env,
959
961
  timeout=request_timeout,
960
962
  )
961
963
 
@@ -968,9 +970,45 @@ def load_repo(
968
970
  repo = _Repo(**kwargs)
969
971
  _bind_dataset_profile(repo)
970
972
  _install_oss_probe_cache(repo, verbose=cfg.verbose)
973
+ _install_user_data_directory_listing(repo)
971
974
  return repo
972
975
 
973
976
 
977
+ def _install_user_data_directory_listing(repo: Any) -> bool:
978
+ """Keep the directory boundary lost by instance-repo 1.4.0 list_user_data.
979
+
980
+ Use the SDK's path validation and content store so STS authorization,
981
+ endpoint selection and pagination retain their normal behavior. Normalize
982
+ here until the SDK dependency includes its directory-prefix fix.
983
+ """
984
+ content = getattr(repo, "_content", None)
985
+ prefix_for = getattr(repo, "_user_data_prefix", None)
986
+ clean = getattr(repo, "_clean_user_data_subpath", None)
987
+ if not all(
988
+ callable(fn)
989
+ for fn in (
990
+ getattr(repo, "list_user_data", None),
991
+ prefix_for,
992
+ clean,
993
+ getattr(content, "list_objects", None),
994
+ )
995
+ ):
996
+ return False
997
+
998
+ def list_user_data(uid: str, subpath: str = "") -> list[str]:
999
+ from instance_repo.errors import SchemaError
1000
+
1001
+ if not str(uid).strip():
1002
+ raise SchemaError("uid must not be empty")
1003
+ prefix = prefix_for(uid)
1004
+ if str(subpath).strip():
1005
+ prefix += clean(subpath) + "/"
1006
+ return content.list_objects(prefix)
1007
+
1008
+ repo.list_user_data = list_user_data
1009
+ return True
1010
+
1011
+
974
1012
  def _bind_dataset_profile(repo: Any) -> None:
975
1013
  """Supply the configured context missing from SDK 1.3.5 dataset discovery.
976
1014
 
@@ -1108,7 +1108,14 @@ class OssFiles:
1108
1108
  _close_result(result)
1109
1109
 
1110
1110
  def mkdir(self, remote: RemotePath) -> dict:
1111
- """Create only a zero-byte directory marker, atomically without overwrite."""
1111
+ """Create a zero-byte directory marker; no-overwrite is best-effort.
1112
+
1113
+ - 未版本化桶:forbid-overwrite 由 OSS 强制执行,HEAD→PUT 原子拒绝并发
1114
+ 非空 marker(FileAlreadyExists 时回退幂等检查);
1115
+ - 版本化/版本状态未知的桶:OSS 忽略 forbid-overwrite,并发写入的非空
1116
+ marker 可能被本操作的新空版本遮蔽(旧内容仍作为历史版本保留)。
1117
+ 这是版本化语义下的已知局限——mkdir 用于目录占位,不保证跨版本强一致。
1118
+ """
1112
1119
  from .ossutil_hash import _close_result
1113
1120
 
1114
1121
  if (
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ap-client"
7
- version = "0.6.1.dev8"
7
+ version = "0.6.1.dev10"
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"
@@ -19,10 +19,10 @@ dependencies = [
19
19
 
20
20
  [project.optional-dependencies]
21
21
  dataset = [
22
- "instance-repo[oss]>=1.4.0,<2.0.0",
22
+ "instance-repo[oss]>=1.4.1.dev0,<2.0.0",
23
23
  ]
24
24
  all = [
25
- "instance-repo[oss]>=1.4.0,<2.0.0",
25
+ "instance-repo[oss]>=1.4.1.dev0,<2.0.0",
26
26
  ]
27
27
 
28
28
  [project.scripts]