qbraid-cli 0.9.0__tar.gz → 0.9.0a0__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.
Potentially problematic release.
This version of qbraid-cli might be problematic. Click here for more details.
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/CONTRIBUTING.md +0 -6
- {qbraid_cli-0.9.0/qbraid_cli.egg-info → qbraid_cli-0.9.0a0}/PKG-INFO +2 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/pyproject.toml +2 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/_version.py +2 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/account/app.py +1 -1
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/app.py +1 -1
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/app.py +3 -3
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/handlers.py +0 -4
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/app.py +1 -1
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/toggle_braket.py +1 -1
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/main.py +1 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0/qbraid_cli.egg-info}/PKG-INFO +2 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/SOURCES.txt +0 -2
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/requires.txt +1 -1
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/devices/test_devices_list.py +16 -4
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_list.py +13 -3
- qbraid_cli-0.9.0/.github/workflows/docs-pr.yml +0 -128
- qbraid_cli-0.9.0/tests/conftest.py +0 -35
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.env.example +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/bump-version.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/docs.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/format.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/main.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/pre-release.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/publish.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.github/workflows/tag-on-merge.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.gitignore +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/.readthedocs.yml +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/LICENSE +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/MANIFEST.IN +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/Makefile +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/README.md +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/Makefile +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/conf.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/index.rst +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/make.bat +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/docs/requirements.txt +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/validation.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/setup.cfg +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/account/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/account/test_account_credits.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/admin/test_headers.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/configure/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_prompt_for_config.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_set.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_validate_input.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/devices/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/devices/test_devices_validations.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_print_command.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_pyenv.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_list.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_remove.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_disable.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_enable.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_state.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_get_state.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_library.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/kernels/__init__.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tests/kernels/test_kernels_list.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/bump_version.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/create_dev_build.sh +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/install_wheel_extras.sh +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/split_md.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/split_rst.py +0 -0
- {qbraid_cli-0.9.0 → qbraid_cli-0.9.0a0}/tools/stamp_pre_release.py +0 -0
|
@@ -39,12 +39,6 @@ To view available `make` commands, run:
|
|
|
39
39
|
make help
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
To test out changes on the command line with re-installing each time:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
python3 qbraid_cli/main.py [OPTIONS] COMMAND [ARGS]...
|
|
46
|
-
```
|
|
47
|
-
|
|
48
42
|
## Testing
|
|
49
43
|
|
|
50
44
|
Install test dependencies:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.0a0
|
|
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
|
|
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
Requires-Dist: typer>=0.12.1
|
|
31
31
|
Requires-Dist: rich>=10.11.0
|
|
32
|
-
Requires-Dist: qbraid-core>=0.1.
|
|
32
|
+
Requires-Dist: qbraid-core>=0.1.28
|
|
33
33
|
Provides-Extra: jobs
|
|
34
34
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
35
|
Provides-Extra: envs
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.0a0"
|
|
8
8
|
description = "Command Line Interface for interacting with all parts of the qBraid platform."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
|
|
@@ -30,7 +30,7 @@ classifiers = [
|
|
|
30
30
|
dependencies = [
|
|
31
31
|
"typer>=0.12.1",
|
|
32
32
|
"rich>=10.11.0",
|
|
33
|
-
"qbraid-core>=0.1.
|
|
33
|
+
"qbraid-core>=0.1.28",
|
|
34
34
|
]
|
|
35
35
|
requires-python = ">= 3.9"
|
|
36
36
|
|
|
@@ -12,5 +12,5 @@ __version__: str
|
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
|
13
13
|
version_tuple: VERSION_TUPLE
|
|
14
14
|
|
|
15
|
-
__version__ = version = '0.1.dev1+
|
|
16
|
-
__version_tuple__ = version_tuple = (0, 1, 'dev1', '
|
|
15
|
+
__version__ = version = '0.1.dev1+ge41229b.d20241106'
|
|
16
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'ge41229b.d20241106')
|
|
@@ -28,7 +28,7 @@ def account_credits():
|
|
|
28
28
|
|
|
29
29
|
qbraid_credits: float = run_progress_task(get_credits)
|
|
30
30
|
typer.secho(
|
|
31
|
-
f"{typer.style('qBraid credits remaining:')} "
|
|
31
|
+
f"\n{typer.style('qBraid credits remaining:')} "
|
|
32
32
|
f"{typer.style(f'{qbraid_credits:.4f}', fg=typer.colors.MAGENTA, bold=True)}",
|
|
33
33
|
nl=True, # Ensure a newline after output (default is True)
|
|
34
34
|
)
|
|
@@ -60,7 +60,7 @@ def devices_list( # pylint: disable=too-many-branches
|
|
|
60
60
|
header_3 = "ID"
|
|
61
61
|
header_4 = "Status"
|
|
62
62
|
console.print(
|
|
63
|
-
f"[bold]{header_1.ljust(12)}{header_2.ljust(35)}{header_3.ljust(41)}{header_4}[/bold]"
|
|
63
|
+
f"\n[bold]{header_1.ljust(12)}{header_2.ljust(35)}{header_3.ljust(41)}{header_4}[/bold]"
|
|
64
64
|
)
|
|
65
65
|
for device_provider, device_name, device_id, device_status in device_data:
|
|
66
66
|
if device_status == "ONLINE":
|
|
@@ -88,7 +88,7 @@ def envs_create( # pylint: disable=too-many-statements
|
|
|
88
88
|
slug_path = env_path / slug
|
|
89
89
|
description = "None" if description == "" else description
|
|
90
90
|
|
|
91
|
-
typer.echo("## qBraid Metadata ##\n")
|
|
91
|
+
typer.echo("\n\n## qBraid Metadata ##\n")
|
|
92
92
|
typer.echo(f" name: {display_name}")
|
|
93
93
|
typer.echo(f" description: {description}")
|
|
94
94
|
typer.echo(f" tags: {tags}")
|
|
@@ -127,7 +127,7 @@ def envs_create( # pylint: disable=too-many-statements
|
|
|
127
127
|
|
|
128
128
|
console = Console()
|
|
129
129
|
console.print(
|
|
130
|
-
f"[bold green]Successfully created qBraid environment: "
|
|
130
|
+
f"\n[bold green]Successfully created qBraid environment: "
|
|
131
131
|
f"[/bold green][bold magenta]{name}[/bold magenta]\n"
|
|
132
132
|
)
|
|
133
133
|
typer.echo("# To activate this environment, use")
|
|
@@ -192,7 +192,7 @@ def envs_remove(
|
|
|
192
192
|
description="Deleting local environment...",
|
|
193
193
|
error_message="Failed to delete qBraid environment",
|
|
194
194
|
)
|
|
195
|
-
typer.echo(f"
|
|
195
|
+
typer.echo(f"\nEnvironment '{name}' successfully removed.")
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
@envs_app.command(name="list")
|
|
@@ -10,7 +10,6 @@ and executing operations with progress tracking within the qBraid CLI.
|
|
|
10
10
|
import os
|
|
11
11
|
import traceback
|
|
12
12
|
from pathlib import Path
|
|
13
|
-
from time import sleep
|
|
14
13
|
from typing import Any, Callable, Optional, Union
|
|
15
14
|
|
|
16
15
|
import typer
|
|
@@ -130,14 +129,11 @@ def run_progress_task(
|
|
|
130
129
|
try:
|
|
131
130
|
result = operation(*args, **kwargs)
|
|
132
131
|
progress.update(task, completed=100, status="Done")
|
|
133
|
-
sleep(0.15)
|
|
134
132
|
return result
|
|
135
133
|
except Exception as err: # pylint: disable=broad-exception-caught
|
|
136
134
|
progress.update(task, completed=100, status="Failed")
|
|
137
135
|
custom_message = error_message if error_message else str(err)
|
|
138
136
|
return handle_error(message=custom_message)
|
|
139
|
-
finally:
|
|
140
|
-
progress.remove_task(task)
|
|
141
137
|
|
|
142
138
|
|
|
143
139
|
def _format_list_items(items: list[str]) -> str:
|
|
@@ -120,7 +120,7 @@ def jobs_list(
|
|
|
120
120
|
header_1 = "Job ID"
|
|
121
121
|
header_2 = "Submitted"
|
|
122
122
|
header_3 = "Status"
|
|
123
|
-
console.print(f"[bold]{header_1.ljust(spacing)}{header_2.ljust(36)}{header_3}[/bold]")
|
|
123
|
+
console.print(f"\n[bold]{header_1.ljust(spacing)}{header_2.ljust(36)}{header_3}[/bold]")
|
|
124
124
|
for job_id, submitted, status in job_data:
|
|
125
125
|
if status == "COMPLETED":
|
|
126
126
|
status_color = "green"
|
|
@@ -103,7 +103,7 @@ def confirm_updates(
|
|
|
103
103
|
else:
|
|
104
104
|
raise ValueError(f"Invalid mode: {mode}. Expected 'enable' or 'disable'.")
|
|
105
105
|
|
|
106
|
-
typer.echo(f"==> WARNING: {provider}/{core_package} package required <==")
|
|
106
|
+
typer.echo(f"\n==> WARNING: {provider}/{core_package} package required <==")
|
|
107
107
|
if (
|
|
108
108
|
installed_version is not None
|
|
109
109
|
and target_version is not None
|
|
@@ -6,7 +6,6 @@ Entrypoint for the qBraid CLI.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import rich
|
|
10
9
|
import typer
|
|
11
10
|
|
|
12
11
|
from qbraid_cli.account.app import account_app
|
|
@@ -68,7 +67,7 @@ def show_banner():
|
|
|
68
67
|
typer.echo("")
|
|
69
68
|
typer.echo("- Use 'qbraid --version' to see the current version.")
|
|
70
69
|
typer.echo("")
|
|
71
|
-
|
|
70
|
+
typer.echo("Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid")
|
|
72
71
|
|
|
73
72
|
|
|
74
73
|
@app.callback(invoke_without_command=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.0a0
|
|
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
|
|
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
Requires-Dist: typer>=0.12.1
|
|
31
31
|
Requires-Dist: rich>=10.11.0
|
|
32
|
-
Requires-Dist: qbraid-core>=0.1.
|
|
32
|
+
Requires-Dist: qbraid-core>=0.1.28
|
|
33
33
|
Provides-Extra: jobs
|
|
34
34
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
35
|
Provides-Extra: envs
|
|
@@ -11,7 +11,6 @@ pyproject.toml
|
|
|
11
11
|
.github/ISSUE_TEMPLATE/bug_report.yml
|
|
12
12
|
.github/ISSUE_TEMPLATE/feature_request.yml
|
|
13
13
|
.github/workflows/bump-version.yml
|
|
14
|
-
.github/workflows/docs-pr.yml
|
|
15
14
|
.github/workflows/docs.yml
|
|
16
15
|
.github/workflows/format.yml
|
|
17
16
|
.github/workflows/main.yml
|
|
@@ -66,7 +65,6 @@ qbraid_cli/pip/__init__.py
|
|
|
66
65
|
qbraid_cli/pip/app.py
|
|
67
66
|
qbraid_cli/pip/hooks.py
|
|
68
67
|
tests/__init__.py
|
|
69
|
-
tests/conftest.py
|
|
70
68
|
tests/account/__init__.py
|
|
71
69
|
tests/account/test_account_credits.py
|
|
72
70
|
tests/admin/test_headers.py
|
|
@@ -6,20 +6,27 @@ Unit tests for the devices_list function in the devices app.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
import os
|
|
9
10
|
from unittest.mock import MagicMock, patch
|
|
10
11
|
|
|
11
12
|
import pytest
|
|
13
|
+
from qbraid_core import QbraidSession
|
|
12
14
|
from qbraid_core.services.quantum.exceptions import QuantumServiceRequestError
|
|
13
15
|
from typer.testing import CliRunner
|
|
14
16
|
|
|
15
17
|
from qbraid_cli.devices.app import devices_list
|
|
16
18
|
|
|
19
|
+
qbraidrc_path = os.path.join(os.path.expanduser("~"), ".qbraid", "qbraidrc")
|
|
20
|
+
qbraid_api_key = os.getenv("QBRAID_API_KEY")
|
|
21
|
+
|
|
17
22
|
runner = CliRunner()
|
|
18
23
|
|
|
19
24
|
|
|
20
|
-
@pytest.mark.remote
|
|
21
25
|
def test_devices_list_no_results():
|
|
22
26
|
"""Test when no results are returned from the API."""
|
|
27
|
+
session = QbraidSession(api_key=qbraid_api_key)
|
|
28
|
+
session.save_config(api_key=qbraid_api_key)
|
|
29
|
+
|
|
23
30
|
with (
|
|
24
31
|
patch("qbraid_core.services.quantum.process_job_data", return_value=([], 0)),
|
|
25
32
|
patch("rich.console.Console.print") as mock_console_print,
|
|
@@ -28,7 +35,6 @@ def test_devices_list_no_results():
|
|
|
28
35
|
assert "No results matching given criteria" in str(mock_console_print.call_args)
|
|
29
36
|
|
|
30
37
|
|
|
31
|
-
@pytest.mark.remote
|
|
32
38
|
def test_quantum_client_search_devices_failure():
|
|
33
39
|
"""Test that QuantumClient.search_devices correctly raises an exception."""
|
|
34
40
|
with patch(
|
|
@@ -38,12 +44,16 @@ def test_quantum_client_search_devices_failure():
|
|
|
38
44
|
with pytest.raises(QuantumServiceRequestError) as exc_info:
|
|
39
45
|
devices_list()
|
|
40
46
|
|
|
47
|
+
# Assert the expected exception message
|
|
41
48
|
assert str(exc_info.value) == "Failed to fetch device data"
|
|
42
49
|
|
|
43
50
|
|
|
44
|
-
@pytest.mark.remote
|
|
45
51
|
def test_devices_list_error_handling():
|
|
46
52
|
"""Test error handling when an error occurs during device data retrieval."""
|
|
53
|
+
# Setup the initial session configuration
|
|
54
|
+
session = QbraidSession(api_key=qbraid_api_key)
|
|
55
|
+
session.save_config(api_key=qbraid_api_key)
|
|
56
|
+
|
|
47
57
|
with (
|
|
48
58
|
patch("qbraid_cli.handlers.run_progress_task", return_value=(MagicMock(), MagicMock())),
|
|
49
59
|
patch(
|
|
@@ -57,9 +67,11 @@ def test_devices_list_error_handling():
|
|
|
57
67
|
assert str(exc_info.value) == "Failed to fetch device data."
|
|
58
68
|
|
|
59
69
|
|
|
60
|
-
@pytest.mark.remote
|
|
61
70
|
def test_output_formatting_console():
|
|
62
71
|
"""Test the output formatting in the console."""
|
|
72
|
+
session = QbraidSession(api_key=qbraid_api_key)
|
|
73
|
+
session.save_config(api_key=qbraid_api_key)
|
|
74
|
+
|
|
63
75
|
mock_device_data = [("AWS", "Quantum Computer", "dev_123", "ONLINE")]
|
|
64
76
|
|
|
65
77
|
with (
|
|
@@ -6,16 +6,22 @@ Unit tests for the `jobs_list` function in the `qbraid_cli.jobs.app` module.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
import os
|
|
9
10
|
from unittest.mock import patch
|
|
10
11
|
|
|
11
|
-
import
|
|
12
|
+
from qbraid_core import QbraidSession
|
|
12
13
|
|
|
13
14
|
from qbraid_cli.jobs.app import jobs_list
|
|
14
15
|
|
|
16
|
+
qbraidrc_path = os.path.join(os.path.expanduser("~"), ".qbraid", "qbraidrc")
|
|
17
|
+
qbraid_api_key = os.getenv("QBRAID_API_KEY")
|
|
18
|
+
|
|
15
19
|
|
|
16
|
-
@pytest.mark.remote
|
|
17
20
|
def test_jobs_list_with_limit():
|
|
18
21
|
"""Test the `jobs_list` function with a limit parameter."""
|
|
22
|
+
session = QbraidSession(api_key=qbraid_api_key)
|
|
23
|
+
session.save_config(api_key=qbraid_api_key)
|
|
24
|
+
|
|
19
25
|
mock_raw_data = [
|
|
20
26
|
("job_id_1", "2023-03-19 12:00", "COMPLETED"),
|
|
21
27
|
("job_id_2", "2023-03-18 11:00", "FAILED"),
|
|
@@ -35,9 +41,11 @@ def test_jobs_list_with_limit():
|
|
|
35
41
|
), "Console should print each job and possibly more for headers/executable."
|
|
36
42
|
|
|
37
43
|
|
|
38
|
-
@pytest.mark.remote
|
|
39
44
|
def test_jobs_list_output_formatting_console():
|
|
40
45
|
"""Test the jobs list output formatting in the console."""
|
|
46
|
+
session = QbraidSession(api_key=qbraid_api_key)
|
|
47
|
+
session.save_config(api_key=qbraid_api_key)
|
|
48
|
+
|
|
41
49
|
mock_raw_data = [("job_id_1", "2023-03-19 12:00", "COMPLETED")]
|
|
42
50
|
mock_message = f"Displaying {len(mock_raw_data)} most recent jobs"
|
|
43
51
|
mock_job_data = (mock_raw_data, mock_message)
|
|
@@ -47,4 +55,6 @@ def test_jobs_list_output_formatting_console():
|
|
|
47
55
|
patch("rich.console.Console.print") as mock_console_print,
|
|
48
56
|
):
|
|
49
57
|
jobs_list(limit=1)
|
|
58
|
+
|
|
59
|
+
# Assuming here that if `Console.print` is called, formatting has been attempted
|
|
50
60
|
mock_console_print.assert_called()
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
name: Open Docs PR
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [closed]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
generate-docs-assets:
|
|
9
|
-
if: github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' && startsWith(github.event.pull_request.title, 'Bump project version to ')
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
outputs:
|
|
12
|
-
cli_version: ${{ steps.get_version.outputs.version }}
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@v4
|
|
16
|
-
with:
|
|
17
|
-
ref: main
|
|
18
|
-
|
|
19
|
-
- name: Install dependencies
|
|
20
|
-
run: |
|
|
21
|
-
python -m pip install --upgrade pip setuptools build
|
|
22
|
-
python -m pip install -r docs/requirements.txt
|
|
23
|
-
|
|
24
|
-
- name: Build & install package
|
|
25
|
-
run: |
|
|
26
|
-
make build
|
|
27
|
-
tools/install_wheel_extras.sh dist --extra envs
|
|
28
|
-
|
|
29
|
-
- name: Get qbraid-cli version
|
|
30
|
-
id: get_version
|
|
31
|
-
run: |
|
|
32
|
-
VERSION=$(qbraid --version | grep -o '[0-9]*\.[0-9]*\.[0-9]*')
|
|
33
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
34
|
-
|
|
35
|
-
- name: Generate docs assets
|
|
36
|
-
run: |
|
|
37
|
-
make docs-mdx
|
|
38
|
-
|
|
39
|
-
- name: Upload docs assets
|
|
40
|
-
uses: actions/upload-artifact@v4
|
|
41
|
-
with:
|
|
42
|
-
name: api-reference
|
|
43
|
-
path: docs/tree/qbraid*.mdx
|
|
44
|
-
|
|
45
|
-
commit-and-pr:
|
|
46
|
-
if: github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' && startsWith(github.event.pull_request.title, 'Bump project version to ')
|
|
47
|
-
runs-on: ubuntu-latest
|
|
48
|
-
needs: generate-docs-assets
|
|
49
|
-
permissions:
|
|
50
|
-
contents: write
|
|
51
|
-
pull-requests: write
|
|
52
|
-
|
|
53
|
-
steps:
|
|
54
|
-
- name: Download docs assets
|
|
55
|
-
uses: actions/download-artifact@v4
|
|
56
|
-
with:
|
|
57
|
-
name: api-reference
|
|
58
|
-
path: ./api-reference
|
|
59
|
-
|
|
60
|
-
- name: Checkout qBraid/docs repo
|
|
61
|
-
uses: actions/checkout@v4
|
|
62
|
-
with:
|
|
63
|
-
repository: qBraid/docs
|
|
64
|
-
token: ${{ secrets.BOT_TOKEN }}
|
|
65
|
-
path: ./qbraid_docs
|
|
66
|
-
ref: main
|
|
67
|
-
|
|
68
|
-
- name: Create feature branch
|
|
69
|
-
run: |
|
|
70
|
-
cd qbraid_docs
|
|
71
|
-
git checkout -b qbraid-cli-bot/${{ github.run_id }}
|
|
72
|
-
|
|
73
|
-
- name: Update docs in qBraid/docs
|
|
74
|
-
run: |
|
|
75
|
-
rm -f qbraid_docs/cli/api-reference/*
|
|
76
|
-
cp api-reference/qbraid*.mdx qbraid_docs/cli/api-reference/
|
|
77
|
-
|
|
78
|
-
- name: Inject version
|
|
79
|
-
run: |
|
|
80
|
-
VERSION=${{ needs.generate-docs-assets.outputs.cli_version }}
|
|
81
|
-
sed -i "6iVersion: [$VERSION](https://pypi.org/project/qbraid-cli/$VERSION)\n" qbraid_docs/cli/api-reference/qbraid.mdx
|
|
82
|
-
|
|
83
|
-
- name: Set up Node.js
|
|
84
|
-
uses: actions/setup-node@v4
|
|
85
|
-
with:
|
|
86
|
-
node-version: '22'
|
|
87
|
-
|
|
88
|
-
- name: Install dependencies
|
|
89
|
-
run: |
|
|
90
|
-
cd qbraid_docs
|
|
91
|
-
npm install
|
|
92
|
-
|
|
93
|
-
- name: Run prettier fixes
|
|
94
|
-
run: |
|
|
95
|
-
cd qbraid_docs
|
|
96
|
-
npx prettier --write cli/api-reference/qbraid*.mdx
|
|
97
|
-
|
|
98
|
-
- name: Setup Git config
|
|
99
|
-
run: |
|
|
100
|
-
git config --global user.name 'qbraidTeam'
|
|
101
|
-
git config --global user.email 'qbraid.team@qbraid.com'
|
|
102
|
-
|
|
103
|
-
- name: Commit and push changes
|
|
104
|
-
id: commit_and_push
|
|
105
|
-
run: |
|
|
106
|
-
cd qbraid_docs
|
|
107
|
-
git add cli/api-reference/
|
|
108
|
-
git commit -m "qBraid-CLI API reference docs update for version $VERSION"
|
|
109
|
-
git push origin qbraid-cli-bot/${{ github.run_id }}
|
|
110
|
-
|
|
111
|
-
- name: Create Pull Request
|
|
112
|
-
id: create_pr
|
|
113
|
-
run: |
|
|
114
|
-
cd qbraid_docs
|
|
115
|
-
VERSION=${{ needs.generate-docs-assets.outputs.cli_version }}
|
|
116
|
-
PR_URL=$(gh pr create -B main -H qbraid-cli-bot/${{ github.run_id }} --title "Update qBraid-CLI version $VERSION" --body "This PR updates the qBraid-CLI API reference docs for the latest release version $VERSION")
|
|
117
|
-
PR_NUMBER=$(echo "$PR_URL" | grep -o '[0-9]*$')
|
|
118
|
-
echo "url=$PR_URL" >> $GITHUB_OUTPUT
|
|
119
|
-
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
|
120
|
-
env:
|
|
121
|
-
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
|
|
122
|
-
|
|
123
|
-
- name: Summary
|
|
124
|
-
run: |
|
|
125
|
-
VERSION=${{ needs.generate-docs-assets.outputs.cli_version }}
|
|
126
|
-
PR_URL=${{ steps.create_pr.outputs.url }}
|
|
127
|
-
PR_NUMBER=${{ steps.create_pr.outputs.number }}
|
|
128
|
-
echo "Opened PR [#$PR_NUMBER]($PR_URL) to update CLI docs for version **$VERSION**." >> $GITHUB_STEP_SUMMARY
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
-
# All rights reserved.
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
Configurations for pytest including remote test marker and command-line option.
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
import os
|
|
9
|
-
|
|
10
|
-
import pytest
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def pytest_addoption(parser):
|
|
14
|
-
"""Adds custom remote testing command-line option to pytest."""
|
|
15
|
-
parser.addoption(
|
|
16
|
-
"--remote",
|
|
17
|
-
action="store",
|
|
18
|
-
default=None,
|
|
19
|
-
help="Run tests that interface with remote, credentialed services: true or false",
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def pytest_collection_modifyitems(config, items):
|
|
24
|
-
"""Skip tests marked with `remote` if remote tests are disabled."""
|
|
25
|
-
remote_option = config.getoption("--remote")
|
|
26
|
-
if remote_option is None:
|
|
27
|
-
remote_option = os.getenv("QBRAID_RUN_REMOTE_TESTS", "True").lower() == "true"
|
|
28
|
-
else:
|
|
29
|
-
remote_option = remote_option.lower() == "true"
|
|
30
|
-
|
|
31
|
-
if not remote_option:
|
|
32
|
-
skip_remote = pytest.mark.skip(reason="Remote tests are disabled.")
|
|
33
|
-
for item in items:
|
|
34
|
-
if "remote" in item.keywords:
|
|
35
|
-
item.add_marker(skip_remote)
|
|
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
|
|
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
|
|
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
|