qbraid-cli 0.8.4__py3-none-any.whl → 0.8.4a0__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 +1 -1
- qbraid_cli/envs/create.py +8 -4
- qbraid_cli/kernels/app.py +14 -32
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/METADATA +3 -2
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/RECORD +9 -9
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/WHEEL +1 -1
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/LICENSE +0 -0
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/entry_points.txt +0 -0
- {qbraid_cli-0.8.4.dist-info → qbraid_cli-0.8.4a0.dist-info}/top_level.txt +0 -0
qbraid_cli/_version.py
CHANGED
qbraid_cli/envs/create.py
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
Module supporting 'qbraid envs create' command.
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
|
+
import json
|
|
9
|
+
import os
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
8
12
|
|
|
9
13
|
|
|
10
14
|
def create_venv(*args, **kwargs) -> None:
|
|
@@ -16,14 +20,14 @@ def create_venv(*args, **kwargs) -> None:
|
|
|
16
20
|
|
|
17
21
|
def update_state_json(*ags, **kwargs) -> None:
|
|
18
22
|
"""Update the state.json file for the qBraid environment."""
|
|
19
|
-
from qbraid_core.services.environments.state import
|
|
23
|
+
from qbraid_core.services.environments.state import update_install_status
|
|
20
24
|
|
|
21
|
-
return
|
|
25
|
+
return update_install_status(*ags, **kwargs)
|
|
22
26
|
|
|
23
27
|
|
|
24
28
|
def create_qbraid_env_assets(slug: str, alias: str, kernel_name: str, slug_path: str) -> None:
|
|
25
29
|
"""Create a qBraid environment including python venv, PS1 configs,
|
|
26
30
|
kernel resource files, and qBraid state.json."""
|
|
27
|
-
from qbraid_core.services.environments.create import create_qbraid_env_assets
|
|
31
|
+
from qbraid_core.services.environments.create import create_qbraid_env_assets
|
|
28
32
|
|
|
29
|
-
return
|
|
33
|
+
return create_qbraid_env_assets(slug, alias, kernel_name, slug_path)
|
qbraid_cli/kernels/app.py
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
"""
|
|
5
|
-
Module defining commands in the 'qbraid
|
|
5
|
+
Module defining commands in the 'qbraid jobs' namespace.
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
8
10
|
import typer
|
|
11
|
+
from qbraid_core.services.environments.kernels import add_kernels, list_kernels, remove_kernels
|
|
9
12
|
from rich.console import Console
|
|
10
13
|
|
|
11
14
|
from qbraid_cli.handlers import handle_error
|
|
@@ -16,11 +19,9 @@ kernels_app = typer.Typer(help="Manage qBraid kernels.")
|
|
|
16
19
|
@kernels_app.command(name="list")
|
|
17
20
|
def kernels_list():
|
|
18
21
|
"""List all available kernels."""
|
|
19
|
-
from qbraid_core.services.environments.kernels import get_all_kernels
|
|
20
|
-
|
|
21
22
|
console = Console()
|
|
22
23
|
# Get the list of kernelspecs
|
|
23
|
-
kernelspecs
|
|
24
|
+
kernelspecs = list_kernels()
|
|
24
25
|
|
|
25
26
|
if len(kernelspecs) == 0:
|
|
26
27
|
console.print("No qBraid kernels are active.")
|
|
@@ -30,25 +31,16 @@ def kernels_list():
|
|
|
30
31
|
longest_kernel_name = max(len(kernel_name) for kernel_name in kernelspecs)
|
|
31
32
|
spacing = longest_kernel_name + 10
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
output_lines.append("# qbraid kernels:")
|
|
35
|
-
output_lines.append("#")
|
|
36
|
-
output_lines.append("")
|
|
34
|
+
console.print("# qbraid kernels:\n#\n")
|
|
37
35
|
|
|
38
36
|
# Ensure 'python3' kernel is printed first if it exists
|
|
39
37
|
default_kernel_name = "python3"
|
|
40
38
|
python3_kernel_info = kernelspecs.pop(default_kernel_name, None)
|
|
41
39
|
if python3_kernel_info:
|
|
42
|
-
|
|
43
|
-
output_lines.append(line)
|
|
40
|
+
console.print(f"{default_kernel_name.ljust(spacing)}{python3_kernel_info['resource_dir']}")
|
|
44
41
|
# print rest of the kernels
|
|
45
42
|
for kernel_name, kernel_info in sorted(kernelspecs.items()):
|
|
46
|
-
|
|
47
|
-
output_lines.append(line)
|
|
48
|
-
|
|
49
|
-
final_output = "\n".join(output_lines)
|
|
50
|
-
|
|
51
|
-
console.print(final_output)
|
|
43
|
+
console.print(f"{kernel_name.ljust(spacing)}{kernel_info['resource_dir']}")
|
|
52
44
|
|
|
53
45
|
|
|
54
46
|
@kernels_app.command(name="add")
|
|
@@ -58,18 +50,15 @@ def kernels_add(
|
|
|
58
50
|
)
|
|
59
51
|
):
|
|
60
52
|
"""Add a kernel."""
|
|
61
|
-
from qbraid_core.services.environments.kernels import add_kernels
|
|
62
53
|
|
|
63
54
|
try:
|
|
64
55
|
add_kernels(environment)
|
|
65
|
-
except ValueError:
|
|
56
|
+
except ValueError as e:
|
|
66
57
|
handle_error(
|
|
67
|
-
message=
|
|
68
|
-
include_traceback=
|
|
58
|
+
message=e,
|
|
59
|
+
include_traceback=False,
|
|
69
60
|
)
|
|
70
|
-
|
|
71
|
-
console = Console()
|
|
72
|
-
console.print(f"\nSuccessfully added '{environment}' kernel(s).", highlight=False)
|
|
61
|
+
return
|
|
73
62
|
|
|
74
63
|
|
|
75
64
|
@kernels_app.command(name="remove")
|
|
@@ -80,18 +69,11 @@ def kernels_remove(
|
|
|
80
69
|
)
|
|
81
70
|
):
|
|
82
71
|
"""Remove a kernel."""
|
|
83
|
-
from qbraid_core.services.environments.kernels import remove_kernels
|
|
84
|
-
|
|
85
72
|
try:
|
|
86
73
|
remove_kernels(environment)
|
|
87
74
|
except ValueError:
|
|
88
|
-
handle_error(
|
|
89
|
-
|
|
90
|
-
include_traceback=True,
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
console = Console()
|
|
94
|
-
console.print(f"\nSuccessfully removed '{environment}' kernel(s).", highlight=False)
|
|
75
|
+
handle_error(message=f"Environment '{environment}' not found.", include_traceback=False)
|
|
76
|
+
return
|
|
95
77
|
|
|
96
78
|
|
|
97
79
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.4a0
|
|
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
|
|
@@ -8,6 +8,7 @@ Project-URL: Homepage, https://docs.qbraid.com/cli/user-guide/overview
|
|
|
8
8
|
Project-URL: Documentation, https://docs.qbraid.com/cli/api-reference/qbraid
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/qBraid/community/issues
|
|
10
10
|
Project-URL: Discord, https://discord.gg/KugF6Cnncm
|
|
11
|
+
Project-URL: Launch on Lab, https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/.git
|
|
11
12
|
Keywords: qbraid,cli,quantum,cloud
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Intended Audience :: Developers
|
|
@@ -28,7 +29,7 @@ Description-Content-Type: text/markdown
|
|
|
28
29
|
License-File: LICENSE
|
|
29
30
|
Requires-Dist: typer >=0.12.1
|
|
30
31
|
Requires-Dist: rich >=10.11.0
|
|
31
|
-
Requires-Dist: qbraid-core[environments]
|
|
32
|
+
Requires-Dist: qbraid-core[environments] ==0.1.17a0
|
|
32
33
|
Provides-Extra: dev
|
|
33
34
|
Requires-Dist: ruff ; extra == 'dev'
|
|
34
35
|
Requires-Dist: isort ; extra == 'dev'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
qbraid_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
qbraid_cli/_version.py,sha256=
|
|
2
|
+
qbraid_cli/_version.py,sha256=DwxZYWf2zCv6KexzcADTVsrPQT7fKqDMptvMyhll1Ug,413
|
|
3
3
|
qbraid_cli/exceptions.py,sha256=KjlhYJhSHMVazaNiBjD_Ur06w4sekP8zRsFzBdyIpno,672
|
|
4
4
|
qbraid_cli/handlers.py,sha256=glxTEwxax3zKgYl9qsZ2evZXgrWQrseJS_OGyHTMFeA,7040
|
|
5
5
|
qbraid_cli/main.py,sha256=AR6qp2hU_3OEg1_RxRSfZkO2ZC3H4z-dz3hzaqeAl-I,2620
|
|
@@ -20,20 +20,20 @@ qbraid_cli/devices/validation.py,sha256=YhShyUufgrKnx2XjXOXF-PqFJYklJT9CgeqIwKcN
|
|
|
20
20
|
qbraid_cli/envs/__init__.py,sha256=1-cMvrATsddYxcetPJWxq6bEOqJWMktGdhoZ4qm8euA,172
|
|
21
21
|
qbraid_cli/envs/activate.py,sha256=VpvVYSfQDlcmlNWJOgkLIQ2p8YXPPLG8Jbl5t8GHUDw,2140
|
|
22
22
|
qbraid_cli/envs/app.py,sha256=m1obCHrTqSPD8CF2v-jV7ZoCXdRyky1oZHl7NR2EAG4,8447
|
|
23
|
-
qbraid_cli/envs/create.py,sha256=
|
|
23
|
+
qbraid_cli/envs/create.py,sha256=GlVMPK_Rurvj03tPzdVBD1HtTkz9_LfiH_tXC6PbZ1Q,1026
|
|
24
24
|
qbraid_cli/envs/data_handling.py,sha256=Ibnp2yJoUDpivb_sNqi0suYgJZNat_LmM6Ya0Ovez5s,1288
|
|
25
25
|
qbraid_cli/jobs/__init__.py,sha256=qVLRHYIzP4XHpx_QWP_vCzd3LsCscCORaEx-Vcbx29U,172
|
|
26
26
|
qbraid_cli/jobs/app.py,sha256=kmg9mYla3Nd7EdjQlFu7IOvm7sejLNfPPA6Qeet-IfE,4898
|
|
27
27
|
qbraid_cli/jobs/toggle_braket.py,sha256=QVW69MkFyhMZWg_Cl48GgScC084aAG3EgYbyy-PGkqI,6756
|
|
28
28
|
qbraid_cli/jobs/validation.py,sha256=xNbjUggMhUs4wzkuRm4PuFPi_wrElYicUgYXLznHz3U,2983
|
|
29
29
|
qbraid_cli/kernels/__init__.py,sha256=jORS9vV17s5laQyq8gSVB18EPBImgEIbMZ1wKC094DA,181
|
|
30
|
-
qbraid_cli/kernels/app.py,sha256=
|
|
30
|
+
qbraid_cli/kernels/app.py,sha256=PgTd_hPYEKa3AxCsE3LHC5nISx4aqcGvftXVIHmoX-c,2282
|
|
31
31
|
qbraid_cli/pip/__init__.py,sha256=tJtU0rxn-ODogNh5Y4pp_BgDQXMN-3JY1QGj0OZHwjQ,169
|
|
32
32
|
qbraid_cli/pip/app.py,sha256=Cer_Tteo_k26bTNiLUX2k-XhdSU3wKuj9ZLubbGv7r4,1439
|
|
33
33
|
qbraid_cli/pip/hooks.py,sha256=KuDHmntPXVK8tSb4MLk9VANhL-eINswhLd8_g_25WMY,2123
|
|
34
|
-
qbraid_cli-0.8.
|
|
35
|
-
qbraid_cli-0.8.
|
|
36
|
-
qbraid_cli-0.8.
|
|
37
|
-
qbraid_cli-0.8.
|
|
38
|
-
qbraid_cli-0.8.
|
|
39
|
-
qbraid_cli-0.8.
|
|
34
|
+
qbraid_cli-0.8.4a0.dist-info/LICENSE,sha256=P1gi-ofB8lmkRt_mxDoJpcgQq9Ckq9WhRAS1oYk-G1s,2506
|
|
35
|
+
qbraid_cli-0.8.4a0.dist-info/METADATA,sha256=u37RFYpijtSZNSW-KO2GEHrx8Rb1yjHAec3jTfVQSj4,6816
|
|
36
|
+
qbraid_cli-0.8.4a0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
37
|
+
qbraid_cli-0.8.4a0.dist-info/entry_points.txt,sha256=c5ZJ7NjbxhDqMpou9q5F03_b_KG34HzFDijIDmEIwgQ,47
|
|
38
|
+
qbraid_cli-0.8.4a0.dist-info/top_level.txt,sha256=LTYJgeYSCHo9Il8vZu0yIPuGdGyNaIw6iRy6BeoZo8o,11
|
|
39
|
+
qbraid_cli-0.8.4a0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|