xiaoshiai-hub 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

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.
xiaoshiai_hub/upload.py CHANGED
@@ -291,29 +291,7 @@ def upload_folder(
291
291
  password=password,
292
292
  token=token,
293
293
  )
294
-
295
- try:
296
- repo_info = client.get_repository_info(
297
- organization=organization,
298
- repo_type=repo_type,
299
- repo_name=repo_name,
300
- )
301
- except RepositoryNotFoundError:
302
- raise RepositoryNotFoundError(
303
- f"Repository '{repo_id}' does not exist. "
304
- "Please create the repository before uploading."
305
- )
306
-
307
- # Check if repository requires encryption
308
- is_encrypted = repo_info.annotations.get('encryption') == 'true'
309
- if is_encrypted:
310
- if not encryption_key:
311
- raise EncryptionError(
312
- f"Repository '{repo_id}' requires encryption, but no encryption_key was provided. "
313
- "Please provide an encryption_key parameter."
314
- )
315
- print(f"Repository is encrypted. Files will be encrypted before upload.")
316
-
294
+ is_encrypted = bool(encryption_key)
317
295
  # Validate folder path
318
296
  folder_path = Path(folder_path)
319
297
  if not folder_path.exists():
@@ -631,29 +609,7 @@ def upload_file(
631
609
  password=password,
632
610
  token=token,
633
611
  )
634
-
635
- try:
636
- repo_info = client.get_repository_info(
637
- organization=organization,
638
- repo_type=repo_type,
639
- repo_name=repo_name,
640
- )
641
- except RepositoryNotFoundError:
642
- raise RepositoryNotFoundError(
643
- f"Repository '{repo_id}' does not exist. "
644
- "Please create the repository before uploading."
645
- )
646
-
647
- # 检查仓库是否是加密仓库
648
- is_encrypted = repo_info.annotations.get('encryption') == 'true'
649
- if is_encrypted:
650
- if not encryption_key:
651
- raise EncryptionError(
652
- f"Repository '{repo_id}' requires encryption, but no encryption_key was provided. "
653
- "Please provide an encryption_key parameter."
654
- )
655
- print(f"Repository is encrypted. File will be encrypted before upload.")
656
-
612
+ is_encrypted = bool(encryption_key)
657
613
  # 构建 Git URL
658
614
  git_url = _build_git_url(
659
615
  base_url=base_url,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xiaoshiai-hub
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Python SDK for XiaoShi AI Hub - Upload, download, and manage AI models and datasets with encryption support
5
5
  Home-page: https://github.com/poxiaoyun/moha-sdk
6
6
  Author: XiaoShi AI
@@ -4,9 +4,9 @@ xiaoshiai_hub/download.py,sha256=9w17b62Pl-AJsZiIyWFsVTZD2h7Laz68yIjmTk_J3II,213
4
4
  xiaoshiai_hub/encryption.py,sha256=1DDOwjrZ0SBJaEPkzF8UnW4Xy1-GlBXxFYRwKdZ1UwY,24829
5
5
  xiaoshiai_hub/exceptions.py,sha256=OVxCzbRICqQKOF10yt1COTXnjxkGH51g72a21eJU6Vc,795
6
6
  xiaoshiai_hub/types.py,sha256=PGhdIc0ztl_vAKDaPkkZeFZjIXnPL81Tn65rAjedXoM,2262
7
- xiaoshiai_hub/upload.py,sha256=Owl0-KTy0rY1eDnnht0a5HxKydv0rKexZOySSU32T0A,32332
8
- xiaoshiai_hub-0.1.1.dist-info/licenses/LICENSE,sha256=tS28u6VpvqNisRWGeufp-XYQc6p194vOGARl3OIjidA,9110
9
- xiaoshiai_hub-0.1.1.dist-info/METADATA,sha256=KdCrmv_5PaomYJhDs_jDCgF6WhWmuB3mJHa2yuME9Yo,15222
10
- xiaoshiai_hub-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- xiaoshiai_hub-0.1.1.dist-info/top_level.txt,sha256=9AQDFb5Xn7RLQPdbk1aA0QpntbKhlhlT6Z_g-zUBtlM,14
12
- xiaoshiai_hub-0.1.1.dist-info/RECORD,,
7
+ xiaoshiai_hub/upload.py,sha256=DxG0uMVqqcXXfDazbOacgEnbmwY7NOks9MC5McGbgOw,30747
8
+ xiaoshiai_hub-0.1.2.dist-info/licenses/LICENSE,sha256=tS28u6VpvqNisRWGeufp-XYQc6p194vOGARl3OIjidA,9110
9
+ xiaoshiai_hub-0.1.2.dist-info/METADATA,sha256=_YdF3488aN4k1oLOrc5RI7MpjlhEDy2ZIYhv_NO9XkQ,15222
10
+ xiaoshiai_hub-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ xiaoshiai_hub-0.1.2.dist-info/top_level.txt,sha256=9AQDFb5Xn7RLQPdbk1aA0QpntbKhlhlT6Z_g-zUBtlM,14
12
+ xiaoshiai_hub-0.1.2.dist-info/RECORD,,