qbraid-cli 0.9.8__py3-none-any.whl → 0.9.10__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.

Potentially problematic release.


This version of qbraid-cli might be problematic. Click here for more details.

qbraid_cli/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.9.8'
16
- __version_tuple__ = version_tuple = (0, 9, 8)
15
+ __version__ = version = '0.9.10'
16
+ __version_tuple__ = version_tuple = (0, 9, 10)
@@ -170,7 +170,7 @@ def check_and_fix_headers(
170
170
  failed_headers.append(file_path)
171
171
  else:
172
172
  # Form the new content by combining the header, one blank line, and the actual content
173
- new_content = updated_header.strip() + "\n\n" + actual_content
173
+ new_content = updated_header.strip() + "\n\n" + actual_content + "\n"
174
174
  with open(file_path, "w", encoding="ISO-8859-1") as f:
175
175
  f.write(new_content)
176
176
  fixed_headers.append(file_path)
@@ -37,6 +37,8 @@ def validate_input(key: str, value: str) -> str:
37
37
  Raises:
38
38
  typer.BadParameter: If the value is invalid
39
39
  """
40
+ value = value.strip()
41
+
40
42
  if key == "url":
41
43
  if not re.match(r"^https?://\S+$", value):
42
44
  raise typer.BadParameter("Invalid URL format.")
@@ -44,7 +46,7 @@ def validate_input(key: str, value: str) -> str:
44
46
  if not re.match(r"^\S+@\S+\.\S+$", value):
45
47
  raise typer.BadParameter("Invalid email format.")
46
48
  elif key == "api-key":
47
- if not (re.match(r"^[a-zA-Z0-9]{11}$", value) or re.match(r"^[a-zA-Z0-9]{30}$", value)):
49
+ if not re.match(r"^[a-zA-Z0-9]+$", value):
48
50
  raise typer.BadParameter("Invalid API key format.")
49
51
  return value
50
52
 
qbraid_cli/files/app.py CHANGED
@@ -12,11 +12,29 @@ from typing import Any
12
12
  import rich
13
13
  import typer
14
14
 
15
- from qbraid_cli.handlers import run_progress_task
15
+ from qbraid_cli.handlers import handle_error, run_progress_task
16
16
 
17
17
  files_app = typer.Typer(help="Manage qBraid cloud storage files.", no_args_is_help=True)
18
18
 
19
19
 
20
+ def is_file_less_than_10mb(file_path: Path) -> bool:
21
+ """
22
+ Check if the given file is less than 10MB in size.
23
+
24
+ Args:
25
+ file_path (Path): The path to the file to check.
26
+
27
+ Returns:
28
+ bool: True if the file is less than 10MB, False otherwise.
29
+ """
30
+ TEN_MB = 10 * 1024 * 1024 # 10 * 1024 KB * 1024 bytes
31
+
32
+ try:
33
+ return file_path.stat().st_size < TEN_MB
34
+ except OSError:
35
+ return False
36
+
37
+
20
38
  @files_app.command(name="upload")
21
39
  def files_upload(
22
40
  filepath: Path = typer.Argument(
@@ -47,6 +65,9 @@ def files_upload(
47
65
  ):
48
66
  """Upload a local file to qBraid storage."""
49
67
 
68
+ if not is_file_less_than_10mb(filepath):
69
+ handle_error("Error", "File too large. Must be less than 10MB for direct upload.")
70
+
50
71
  def upload_file() -> dict[str, Any]:
51
72
  from qbraid_core.services.files import FileManagerClient
52
73
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: qbraid-cli
3
- Version: 0.9.8
3
+ Version: 0.9.10
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License: Proprietary
@@ -1,5 +1,5 @@
1
1
  qbraid_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- qbraid_cli/_version.py,sha256=HCqmWCJasxls6nB23BHnWwFwN-LPuu_aZ_2LEt0rXRk,411
2
+ qbraid_cli/_version.py,sha256=kAkjSYToVabqGkP6bYAKkSoV5aHCv-7NbDEGfABB4V0,413
3
3
  qbraid_cli/exceptions.py,sha256=KjlhYJhSHMVazaNiBjD_Ur06w4sekP8zRsFzBdyIpno,672
4
4
  qbraid_cli/handlers.py,sha256=B9H1Qw6yx8izrqp9OGR2TgSJa_mxA8KLXUkX8LB7Feg,7650
5
5
  qbraid_cli/main.py,sha256=aSOQyoRRvKBJBcx8VtU4zKZ2WHvGKHhw8I-WiRwPxcE,3926
@@ -8,12 +8,12 @@ qbraid_cli/account/__init__.py,sha256=smlpUcVkM3QEbJG0norGM7i71XBJlUGQYByswTfPnm
8
8
  qbraid_cli/account/app.py,sha256=1UogauwgX0Hnr7H6cBV2Qv-lT6aRpRLAimCyLi0afGI,1843
9
9
  qbraid_cli/admin/__init__.py,sha256=qcWD5mQEUCtr49mrUpZmk7eGDe0L_Gtc8RwZmzIXSwo,175
10
10
  qbraid_cli/admin/app.py,sha256=YOVLUjKysUcvnhJF2HAhVHVKDNUJeZ-uMV81uQdzxkk,1519
11
- qbraid_cli/admin/headers.py,sha256=kbrJTMf0JuO5yjZGiVwFhMhrzyAfLEeCXclMHwBcT68,8384
11
+ qbraid_cli/admin/headers.py,sha256=syrajRqyWM_e4luyBBkBdFySoZHUfTLYeAf4BpM2C9E,8391
12
12
  qbraid_cli/admin/validation.py,sha256=fhpttxupCGBk56ExQPuuQm8nMnptLLy_8sj-EjpM8g0,729
13
13
  qbraid_cli/chat/__init__.py,sha256=NO41vndEdfr0vDynNcmHFh-nhzWjnWqGm4M9parikck,258
14
14
  qbraid_cli/chat/app.py,sha256=-YqCLGDh4ezF149xB3dfuUAQotKAklZwYp0BL3HhA90,2256
15
15
  qbraid_cli/configure/__init__.py,sha256=YaJ74Ztz2vl3eYp8_jVBucWkXscxz7EZEIzr70OfuOM,187
16
- qbraid_cli/configure/actions.py,sha256=l5xiHONIQOnzSZ6v8yXveFfGK5cJDYRMkfgEwxwR0wg,3240
16
+ qbraid_cli/configure/actions.py,sha256=-Kx1_Zz8EV2JFaMdSUWR-VZ1MeJSMMPSuzgtUTinDZw,3221
17
17
  qbraid_cli/configure/app.py,sha256=7UN8Bje0n_s2nDE-cHid8VwOp7gl0jjw9gldyCcZNhI,4164
18
18
  qbraid_cli/devices/__init__.py,sha256=hiScO-px6jCL5cJj5Hbty55EUfNejTO4bmqUZuS3aqc,181
19
19
  qbraid_cli/devices/app.py,sha256=q8AQ8o05JXODsaFR_16_S3UtLWPzwC2qi0bVw2h7RJ8,2543
@@ -24,7 +24,7 @@ qbraid_cli/envs/app.py,sha256=c3O5fB6PThCXS2hyYMHrj8YvvEJaI-_8NZd_GN_4iZ0,9972
24
24
  qbraid_cli/envs/create.py,sha256=xudzkLCNegY34zkXN_Vfl_0zVzg_tW83LcVx9quoWfU,988
25
25
  qbraid_cli/envs/data_handling.py,sha256=Ibnp2yJoUDpivb_sNqi0suYgJZNat_LmM6Ya0Ovez5s,1288
26
26
  qbraid_cli/files/__init__.py,sha256=3_yhgFoNcviEtS6B75uJBrfFFUjsrMcccCNEntJ54xU,175
27
- qbraid_cli/files/app.py,sha256=PoJAyfd1Y2OJm9wKNjbnzbouVOmOnrYeLWforOSFwgA,3182
27
+ qbraid_cli/files/app.py,sha256=Z766FqYne2bDJGYW7EWx8ZwemQyhNNU_AtCnAV8x3X8,3767
28
28
  qbraid_cli/jobs/__init__.py,sha256=qVLRHYIzP4XHpx_QWP_vCzd3LsCscCORaEx-Vcbx29U,172
29
29
  qbraid_cli/jobs/app.py,sha256=LnrxALu7OWSUg1FD6FvlGsILdoH46Y-ra12eiSfiMlE,4938
30
30
  qbraid_cli/jobs/toggle_braket.py,sha256=3AEu-Z5q4avduB-fJMyMTVTuyZXuA8m-hnvi325wIv4,7444
@@ -34,9 +34,9 @@ qbraid_cli/kernels/app.py,sha256=n-iyWJHy7_ML6qk4pp-v_rQkGA7WfnZMG8gyiCFGO1c,294
34
34
  qbraid_cli/pip/__init__.py,sha256=tJtU0rxn-ODogNh5Y4pp_BgDQXMN-3JY1QGj0OZHwjQ,169
35
35
  qbraid_cli/pip/app.py,sha256=jkk-djductrDOJIRYfHK_7WDJ12f0zOT3MMkiZp97oM,1365
36
36
  qbraid_cli/pip/hooks.py,sha256=jkIeev3cOd-cmaoJSdSqbmhTYCs6z1we84FMqa3ZoZw,2124
37
- qbraid_cli-0.9.8.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
38
- qbraid_cli-0.9.8.dist-info/METADATA,sha256=WELgM3AY3Fp4Td6kcjU-UF6InKiulGcNaP4zy9Yw7zU,7525
39
- qbraid_cli-0.9.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
40
- qbraid_cli-0.9.8.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
41
- qbraid_cli-0.9.8.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
42
- qbraid_cli-0.9.8.dist-info/RECORD,,
37
+ qbraid_cli-0.9.10.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
38
+ qbraid_cli-0.9.10.dist-info/METADATA,sha256=qQZOR8C-CJff4fjdDoljFmm9GiBMdKWXpRbjON21n7g,7526
39
+ qbraid_cli-0.9.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
40
+ qbraid_cli-0.9.10.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
41
+ qbraid_cli-0.9.10.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
42
+ qbraid_cli-0.9.10.dist-info/RECORD,,