ap-client 0.8.0.dev0__tar.gz → 0.8.0.dev3__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.8.0.dev0 → ap_client-0.8.0.dev3}/PKG-INFO +3 -3
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/dataset_commands.py +41 -344
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/instance_commands.py +17 -35
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/irepo_sdk.py +0 -57
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/repo_read_guard.py +26 -14
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/pyproject.toml +3 -3
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/__init__.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/akpool_commands.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/api.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/cli.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/config.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/dataset_name.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/dataset_register.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/dfs_commands.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/exporter.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/fs_commands.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/fs_storage.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/fs_transfer.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/instance_options.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/managed_ak.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/manifest_view.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/ossutil_hash.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/ossutil_io.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_cascade_all.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_cascade_cli.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_cascade_display.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_cascade_state.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_commands.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_diagnostics.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_display.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/profile_references.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/share_api.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/split_publish.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/submission_metadata.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/tbb.py +0 -0
- {ap_client-0.8.0.dev0 → ap_client-0.8.0.dev3}/ap_client/waiter.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ap-client
|
|
3
|
-
Version: 0.8.0.
|
|
3
|
+
Version: 0.8.0.dev3
|
|
4
4
|
Summary: Agent Platform API Client & CLI
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: irepo-artifact==0.2.6
|
|
@@ -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.
|
|
13
|
+
Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.6; extra == 'all'
|
|
14
14
|
Provides-Extra: dataset
|
|
15
|
-
Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.
|
|
15
|
+
Requires-Dist: instance-repo[oss]<2.0.0,>=1.4.6; 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.
|
|
@@ -634,27 +634,19 @@ def _fetch_version(
|
|
|
634
634
|
_SPLIT_PAGE_SIZE = 200
|
|
635
635
|
|
|
636
636
|
|
|
637
|
-
def
|
|
638
|
-
dataset: str, *, stage: str, environment: Optional[str] = None
|
|
639
|
-
) -> list[dict]:
|
|
640
|
-
"""读**无版本空间**的 split(split_first)——走 SDK ``repo.splits``(recordsvc)。
|
|
641
|
-
|
|
642
|
-
为什么不能像有版本时那样读 ``versions.get`` + 内嵌 ``splits[]``:``GET/PATCH
|
|
643
|
-
/datasets/versions/detail`` **必须**带非空 version(apiserver 400 92005
|
|
644
|
-
"version is required",SDK 也在客户端前置拒绝),无版本空间表达不出来。真正承载它的是
|
|
645
|
-
recordsvc 的 ``/datasets/splits``(``version_scope=unversioned``)。
|
|
646
|
-
"""
|
|
637
|
+
def _split_list(dataset: str, version: str, environment: Optional[str]) -> list[dict]:
|
|
647
638
|
from .irepo_sdk import _reason
|
|
648
639
|
|
|
649
640
|
env = _environment(environment)
|
|
650
641
|
repo = _dataset_repo()
|
|
642
|
+
scope = {"version": version} if version else {"version_scope": "unversioned"}
|
|
651
643
|
try:
|
|
652
644
|
records: list[dict] = []
|
|
653
645
|
page = 1
|
|
654
646
|
while True:
|
|
655
647
|
result = repo.splits.list(
|
|
656
648
|
dataset,
|
|
657
|
-
|
|
649
|
+
**scope,
|
|
658
650
|
page_size=_SPLIT_PAGE_SIZE,
|
|
659
651
|
**({"page": page} if page > 1 else {}),
|
|
660
652
|
**_read_env_kwargs(repo, repo.splits, "list", env),
|
|
@@ -662,70 +654,32 @@ def _unversioned_splits(
|
|
|
662
654
|
items = getattr(result, "items", None) or []
|
|
663
655
|
for item in items:
|
|
664
656
|
record = _model_dict(item)
|
|
665
|
-
if
|
|
657
|
+
if _version_value(record.get("version")) == version:
|
|
666
658
|
records.append(record)
|
|
667
659
|
if not items or getattr(result, "has_more", False) is not True:
|
|
668
|
-
|
|
660
|
+
return records
|
|
669
661
|
page += 1
|
|
670
|
-
except Exception as exc: # noqa: BLE001 - 统一走设计 §5.1 的映射
|
|
671
|
-
raise _fail(
|
|
672
|
-
f"dataset {dataset} (no version space): {stage} failed: {_reason(exc)}",
|
|
673
|
-
f"Check the dataset name and permission: ap dataset get {dataset}",
|
|
674
|
-
) from exc
|
|
675
|
-
return records
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
def _unversioned_split(
|
|
679
|
-
dataset: str, split: str, *, environment: Optional[str] = None
|
|
680
|
-
) -> Optional[dict]:
|
|
681
|
-
"""取无版本空间里的单个 split 记录;不存在返回 ``None``(不当作错误)。"""
|
|
682
|
-
from .irepo_sdk import _reason
|
|
683
|
-
|
|
684
|
-
env = _environment(environment)
|
|
685
|
-
repo = _dataset_repo()
|
|
686
|
-
try:
|
|
687
|
-
record = repo.splits.get(dataset, split, **_read_env_kwargs(repo, repo.splits, "get", env))
|
|
688
662
|
except Exception as exc: # noqa: BLE001
|
|
689
663
|
raise _fail(
|
|
690
|
-
f"dataset {dataset} (
|
|
664
|
+
f"dataset {dataset} version {_version_label(version)}: split query failed: {_reason(exc)}",
|
|
691
665
|
f"Check the dataset name and permission: ap dataset get {dataset}",
|
|
692
666
|
) from exc
|
|
693
|
-
detail = _model_dict(record) if record is not None else None
|
|
694
|
-
return detail if detail is not None and not _version_value(detail.get("version")) else None
|
|
695
667
|
|
|
696
668
|
|
|
697
|
-
def
|
|
698
|
-
dataset: str,
|
|
699
|
-
version: str,
|
|
700
|
-
split: str,
|
|
701
|
-
*,
|
|
702
|
-
environment: Optional[str] = None,
|
|
703
|
-
oss_fallback: bool = True,
|
|
669
|
+
def _split_get(
|
|
670
|
+
dataset: str, version: str, split: str, environment: Optional[str]
|
|
704
671
|
) -> Optional[dict]:
|
|
705
|
-
"""取指定 version 里的单个 split 记录;不存在返回 ``None``(不当作错误)。
|
|
706
|
-
|
|
707
|
-
与 ``_unversioned_split`` 同源,走 recordsvc 的 ``splits.get``(SDK 自带
|
|
708
|
-
version_first 内嵌投影的 legacy 回退)。``version`` 为空表示无版本空间
|
|
709
|
-
(split_first):SDK 不拼 version 参数,记录过滤条件退化为"version 为空",
|
|
710
|
-
与 ``_unversioned_split`` 等价。``split get`` 保持默认 OSS 发现回退;
|
|
711
|
-
``split create`` 的幂等检查须传 ``oss_fallback=False``:dataset 刚创建或
|
|
712
|
-
尚未上传时 OSS prefix 不存在,``_discover_split`` 会把"split 不存在"误报为
|
|
713
|
-
查询失败。禁用动作经 ``oss_fallback_kwargs(force=True)`` 走 SDK 兼容阶梯,
|
|
714
|
-
不支持该开关的旧版客户端不会收到这个参数。
|
|
715
|
-
"""
|
|
716
672
|
from .irepo_sdk import _reason
|
|
717
673
|
|
|
718
674
|
env = _environment(environment)
|
|
719
675
|
repo = _dataset_repo()
|
|
720
|
-
read_kwargs = _read_env_kwargs(repo, repo.splits, "get", env)
|
|
721
|
-
if not oss_fallback:
|
|
722
|
-
# 写路径预检强制关 OSS 发现,但必须走 guard 的 SDK 兼容阶梯:旧版
|
|
723
|
-
# (<=1.3.1) metadata-only SplitsClient 的 get 既无 fallback_to_oss 参数
|
|
724
|
-
# 也无 _content,阶梯返回 {}(旧版没有 OSS 发现,404→None 即"不存在");
|
|
725
|
-
# 盲塞参数会 TypeError(线上 keluo 环境反馈)。
|
|
726
|
-
read_kwargs.update(oss_fallback_kwargs(repo, repo.splits, "get", env, force=True))
|
|
727
676
|
try:
|
|
728
|
-
record = repo.splits.get(
|
|
677
|
+
record = repo.splits.get(
|
|
678
|
+
dataset,
|
|
679
|
+
split,
|
|
680
|
+
version=version,
|
|
681
|
+
**_read_env_kwargs(repo, repo.splits, "get", env),
|
|
682
|
+
)
|
|
729
683
|
except Exception as exc: # noqa: BLE001
|
|
730
684
|
raise _fail(
|
|
731
685
|
f"dataset {dataset} version {_version_label(version)} split {split}: "
|
|
@@ -733,56 +687,12 @@ def _versioned_split(
|
|
|
733
687
|
f"Check the dataset name and permission: ap dataset get {dataset}",
|
|
734
688
|
) from exc
|
|
735
689
|
detail = _model_dict(record) if record is not None else None
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
def _versioned_splits(
|
|
742
|
-
dataset: str, version: str, *, stage: str, environment: Optional[str] = None
|
|
743
|
-
) -> list[dict]:
|
|
744
|
-
"""读**指定 version**的 split——走 SDK ``repo.splits``(recordsvc)。
|
|
745
|
-
|
|
746
|
-
与 ``_unversioned_splits`` 同源:version 文档不内嵌 ``splits[]``(服务端只给
|
|
747
|
-
``split_count`` 聚合,split 记录由 recordsvc 的 ``/datasets/splits`` 承载),
|
|
748
|
-
SDK ``splits.list(version=...)`` 是唯一正确读法,且自带存量 version_first
|
|
749
|
-
内嵌投影的 legacy 回退。
|
|
750
|
-
"""
|
|
751
|
-
from .irepo_sdk import _reason
|
|
752
|
-
|
|
753
|
-
env = _environment(environment)
|
|
754
|
-
repo = _dataset_repo()
|
|
755
|
-
try:
|
|
756
|
-
records: list[dict] = []
|
|
757
|
-
page = 1
|
|
758
|
-
while True:
|
|
759
|
-
result = repo.splits.list(
|
|
760
|
-
dataset,
|
|
761
|
-
version=version,
|
|
762
|
-
page_size=_SPLIT_PAGE_SIZE,
|
|
763
|
-
**({"page": page} if page > 1 else {}),
|
|
764
|
-
**_read_env_kwargs(repo, repo.splits, "list", env),
|
|
765
|
-
)
|
|
766
|
-
items = getattr(result, "items", None) or []
|
|
767
|
-
for item in items:
|
|
768
|
-
record = _model_dict(item)
|
|
769
|
-
# 与 ``_versioned_split`` 同口径:只收 version 匹配的记录(服务端
|
|
770
|
-
# exact scope 保证;legacy 投影与 OSS 发现也会带 version)。
|
|
771
|
-
if _version_value(record.get("version")) == version:
|
|
772
|
-
records.append(record)
|
|
773
|
-
if not items or getattr(result, "has_more", False) is not True:
|
|
774
|
-
break
|
|
775
|
-
page += 1
|
|
776
|
-
except Exception as exc: # noqa: BLE001 - 统一走设计 §5.1 的映射
|
|
777
|
-
raise _fail(
|
|
778
|
-
f"dataset {dataset} version {version}: {stage} failed: {_reason(exc)}",
|
|
779
|
-
f"Check the version name: ap dataset version get {version} --dataset {dataset}",
|
|
780
|
-
) from exc
|
|
781
|
-
return records
|
|
690
|
+
if detail is None or _version_value(detail.get("version")) != version:
|
|
691
|
+
return None
|
|
692
|
+
return detail
|
|
782
693
|
|
|
783
694
|
|
|
784
695
|
def _split_records(detail: dict) -> list[dict]:
|
|
785
|
-
"""version 文档内嵌的 ``splits[]``(设计 §4.3:split 没有独立资源)。"""
|
|
786
696
|
splits = detail.get("splits")
|
|
787
697
|
if not isinstance(splits, list):
|
|
788
698
|
return []
|
|
@@ -795,25 +705,6 @@ def _split_records(detail: dict) -> list[dict]:
|
|
|
795
705
|
return records
|
|
796
706
|
|
|
797
707
|
|
|
798
|
-
def _split_names_of(records: list[dict]) -> list[str]:
|
|
799
|
-
"""recordsvc split 记录里的名字(去重)。"""
|
|
800
|
-
names: list[str] = []
|
|
801
|
-
for record in records:
|
|
802
|
-
name = str(record.get("name") or "").strip()
|
|
803
|
-
if name and name not in names:
|
|
804
|
-
names.append(name)
|
|
805
|
-
return names
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
def _split_names(detail: dict) -> list[str]:
|
|
809
|
-
names: list[str] = []
|
|
810
|
-
for record in _split_records(detail):
|
|
811
|
-
name = str(record.get("name") or "").strip()
|
|
812
|
-
if name and name not in names:
|
|
813
|
-
names.append(name)
|
|
814
|
-
return names
|
|
815
|
-
|
|
816
|
-
|
|
817
708
|
def _dataset_repo(*, request_timeout: float | None = None) -> "Repo":
|
|
818
709
|
"""dataset 写路径统一走 InstanceRepo SDK;未装 ``dataset`` extra 时退出 2。"""
|
|
819
710
|
from .irepo_sdk import SdkMissing, load_repo
|
|
@@ -825,53 +716,6 @@ def _dataset_repo(*, request_timeout: float | None = None) -> "Repo":
|
|
|
825
716
|
raise typer.Exit(2) from exc
|
|
826
717
|
|
|
827
718
|
|
|
828
|
-
def _patch_version(
|
|
829
|
-
dataset: str,
|
|
830
|
-
version: str,
|
|
831
|
-
body: dict,
|
|
832
|
-
*,
|
|
833
|
-
stage: str,
|
|
834
|
-
fallback_hint: str = "",
|
|
835
|
-
environment: Optional[str] = None,
|
|
836
|
-
metadata_model: str = "",
|
|
837
|
-
) -> None:
|
|
838
|
-
"""split 写操作统一走 SDK;body 为 splits/split_run_types 单键。
|
|
839
|
-
|
|
840
|
-
``environment`` 必须与读路径同口径(缺省 ``online``):SDK 的 ``versions.update``
|
|
841
|
-
会按 profile 派生(dev 集群→``pre``),而版本在 ``online``,于是"能查到却 PATCH 404"。
|
|
842
|
-
见 :func:`ap_client.irepo_sdk.update_version_detail`。
|
|
843
|
-
"""
|
|
844
|
-
from .irepo_sdk import _reason, update_version_detail
|
|
845
|
-
|
|
846
|
-
repo = _dataset_repo()
|
|
847
|
-
try:
|
|
848
|
-
update_version_detail(
|
|
849
|
-
repo,
|
|
850
|
-
dataset,
|
|
851
|
-
version,
|
|
852
|
-
body,
|
|
853
|
-
environment=_environment(environment),
|
|
854
|
-
metadata_model=metadata_model,
|
|
855
|
-
)
|
|
856
|
-
except Exception as exc: # noqa: BLE001 - 统一走设计 §5.1 的映射
|
|
857
|
-
code = getattr(exc, "biz_code", None)
|
|
858
|
-
if code == 94018:
|
|
859
|
-
hint = f"Writer role required: ap dataset access grant {dataset} --user <you> --role writer"
|
|
860
|
-
elif code == 94016:
|
|
861
|
-
hint = (
|
|
862
|
-
f"Ask an admin to run ap dataset access grant {dataset} --user <you> --role writer"
|
|
863
|
-
)
|
|
864
|
-
else:
|
|
865
|
-
shown = version if version else '""'
|
|
866
|
-
hint = fallback_hint or (
|
|
867
|
-
f"Check the version status: ap dataset version get {shown} --dataset {dataset}"
|
|
868
|
-
)
|
|
869
|
-
raise _fail(
|
|
870
|
-
f"dataset {dataset} version {_version_label(version)}: {stage} failed: {_reason(exc)}",
|
|
871
|
-
hint,
|
|
872
|
-
) from exc
|
|
873
|
-
|
|
874
|
-
|
|
875
719
|
# ---- 行投影 ---------------------------------------------------------------
|
|
876
720
|
|
|
877
721
|
|
|
@@ -1935,14 +1779,8 @@ def dataset_split_list(
|
|
|
1935
1779
|
resolved_version = _version_value(version)
|
|
1936
1780
|
resolved_run_type = _check_choice(run_type, _RUN_TYPES, "--run-type") if run_type else ""
|
|
1937
1781
|
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
dataset, resolved_version, stage="split query", environment=environment
|
|
1941
|
-
)
|
|
1942
|
-
rows = [_split_row(record, {}) for record in records]
|
|
1943
|
-
else:
|
|
1944
|
-
records = _unversioned_splits(dataset, stage="split query", environment=environment)
|
|
1945
|
-
rows = [_split_row(record, {}) for record in records]
|
|
1782
|
+
records = _split_list(dataset, resolved_version, environment)
|
|
1783
|
+
rows = [_split_row(record, {}) for record in records]
|
|
1946
1784
|
if resolved_run_type:
|
|
1947
1785
|
rows = [row for row in rows if str(row["run_type"]).lower() == resolved_run_type]
|
|
1948
1786
|
_emit(
|
|
@@ -1964,48 +1802,19 @@ def dataset_split_get(
|
|
|
1964
1802
|
"""Show one split of a version, or of the version-less (split_first) space."""
|
|
1965
1803
|
output_format = _fmt(output_format)
|
|
1966
1804
|
resolved_version = _version_value(version)
|
|
1967
|
-
|
|
1968
|
-
if
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
_emit_detail(payload, output_format)
|
|
1976
|
-
return
|
|
1977
|
-
known = (
|
|
1978
|
-
", ".join(
|
|
1979
|
-
_split_names_of(
|
|
1980
|
-
_versioned_splits(
|
|
1981
|
-
dataset, resolved_version, stage="split query", environment=environment
|
|
1982
|
-
)
|
|
1983
|
-
)
|
|
1984
|
-
)
|
|
1985
|
-
or "<none>"
|
|
1986
|
-
)
|
|
1987
|
-
else:
|
|
1988
|
-
record = _unversioned_split(dataset, split, environment=environment)
|
|
1989
|
-
if record is not None:
|
|
1990
|
-
payload = dict(record)
|
|
1991
|
-
payload.setdefault("dataset", dataset)
|
|
1992
|
-
payload.setdefault("version", "")
|
|
1993
|
-
payload.setdefault("registered", True)
|
|
1994
|
-
_emit_detail(payload, output_format)
|
|
1995
|
-
return
|
|
1996
|
-
known = (
|
|
1997
|
-
", ".join(
|
|
1998
|
-
_split_names_of(
|
|
1999
|
-
_unversioned_splits(dataset, stage="split query", environment=environment)
|
|
2000
|
-
)
|
|
2001
|
-
)
|
|
2002
|
-
or "<none>"
|
|
2003
|
-
)
|
|
1805
|
+
record = _split_get(dataset, resolved_version, split, environment)
|
|
1806
|
+
if record is not None:
|
|
1807
|
+
payload = dict(record)
|
|
1808
|
+
payload.setdefault("dataset", dataset)
|
|
1809
|
+
payload.setdefault("version", resolved_version)
|
|
1810
|
+
payload.setdefault("registered", True)
|
|
1811
|
+
_emit_detail(payload, output_format)
|
|
1812
|
+
return
|
|
2004
1813
|
|
|
2005
1814
|
raise _fail(
|
|
2006
1815
|
f"dataset {dataset} version {_version_label(resolved_version)} split {split}: query failed: not found",
|
|
2007
|
-
f"
|
|
2008
|
-
+ ("" if resolved_version else f"; {_NO_VERSION_NOTE}"),
|
|
1816
|
+
f"List existing splits: ap dataset split list --dataset {dataset}"
|
|
1817
|
+
+ (f" --version {resolved_version}" if resolved_version else f"; {_NO_VERSION_NOTE}"),
|
|
2009
1818
|
)
|
|
2010
1819
|
|
|
2011
1820
|
|
|
@@ -2026,29 +1835,6 @@ def dataset_split_create(
|
|
|
2026
1835
|
resolved_run_type = _check_choice(run_type, _RUN_TYPES, "--run-type") if run_type else ""
|
|
2027
1836
|
env = _environment(environment)
|
|
2028
1837
|
|
|
2029
|
-
# 有/无版本创建都走独立 Split API(POST /datasets/splits,version 可空):服务端
|
|
2030
|
-
# 按 version 是否为空写 dataset/split 或 dataset/version/split,SDK 把空 version
|
|
2031
|
-
# 转成不带 version 的请求,因此不需要分支。无版本路径直接落 recordsvc 的
|
|
2032
|
-
# unversioned split record,不要求 OSS 上先有实例文件(空 split 壳也能建);
|
|
2033
|
-
# ingest 只是另一条产出记录的路径。旧 Version PATCH(splits 全量替换 /
|
|
2034
|
-
# split_run_types)已被服务端拒绝("split-first Version group updates are
|
|
2035
|
-
# not supported")。
|
|
2036
|
-
# 幂等预检禁用 OSS 发现回退:dataset 刚创建或尚未上传时 OSS prefix 不存在,
|
|
2037
|
-
# _discover_split 会把"split 不存在"误报为查询失败("not found in OSS");
|
|
2038
|
-
# recordsvc 404 → legacy 回退 → None 即判定"不存在 → 走 create"。有/无版本
|
|
2039
|
-
# 共用同一预检,空 version 的过滤条件退化为"version 为空"。
|
|
2040
|
-
existing = _versioned_split(
|
|
2041
|
-
dataset, resolved_version, split, environment=environment, oss_fallback=False
|
|
2042
|
-
)
|
|
2043
|
-
if existing is not None:
|
|
2044
|
-
# 幂等:已存在同名 split(设计 §4.3)。
|
|
2045
|
-
payload = dict(existing)
|
|
2046
|
-
payload.setdefault("dataset", dataset)
|
|
2047
|
-
payload.setdefault("version", resolved_version)
|
|
2048
|
-
payload["created"] = False
|
|
2049
|
-
_emit_detail(payload, output_format)
|
|
2050
|
-
return
|
|
2051
|
-
|
|
2052
1838
|
from .instance_commands import _sdk_read_kwargs
|
|
2053
1839
|
from .irepo_sdk import _reason
|
|
2054
1840
|
|
|
@@ -2068,7 +1854,6 @@ def dataset_split_create(
|
|
|
2068
1854
|
payload.setdefault("dataset", dataset)
|
|
2069
1855
|
payload.setdefault("version", resolved_version)
|
|
2070
1856
|
payload.setdefault("split", split)
|
|
2071
|
-
payload["created"] = True
|
|
2072
1857
|
_emit_detail(payload, output_format)
|
|
2073
1858
|
|
|
2074
1859
|
|
|
@@ -2083,7 +1868,7 @@ def dataset_split_update(
|
|
|
2083
1868
|
environment: Optional[str] = typer.Option(None, "--environment", help=_ENVIRONMENT_HELP),
|
|
2084
1869
|
output_format: str = typer.Option(None, "--format", help=_FORMAT_HELP),
|
|
2085
1870
|
):
|
|
2086
|
-
"""Retag a split's run type
|
|
1871
|
+
"""Retag a split's run type through the SDK."""
|
|
2087
1872
|
|
|
2088
1873
|
output_format = _fmt(output_format)
|
|
2089
1874
|
resolved_version = _version_value(version)
|
|
@@ -2094,92 +1879,7 @@ def dataset_split_update(
|
|
|
2094
1879
|
exit_code=2,
|
|
2095
1880
|
)
|
|
2096
1881
|
resolved_run_type = _check_choice(run_type, _RUN_TYPES, "--run-type")
|
|
2097
|
-
|
|
2098
|
-
if not resolved_version:
|
|
2099
|
-
# 无版本空间改 run_type 走 recordsvc 的 split 记录(PATCH /datasets/splits/detail):
|
|
2100
|
-
# 写端点仅限 online——SDK 1.1.2 起派生/显式 pre 都会前置 SchemaError 拒绝,
|
|
2101
|
-
# 不再出现"存在性检查读 pre、写入默默落 online"的读写环境撕裂。
|
|
2102
|
-
env = _environment(environment)
|
|
2103
|
-
if env == "pre":
|
|
2104
|
-
raise _fail(
|
|
2105
|
-
f"Failed to update split {split} of dataset {dataset}: split records can only be changed in the online environment",
|
|
2106
|
-
"PATCH on version-less split records only supports online; drop --environment pre, "
|
|
2107
|
-
"or use a version-scoped run_type (--version <version>)",
|
|
2108
|
-
exit_code=2,
|
|
2109
|
-
)
|
|
2110
|
-
if _unversioned_split(dataset, split, environment=environment) is None:
|
|
2111
|
-
known = (
|
|
2112
|
-
", ".join(
|
|
2113
|
-
_split_names_of(
|
|
2114
|
-
_unversioned_splits(
|
|
2115
|
-
dataset, stage="split update precheck", environment=environment
|
|
2116
|
-
)
|
|
2117
|
-
)
|
|
2118
|
-
)
|
|
2119
|
-
or "<none>"
|
|
2120
|
-
)
|
|
2121
|
-
raise _fail(
|
|
2122
|
-
f"Failed to update split {split} of dataset {dataset} (no version space): not found",
|
|
2123
|
-
f"Existing splits in this dataset's version-less space: {known}; {_NO_VERSION_NOTE}",
|
|
2124
|
-
)
|
|
2125
|
-
from .instance_commands import _sdk_read_kwargs
|
|
2126
|
-
from .irepo_sdk import _reason
|
|
2127
|
-
|
|
2128
|
-
repo = _dataset_repo()
|
|
2129
|
-
# 写请求与上面的存在性预检查同口径路由环境(缺省 online);auto 由
|
|
2130
|
-
# _sdk_read_kwargs 省略下发,跟随集群绑定。旧 SDK 不接受 environment 时
|
|
2131
|
-
# 按显式值报升级提示,不静默忽略。
|
|
2132
|
-
update_kwargs = _sdk_read_kwargs(repo.splits, "update", environment=env, metadata_model="")
|
|
2133
|
-
try:
|
|
2134
|
-
repo.splits.update(dataset, split, run_type=resolved_run_type, **update_kwargs)
|
|
2135
|
-
except Exception as exc: # noqa: BLE001 - 统一走设计 §5.1 的映射
|
|
2136
|
-
raise _fail(
|
|
2137
|
-
f"Failed to update split {split} of dataset {dataset} (no version space): {_reason(exc)}",
|
|
2138
|
-
"Write permission on this dataset is required; check the split name and the online environment, then retry",
|
|
2139
|
-
) from exc
|
|
2140
|
-
_emit_detail(
|
|
2141
|
-
{
|
|
2142
|
-
"dataset": dataset,
|
|
2143
|
-
"version": "",
|
|
2144
|
-
"split": split,
|
|
2145
|
-
"run_type": resolved_run_type,
|
|
2146
|
-
"updated": True,
|
|
2147
|
-
},
|
|
2148
|
-
output_format,
|
|
2149
|
-
)
|
|
2150
|
-
return
|
|
2151
|
-
|
|
2152
|
-
# 版本化更新走独立 Split API(PATCH /datasets/splits/detail),预检用精确
|
|
2153
|
-
# split 身份(splits.get with version)——旧实现查 Version 内嵌 splits 再
|
|
2154
|
-
# PATCH Version,与独立 Split 记录不匹配,导致"已存在却报 not found"。
|
|
2155
1882
|
env = _environment(environment)
|
|
2156
|
-
if env == "pre":
|
|
2157
|
-
raise _fail(
|
|
2158
|
-
f"Failed to update split {split} of dataset {dataset}: split records can only be changed in the online environment",
|
|
2159
|
-
"PATCH on split records only supports online; drop --environment pre",
|
|
2160
|
-
exit_code=2,
|
|
2161
|
-
)
|
|
2162
|
-
record = _versioned_split(dataset, resolved_version, split, environment=environment)
|
|
2163
|
-
if record is None:
|
|
2164
|
-
known = (
|
|
2165
|
-
", ".join(
|
|
2166
|
-
_split_names_of(
|
|
2167
|
-
_versioned_splits(
|
|
2168
|
-
dataset,
|
|
2169
|
-
resolved_version,
|
|
2170
|
-
stage="split update precheck",
|
|
2171
|
-
environment=environment,
|
|
2172
|
-
)
|
|
2173
|
-
)
|
|
2174
|
-
)
|
|
2175
|
-
or "<none>"
|
|
2176
|
-
)
|
|
2177
|
-
raise _fail(
|
|
2178
|
-
f"dataset {dataset} version {_version_label(resolved_version)} split {split}: "
|
|
2179
|
-
f"update failed: not found",
|
|
2180
|
-
f"Create it first: ap dataset split create {split} --dataset {dataset} "
|
|
2181
|
-
f"--version {resolved_version} (existing: {known})",
|
|
2182
|
-
)
|
|
2183
1883
|
|
|
2184
1884
|
from .instance_commands import _sdk_read_kwargs
|
|
2185
1885
|
from .irepo_sdk import _reason
|
|
@@ -2187,21 +1887,18 @@ def dataset_split_update(
|
|
|
2187
1887
|
repo = _dataset_repo()
|
|
2188
1888
|
update_kwargs = _sdk_read_kwargs(repo.splits, "update", environment=env, metadata_model="")
|
|
2189
1889
|
try:
|
|
2190
|
-
repo.splits.update(
|
|
1890
|
+
record = repo.splits.update(
|
|
2191
1891
|
dataset, split, version=resolved_version, run_type=resolved_run_type, **update_kwargs
|
|
2192
1892
|
)
|
|
2193
|
-
except Exception as exc: # noqa: BLE001
|
|
1893
|
+
except Exception as exc: # noqa: BLE001
|
|
2194
1894
|
raise _fail(
|
|
2195
|
-
f"Failed to update split {split} of dataset {dataset} version {resolved_version}: {_reason(exc)}",
|
|
2196
|
-
"Write permission on this dataset is required; check the split name and
|
|
1895
|
+
f"Failed to update split {split} of dataset {dataset} version {_version_label(resolved_version)}: {_reason(exc)}",
|
|
1896
|
+
"Write permission on this dataset is required; check the split name and environment, then retry",
|
|
2197
1897
|
) from exc
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
},
|
|
2206
|
-
output_format,
|
|
2207
|
-
)
|
|
1898
|
+
payload = _model_dict(record)
|
|
1899
|
+
payload.setdefault("dataset", dataset)
|
|
1900
|
+
payload.setdefault("version", resolved_version)
|
|
1901
|
+
payload.setdefault("split", split)
|
|
1902
|
+
payload.setdefault("run_type", resolved_run_type)
|
|
1903
|
+
payload["updated"] = True
|
|
1904
|
+
_emit_detail(payload, output_format)
|
|
@@ -243,37 +243,11 @@ def _describe(exc: BaseException) -> str:
|
|
|
243
243
|
|
|
244
244
|
|
|
245
245
|
def _sdk_read_kwargs(sdk_obj: Any, method: str, *, environment: str, metadata_model: str) -> dict:
|
|
246
|
-
"""按 SDK 能力下发 environment / metadata_model,不允许静默忽略显式值。"""
|
|
247
|
-
fn = getattr(sdk_obj, method, None)
|
|
248
|
-
accepted: set[str] = set()
|
|
249
|
-
if fn is not None:
|
|
250
|
-
try:
|
|
251
|
-
params = inspect.signature(fn).parameters
|
|
252
|
-
except (TypeError, ValueError): # pragma: no cover - 打桩异常形态
|
|
253
|
-
params = {}
|
|
254
|
-
for name, param in params.items():
|
|
255
|
-
if param.kind is inspect.Parameter.VAR_KEYWORD:
|
|
256
|
-
accepted.update(("environment", "metadata_model"))
|
|
257
|
-
elif name in ("environment", "metadata_model"):
|
|
258
|
-
accepted.add(name)
|
|
259
|
-
|
|
260
246
|
kwargs: dict[str, str] = {}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
continue
|
|
266
|
-
# 空值不下发:CLI 不替 SDK 决定 metadata_model(见 dataset_commands._metadata_model)。
|
|
267
|
-
if key in accepted and value:
|
|
268
|
-
kwargs[key] = value
|
|
269
|
-
elif value:
|
|
270
|
-
dropped.append(key)
|
|
271
|
-
if dropped:
|
|
272
|
-
raise _fail(
|
|
273
|
-
f"The installed instance-repo does not support per-call {'/'.join(dropped)}",
|
|
274
|
-
"Upgrade to instance-repo 1.1.4 or newer and retry",
|
|
275
|
-
exit_code=2,
|
|
276
|
-
)
|
|
247
|
+
if environment and environment != "auto":
|
|
248
|
+
kwargs["environment"] = environment
|
|
249
|
+
if metadata_model:
|
|
250
|
+
kwargs["metadata_model"] = metadata_model
|
|
277
251
|
return kwargs
|
|
278
252
|
|
|
279
253
|
|
|
@@ -982,6 +956,7 @@ def instance_pull(
|
|
|
982
956
|
dataset: str = typer.Option(..., "--dataset", help="Dataset name"),
|
|
983
957
|
split: str = typer.Option(..., "--split", help="Split name (required for remote operations)"),
|
|
984
958
|
version: Optional[str] = typer.Option(None, "--version", help=_VERSION_HELP),
|
|
959
|
+
environment: Optional[str] = typer.Option(None, "--environment", help=_ENVIRONMENT_HELP),
|
|
985
960
|
output: Optional[str] = typer.Option(
|
|
986
961
|
None, "--output", "-o", help="Output directory (default: current directory)"
|
|
987
962
|
),
|
|
@@ -997,6 +972,7 @@ def instance_pull(
|
|
|
997
972
|
from .irepo_sdk import sdk_error_exit
|
|
998
973
|
|
|
999
974
|
output_format = _fmt(output_format)
|
|
975
|
+
env = _environment(environment)
|
|
1000
976
|
resolved_path = _path_value(path)
|
|
1001
977
|
resolved = _version_value(version)
|
|
1002
978
|
root = Path(output or ".")
|
|
@@ -1008,9 +984,17 @@ def instance_pull(
|
|
|
1008
984
|
)
|
|
1009
985
|
|
|
1010
986
|
repo = _load_repo_or_exit()
|
|
1011
|
-
|
|
987
|
+
from .repo_read_guard import pull_client
|
|
988
|
+
|
|
989
|
+
try:
|
|
990
|
+
client = pull_client(repo.instances, env)
|
|
991
|
+
pull_options = oss_fallback_kwargs(repo, client, "pull", env)
|
|
992
|
+
except (TypeError, ValueError, RuntimeError) as exc:
|
|
993
|
+
raise _fail(
|
|
994
|
+
str(exc), "Upgrade Dataset support: pip install --upgrade 'ap-client[dataset]'", 2
|
|
995
|
+
) from exc
|
|
1012
996
|
if resolved_path is not None:
|
|
1013
|
-
pull_options
|
|
997
|
+
pull_options.update(_enhanced_options(client, "pull", {"path": resolved_path}))
|
|
1014
998
|
try:
|
|
1015
999
|
private_endpoint_reachable = _probe_pull_private_endpoint(repo, dataset)
|
|
1016
1000
|
except Exception as exc: # noqa: BLE001
|
|
@@ -1027,9 +1011,7 @@ def instance_pull(
|
|
|
1027
1011
|
staging = Path(tempfile.mkdtemp(prefix=f"ap-pull-{instance}-"))
|
|
1028
1012
|
try:
|
|
1029
1013
|
try:
|
|
1030
|
-
written =
|
|
1031
|
-
dataset, resolved, instance, staging, split, **pull_options
|
|
1032
|
-
)
|
|
1014
|
+
written = client.pull(dataset, resolved, instance, staging, split, **pull_options)
|
|
1033
1015
|
except Exception as exc: # noqa: BLE001
|
|
1034
1016
|
sdk_error_exit(exc, what=f"instance {instance}", stage="pull")
|
|
1035
1017
|
staged = _place_under_target(Path(str(written)), staging / instance)
|
|
@@ -59,7 +59,6 @@ __all__ = [
|
|
|
59
59
|
"is_already_satisfied",
|
|
60
60
|
"load_repo",
|
|
61
61
|
"sdk_error_exit",
|
|
62
|
-
"update_version_detail",
|
|
63
62
|
]
|
|
64
63
|
|
|
65
64
|
#: 数据集元数据的环境枚举(服务端 ``dataset environment``)。
|
|
@@ -1239,62 +1238,6 @@ def _is_verbose() -> bool:
|
|
|
1239
1238
|
return _parse_bool(os.environ.get("AP_VERBOSE"))
|
|
1240
1239
|
|
|
1241
1240
|
|
|
1242
|
-
#: 集群绑定存储 → 环境侧(dev 三个变体都是 pre 侧),与 dataset_commands._STORAGE_SIDES 同口径。
|
|
1243
|
-
_STORAGE_SIDES = {
|
|
1244
|
-
"dev": "pre",
|
|
1245
|
-
"internal-dev": "pre",
|
|
1246
|
-
"external-dev": "pre",
|
|
1247
|
-
"prod": "online",
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
def _derive_environment(repo: Any) -> str:
|
|
1252
|
-
"""``auto`` 的实际取值:按 repo profile 的集群存储绑定派生,未知回退 online。"""
|
|
1253
|
-
profile = getattr(repo, "profile", None)
|
|
1254
|
-
storage_env = str(getattr(profile, "storage_env", "") or "").strip().lower()
|
|
1255
|
-
return _STORAGE_SIDES.get(storage_env, "online")
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
def update_version_detail(
|
|
1259
|
-
repo: Any,
|
|
1260
|
-
dataset: str,
|
|
1261
|
-
version: str,
|
|
1262
|
-
body: dict,
|
|
1263
|
-
*,
|
|
1264
|
-
environment: str,
|
|
1265
|
-
metadata_model: str = "",
|
|
1266
|
-
) -> None:
|
|
1267
|
-
"""``PATCH /apis/v1/datasets/versions/detail`` with explicit routing selectors."""
|
|
1268
|
-
if environment == "auto":
|
|
1269
|
-
# auto 是 CLI 层取值(跟随集群绑定),服务端契约只有 online/pre。直连
|
|
1270
|
-
# transport 的兼容分支必须显式带上派生值——只删 query 会落到服务端
|
|
1271
|
-
# 缺省 online,在 dev 集群上造成读写撕裂;SDK 分支传派生值与 SDK 自行
|
|
1272
|
-
# 按 profile 派生等价,两条路径口径一致。
|
|
1273
|
-
environment = _derive_environment(repo)
|
|
1274
|
-
update = repo.versions.update
|
|
1275
|
-
try:
|
|
1276
|
-
accepted = inspect.signature(update).parameters
|
|
1277
|
-
except (TypeError, ValueError): # pragma: no cover - 内建/装饰过的可调用
|
|
1278
|
-
accepted = {}
|
|
1279
|
-
if "environment" in accepted and "metadata_model" in accepted:
|
|
1280
|
-
kwargs = dict(body)
|
|
1281
|
-
if environment:
|
|
1282
|
-
kwargs["environment"] = environment
|
|
1283
|
-
if metadata_model:
|
|
1284
|
-
kwargs["metadata_model"] = metadata_model
|
|
1285
|
-
update(dataset, version, **kwargs)
|
|
1286
|
-
return
|
|
1287
|
-
|
|
1288
|
-
from urllib.parse import quote
|
|
1289
|
-
|
|
1290
|
-
query = f"dataset_name={quote(dataset, safe='')}&version={quote(version, safe='')}"
|
|
1291
|
-
if environment:
|
|
1292
|
-
query += f"&environment={quote(environment, safe='')}"
|
|
1293
|
-
if metadata_model:
|
|
1294
|
-
query += f"&metadata_model={quote(metadata_model, safe='')}"
|
|
1295
|
-
repo.transport.patch(f"/apis/v1/datasets/versions/detail?{query}", dict(body))
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
1241
|
def _reason(exc: Exception) -> str:
|
|
1299
1242
|
message = getattr(exc, "message", None)
|
|
1300
1243
|
text = str(message or "").strip() or str(exc).strip()
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import inspect
|
|
6
|
+
from copy import copy
|
|
7
|
+
from functools import partial
|
|
6
8
|
from typing import Any
|
|
7
9
|
|
|
8
10
|
STORAGE_SIDES = {
|
|
@@ -13,34 +15,44 @@ STORAGE_SIDES = {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
|
|
16
|
-
def
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
def pull_client(client: Any, environment: str) -> Any:
|
|
19
|
+
"""Scope SDK 1.4.x pull metadata reads without changing its storage binding.
|
|
20
|
+
|
|
21
|
+
pull has no environment argument, although its registry supports one.
|
|
22
|
+
Copy both objects so other operations on the Repo keep their original context.
|
|
23
|
+
"""
|
|
24
|
+
if environment == "auto":
|
|
25
|
+
return client
|
|
26
|
+
registry = getattr(client, "_reg", None)
|
|
27
|
+
get = getattr(registry, "get", None)
|
|
28
|
+
if not callable(get) or "environment" not in inspect.signature(get).parameters:
|
|
29
|
+
raise ValueError(
|
|
30
|
+
"The installed instance-repo cannot scope pull metadata reads; "
|
|
31
|
+
"upgrade 'ap-client[dataset]'"
|
|
32
|
+
)
|
|
33
|
+
scoped = copy(client)
|
|
34
|
+
scoped._reg = copy(registry)
|
|
35
|
+
scoped._reg.get = partial(get, environment=environment)
|
|
36
|
+
return scoped
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def oss_fallback_kwargs(repo: Any, client: Any, method: str, environment: str) -> dict:
|
|
19
40
|
"""Allow API reads across environments; disable unsafe storage fallback.
|
|
20
41
|
|
|
21
42
|
Missing/unknown storage provenance is insufficient for explicit online/pre
|
|
22
43
|
discovery. auto follows the bound store. Bind missing SDK discovery provenance.
|
|
23
|
-
|
|
24
|
-
``force`` hard-disables discovery even when ``environment`` is ``auto`` or
|
|
25
|
-
matches the bound storage — write-path prechecks (split-create idempotency)
|
|
26
|
-
must read a recordsvc miss as ``None`` instead of letting OSS discovery turn
|
|
27
|
-
a missing prefix into "query failed". It reuses the same SDK compatibility
|
|
28
|
-
ladder: older metadata-only clients (no ``_content``) have no discovery to
|
|
29
|
-
disable and get ``{}``; a content-bearing client without the switch fails
|
|
30
|
-
closed with an upgrade hint instead of blindly passing an unsupported
|
|
31
|
-
``fallback_to_oss`` argument (``TypeError`` on instance-repo <=1.3.1).
|
|
32
44
|
"""
|
|
33
45
|
profile = getattr(repo, "profile", None)
|
|
34
46
|
# instance-repo 1.3.5.dev2+ reads _p in Dataset discovery without binding it
|
|
35
47
|
# during construction. Supply the actual Repo profile before that check.
|
|
36
48
|
if callable(getattr(client, "_discovery_env_match", None)) and not hasattr(client, "_p"):
|
|
37
49
|
client._p = profile
|
|
38
|
-
if environment == "auto"
|
|
50
|
+
if environment == "auto":
|
|
39
51
|
return {}
|
|
40
52
|
storage = getattr(profile, "storage_env", "")
|
|
41
53
|
storage = storage.strip().lower() if isinstance(storage, str) else ""
|
|
42
54
|
side = STORAGE_SIDES.get(storage, "")
|
|
43
|
-
if side and side == environment
|
|
55
|
+
if side and side == environment:
|
|
44
56
|
return {}
|
|
45
57
|
|
|
46
58
|
try:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ap-client"
|
|
7
|
-
version = "0.8.0.
|
|
7
|
+
version = "0.8.0.dev3"
|
|
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.
|
|
22
|
+
"instance-repo[oss]>=1.4.6,<2.0.0",
|
|
23
23
|
]
|
|
24
24
|
all = [
|
|
25
|
-
"instance-repo[oss]>=1.4.
|
|
25
|
+
"instance-repo[oss]>=1.4.6,<2.0.0",
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.scripts]
|
|
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
|
|
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
|