qbraid-cli 0.9.9__py3-none-any.whl → 0.10.0__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.9'
16
- __version_tuple__ = version_tuple = (0, 9, 9)
15
+ __version__ = version = '0.10.0'
16
+ __version_tuple__ = version_tuple = (0, 10, 0)
qbraid_cli/admin/app.py CHANGED
@@ -35,7 +35,7 @@ def admin_headers(
35
35
  False, "--fix", "-f", help="Whether to fix the headers instead of just verifying."
36
36
  ),
37
37
  project_name: Optional[str] = typer.Option(
38
- "the qBraid-SDK", "--project", "-p", help="Name of the project to use in the header."
38
+ None, "--project", "-p", help="Name of the project to use in the header."
39
39
  ),
40
40
  ):
41
41
  """
@@ -10,6 +10,7 @@ Script to verify qBraid copyright file headers
10
10
 
11
11
  import datetime
12
12
  import os
13
+ import warnings
13
14
  from enum import Enum
14
15
  from pathlib import Path
15
16
  from typing import Optional
@@ -36,6 +37,8 @@ class HeaderType(Enum):
36
37
 
37
38
  default = "default" # pylint: disable=invalid-name
38
39
  gpl = "gpl" # pylint: disable=invalid-name
40
+ apache = "apache" # pylint: disable=invalid-name
41
+ mit = "mit" # pylint: disable=invalid-name
39
42
 
40
43
 
41
44
  DEFAULT_HEADER = f"""# Copyright (c) {CURR_YEAR}, qBraid Development Team
@@ -53,13 +56,53 @@ DEFAULT_HEADER_GPL = f"""# Copyright (C) {CURR_YEAR} qBraid
53
56
  # THERE IS NO WARRANTY for {{project_name}}, as per Section 15 of the GPL v3.
54
57
  """
55
58
 
59
+ DEFAULT_HEADER_APACHE = f"""# Copyright {CURR_YEAR} qBraid
60
+ #
61
+ # Licensed under the Apache License, Version 2.0 (the "License");
62
+ # you may not use this file except in compliance with the License.
63
+ # You may obtain a copy of the License at
64
+ #
65
+ # http://www.apache.org/licenses/LICENSE-2.0
66
+ #
67
+ # Unless required by applicable law or agreed to in writing, software
68
+ # distributed under the License is distributed on an "AS IS" BASIS,
69
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70
+ # See the License for the specific language governing permissions and
71
+ # limitations under the License.
72
+ """
73
+
74
+ DEFAULT_HEADER_MIT = f"""# MIT License
75
+ #
76
+ # Copyright (c) {CURR_YEAR} qBraid
77
+ #
78
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
79
+ # of this software and associated documentation files (the "Software"), to deal
80
+ # in the Software without restriction, including without limitation the rights
81
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
82
+ # copies of the Software, and to permit persons to whom the Software is
83
+ # furnished to do so, subject to the following conditions:
84
+ #
85
+ # The above copyright notice and this permission notice shall be included in all
86
+ # copies or substantial portions of the Software.
87
+ #
88
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
89
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
90
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
91
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
92
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
93
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
94
+ # SOFTWARE.
95
+ """
96
+
56
97
  HEADER_TYPES = {
57
98
  HeaderType.default: DEFAULT_HEADER,
58
99
  HeaderType.gpl: DEFAULT_HEADER_GPL,
100
+ HeaderType.apache: DEFAULT_HEADER_APACHE,
101
+ HeaderType.mit: DEFAULT_HEADER_MIT,
59
102
  }
60
103
 
61
104
 
62
- def get_formatted_header(header_type: HeaderType, project_name: str) -> str:
105
+ def get_formatted_header(header_type: HeaderType, project_name: Optional[str] = None) -> str:
63
106
  """Get the formatted header based on the header type
64
107
 
65
108
  Args:
@@ -72,12 +115,19 @@ def get_formatted_header(header_type: HeaderType, project_name: str) -> str:
72
115
 
73
116
  header = HEADER_TYPES[header_type]
74
117
  if header_type == HeaderType.gpl:
118
+ if project_name is None:
119
+ raise ValueError("Project name is required for GPL header")
120
+
75
121
  if project_name.split(" ")[0].lower() == "the":
76
122
  project_name = project_name[:1].lower() + project_name[1:]
77
123
  project_name_start = project_name[:1].upper() + project_name[1:]
78
124
  else:
79
125
  project_name_start = project_name
80
126
  return header.format(project_name=project_name, project_name_start=project_name_start)
127
+
128
+ if project_name is not None:
129
+ warnings.warn(f"Project name is not used for header type '{header_type}'.", UserWarning)
130
+
81
131
  return header
82
132
 
83
133
 
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.9
3
+ Version: 0.10.0
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=SCXpMp2HEwJwhdMfY_gL7FqQBKfudVAGv6v5eiwbTdM,411
2
+ qbraid_cli/_version.py,sha256=D9FzgOn4bdjik_advMRtDDR32aJiX9xm30TIiWkqKLs,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
@@ -7,8 +7,8 @@ qbraid_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  qbraid_cli/account/__init__.py,sha256=smlpUcVkM3QEbJG0norGM7i71XBJlUGQYByswTfPnmg,181
8
8
  qbraid_cli/account/app.py,sha256=1UogauwgX0Hnr7H6cBV2Qv-lT6aRpRLAimCyLi0afGI,1843
9
9
  qbraid_cli/admin/__init__.py,sha256=qcWD5mQEUCtr49mrUpZmk7eGDe0L_Gtc8RwZmzIXSwo,175
10
- qbraid_cli/admin/app.py,sha256=YOVLUjKysUcvnhJF2HAhVHVKDNUJeZ-uMV81uQdzxkk,1519
11
- qbraid_cli/admin/headers.py,sha256=syrajRqyWM_e4luyBBkBdFySoZHUfTLYeAf4BpM2C9E,8391
10
+ qbraid_cli/admin/app.py,sha256=nB08pHAHwsTT-0pPPyoT8plYJ7suMsjQC4G6GQV1m6g,1507
11
+ qbraid_cli/admin/headers.py,sha256=6a27UMf6K1enadigMOkmD3L1OXoD1ajK8xvUbsYV27o,10600
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
@@ -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.9.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
38
- qbraid_cli-0.9.9.dist-info/METADATA,sha256=oxhlVMys_Y5IsvI72XgtZclQ23RsQC0HmelncNciqlk,7525
39
- qbraid_cli-0.9.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
40
- qbraid_cli-0.9.9.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
41
- qbraid_cli-0.9.9.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
42
- qbraid_cli-0.9.9.dist-info/RECORD,,
37
+ qbraid_cli-0.10.0.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
38
+ qbraid_cli-0.10.0.dist-info/METADATA,sha256=N4gN2Lmw1Q0bqoHES9fJ5yPZEmCbjtc3kowz4whm6eU,7526
39
+ qbraid_cli-0.10.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
40
+ qbraid_cli-0.10.0.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
41
+ qbraid_cli-0.10.0.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
42
+ qbraid_cli-0.10.0.dist-info/RECORD,,