qbraid-cli 0.10.6__tar.gz → 0.10.7__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.10.6 → qbraid_cli-0.10.7}/.github/workflows/bump-version.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/ci-pr-target.yml +4 -4
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/docs-pr.yml +3 -3
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/docs.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/format.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/main.yml +4 -4
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/pre-release.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/publish.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/workflows/tag-on-merge.yml +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/PKG-INFO +2 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/requirements.txt +1 -1
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/pyproject.toml +2 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/_version.py +2 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/devices/app.py +25 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/envs/app.py +1 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/files/app.py +2 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/handlers.py +16 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/jobs/app.py +22 -5
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/PKG-INFO +2 -2
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/SOURCES.txt +2 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/requires.txt +1 -1
- qbraid_cli-0.10.7/tests/devices/test_devices_get.py +278 -0
- qbraid_cli-0.10.7/tests/jobs/test_jobs_get.py +179 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.env.example +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.github/dependabot.yml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.gitignore +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/.readthedocs.yml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/CONTRIBUTING.md +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/LICENSE +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/MANIFEST.IN +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/Makefile +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/README.md +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/Makefile +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/conf.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/index.rst +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/docs/make.bat +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/chat/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/chat/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/files/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/jobs/toggle_braket.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/jobs/validation.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/setup.cfg +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/account/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/account/test_account_credits.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/admin/test_headers.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/test_configure_commands.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/test_configure_default.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/test_configure_prompt_for_config.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/test_configure_set.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/configure/test_configure_validate_input.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/conftest.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/devices/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/devices/test_devices_list.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/devices/test_devices_validations.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_activate.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_activate_print_command.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_activate_pyenv.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_create_from_yaml.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_list.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/envs/test_envs_remove.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/files/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/files/test_files_commands.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_disable.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_enable.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_list.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_state.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_validate_get_state.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/jobs/test_jobs_validate_library.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/kernels/__init__.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/kernels/test_kernels_list.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/resources/envs/correct.yaml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/resources/envs/icon.png +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tests/resources/envs/incorrect.yaml +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/bump_version.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/create_dev_build.sh +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/install_wheel_extras.sh +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/split_md.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/split_rst.py +0 -0
- {qbraid_cli-0.10.6 → qbraid_cli-0.10.7}/tools/stamp_pre_release.py +0 -0
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
python-version: ['3.11']
|
|
15
15
|
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
17
|
+
- uses: actions/checkout@v5
|
|
18
18
|
- name: Set up Python ${{ matrix.python-version }}
|
|
19
19
|
uses: actions/setup-python@v5
|
|
20
20
|
with:
|
|
@@ -44,14 +44,14 @@ jobs:
|
|
|
44
44
|
fail-fast: true
|
|
45
45
|
|
|
46
46
|
steps:
|
|
47
|
-
- uses: actions/checkout@
|
|
47
|
+
- uses: actions/checkout@v5
|
|
48
48
|
- name: Set up Python ${{ matrix.python-version }}
|
|
49
49
|
uses: actions/setup-python@v5
|
|
50
50
|
with:
|
|
51
51
|
python-version: ${{ matrix.python-version }}
|
|
52
52
|
cache: pip
|
|
53
53
|
- name: Download built package
|
|
54
|
-
uses: actions/download-artifact@
|
|
54
|
+
uses: actions/download-artifact@v5
|
|
55
55
|
with:
|
|
56
56
|
name: built-package
|
|
57
57
|
path: dist
|
|
@@ -73,7 +73,7 @@ jobs:
|
|
|
73
73
|
QBRAID_API_KEY: ${{ secrets.QBRAID_API_KEY }}
|
|
74
74
|
- name: Upload coverage to Codecov
|
|
75
75
|
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
|
|
76
|
-
uses: codecov/codecov-action@v5.4.
|
|
76
|
+
uses: codecov/codecov-action@v5.4.3
|
|
77
77
|
with:
|
|
78
78
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
79
79
|
fail_ci_if_error: false
|
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
cli_version: ${{ steps.get_version.outputs.version }}
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v5
|
|
16
16
|
with:
|
|
17
17
|
ref: main
|
|
18
18
|
|
|
@@ -52,13 +52,13 @@ jobs:
|
|
|
52
52
|
|
|
53
53
|
steps:
|
|
54
54
|
- name: Download docs assets
|
|
55
|
-
uses: actions/download-artifact@
|
|
55
|
+
uses: actions/download-artifact@v5
|
|
56
56
|
with:
|
|
57
57
|
name: api-reference
|
|
58
58
|
path: ./api-reference
|
|
59
59
|
|
|
60
60
|
- name: Checkout qBraid/docs repo
|
|
61
|
-
uses: actions/checkout@
|
|
61
|
+
uses: actions/checkout@v5
|
|
62
62
|
with:
|
|
63
63
|
repository: qBraid/docs
|
|
64
64
|
token: ${{ secrets.BOT_TOKEN }}
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
python-version: ['3.11']
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
21
|
- name: Set up Python ${{ matrix.python-version }}
|
|
22
22
|
uses: actions/setup-python@v5
|
|
23
23
|
with:
|
|
@@ -47,14 +47,14 @@ jobs:
|
|
|
47
47
|
fail-fast: true
|
|
48
48
|
|
|
49
49
|
steps:
|
|
50
|
-
- uses: actions/checkout@
|
|
50
|
+
- uses: actions/checkout@v5
|
|
51
51
|
- name: Set up Python ${{ matrix.python-version }}
|
|
52
52
|
uses: actions/setup-python@v5
|
|
53
53
|
with:
|
|
54
54
|
python-version: ${{ matrix.python-version }}
|
|
55
55
|
cache: pip
|
|
56
56
|
- name: Download built package
|
|
57
|
-
uses: actions/download-artifact@
|
|
57
|
+
uses: actions/download-artifact@v5
|
|
58
58
|
with:
|
|
59
59
|
name: built-package
|
|
60
60
|
path: dist
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
QBRAID_API_KEY: ${{ secrets.QBRAID_API_KEY }}
|
|
77
77
|
- name: Upload coverage to Codecov
|
|
78
78
|
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
|
|
79
|
-
uses: codecov/codecov-action@v5.4.
|
|
79
|
+
uses: codecov/codecov-action@v5.4.3
|
|
80
80
|
with:
|
|
81
81
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
82
82
|
fail_ci_if_error: false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.7
|
|
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: click
|
|
32
|
+
Requires-Dist: click<=8.1.8
|
|
33
33
|
Requires-Dist: qbraid-core<0.2,>=0.1.41
|
|
34
34
|
Provides-Extra: jobs
|
|
35
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.10.
|
|
7
|
+
version = "0.10.7"
|
|
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
|
-
"click",
|
|
33
|
+
"click<=8.1.8",
|
|
34
34
|
"qbraid-core>=0.1.41,<0.2",
|
|
35
35
|
]
|
|
36
36
|
requires-python = ">= 3.9"
|
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.1.dev1+
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 1, 'dev1', '
|
|
20
|
+
__version__ = version = '0.1.dev1+g494c7ce'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'g494c7ce')
|
|
@@ -12,7 +12,7 @@ import typer
|
|
|
12
12
|
from rich.console import Console
|
|
13
13
|
|
|
14
14
|
from qbraid_cli.devices.validation import validate_provider, validate_status, validate_type
|
|
15
|
-
from qbraid_cli.handlers import run_progress_task
|
|
15
|
+
from qbraid_cli.handlers import print_formatted_data, run_progress_task
|
|
16
16
|
|
|
17
17
|
devices_app = typer.Typer(help="Manage qBraid quantum devices.", no_args_is_help=True)
|
|
18
18
|
|
|
@@ -29,7 +29,10 @@ def devices_list( # pylint: disable=too-many-branches
|
|
|
29
29
|
None,
|
|
30
30
|
"--provider",
|
|
31
31
|
"-p",
|
|
32
|
-
help=
|
|
32
|
+
help=(
|
|
33
|
+
"'AWS'|'IBM'|'IonQ'|'Rigetti'|'OQC'|'QuEra'|'IQM'|"
|
|
34
|
+
"'NEC'|'qBraid'|'Azure'|'Pasqal'|'Quantinuum'|'Equal1'"
|
|
35
|
+
),
|
|
33
36
|
callback=validate_provider,
|
|
34
37
|
),
|
|
35
38
|
) -> None:
|
|
@@ -76,5 +79,25 @@ def devices_list( # pylint: disable=too-many-branches
|
|
|
76
79
|
console.print(f"\n{msg}", style="italic", justify="left")
|
|
77
80
|
|
|
78
81
|
|
|
82
|
+
@devices_app.command(name="get")
|
|
83
|
+
def devices_get(
|
|
84
|
+
device_id: str = typer.Argument(..., help="The ID of the device to get."),
|
|
85
|
+
fmt: bool = typer.Option(
|
|
86
|
+
True, "--no-fmt", help="Disable rich console formatting (output raw data)"
|
|
87
|
+
),
|
|
88
|
+
) -> None:
|
|
89
|
+
"""Get a qBraid quantum device."""
|
|
90
|
+
|
|
91
|
+
def get_device():
|
|
92
|
+
from qbraid_core.services.quantum import QuantumClient
|
|
93
|
+
|
|
94
|
+
client = QuantumClient()
|
|
95
|
+
return client.get_device(device_id)
|
|
96
|
+
|
|
97
|
+
data: dict[str, Any] = run_progress_task(get_device)
|
|
98
|
+
|
|
99
|
+
print_formatted_data(data, fmt)
|
|
100
|
+
|
|
101
|
+
|
|
79
102
|
if __name__ == "__main__":
|
|
80
103
|
devices_app()
|
|
@@ -128,6 +128,7 @@ def envs_create( # pylint: disable=too-many-statements
|
|
|
128
128
|
env_config.description = environment.get("description")
|
|
129
129
|
env_config.tags = environment.get("tags")
|
|
130
130
|
env_config.kernel_name = environment.get("kernelName")
|
|
131
|
+
env_config.python_version = python_version
|
|
131
132
|
|
|
132
133
|
slug_path = env_path / slug
|
|
133
134
|
description = "None" if description == "" else description
|
|
@@ -27,10 +27,10 @@ def is_file_less_than_10mb(file_path: Path) -> bool:
|
|
|
27
27
|
Returns:
|
|
28
28
|
bool: True if the file is less than 10MB, False otherwise.
|
|
29
29
|
"""
|
|
30
|
-
|
|
30
|
+
ten_mb = 10485760 # 10 MB in bytes (10 * 1024 * 1024)
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
|
-
return file_path.stat().st_size <
|
|
33
|
+
return file_path.stat().st_size < ten_mb
|
|
34
34
|
except OSError:
|
|
35
35
|
return False
|
|
36
36
|
|
|
@@ -89,6 +89,22 @@ def handle_filesystem_operation(operation: Callable[[], None], path: Path) -> No
|
|
|
89
89
|
raise QbraidException(f"Failed to save configuration to {path}: {err.strerror}") from err
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
def print_formatted_data(data: Any, fmt: bool = True) -> None:
|
|
93
|
+
"""
|
|
94
|
+
Print data with optional formatting using rich console.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
data (Any): The data to be printed.
|
|
98
|
+
fmt (bool): If True, use rich console formatting. If False, use standard print.
|
|
99
|
+
Defaults to True.
|
|
100
|
+
"""
|
|
101
|
+
if fmt:
|
|
102
|
+
console = Console()
|
|
103
|
+
console.print(data)
|
|
104
|
+
else:
|
|
105
|
+
print(data)
|
|
106
|
+
|
|
107
|
+
|
|
92
108
|
def run_progress_task(
|
|
93
109
|
operation: Callable[..., Any],
|
|
94
110
|
*args,
|
|
@@ -11,7 +11,7 @@ from typing import Any, Callable
|
|
|
11
11
|
import typer
|
|
12
12
|
from rich.console import Console
|
|
13
13
|
|
|
14
|
-
from qbraid_cli.handlers import handle_error, run_progress_task
|
|
14
|
+
from qbraid_cli.handlers import handle_error, print_formatted_data, run_progress_task
|
|
15
15
|
from qbraid_cli.jobs.toggle_braket import disable_braket, enable_braket
|
|
16
16
|
from qbraid_cli.jobs.validation import handle_jobs_state, run_progress_get_state, validate_library
|
|
17
17
|
|
|
@@ -107,11 +107,8 @@ def jobs_list(
|
|
|
107
107
|
|
|
108
108
|
result: tuple[Any, Callable] = run_progress_task(import_jobs)
|
|
109
109
|
client, process_job_data = result
|
|
110
|
-
|
|
111
|
-
# raw_data = client.search_jobs(query={"numResults": limit})
|
|
112
|
-
raw_data = client.search_jobs(query={})
|
|
110
|
+
raw_data = client.search_jobs(query={"resultsPerPage": limit, "page": 0})
|
|
113
111
|
job_data, msg = process_job_data(raw_data)
|
|
114
|
-
job_data = job_data[:limit]
|
|
115
112
|
|
|
116
113
|
longest_job_id = max(len(item[0]) for item in job_data)
|
|
117
114
|
spacing = longest_job_id + 5
|
|
@@ -148,5 +145,25 @@ def jobs_list(
|
|
|
148
145
|
handle_error(message="Failed to fetch quantum jobs.")
|
|
149
146
|
|
|
150
147
|
|
|
148
|
+
@jobs_app.command(name="get")
|
|
149
|
+
def jobs_get(
|
|
150
|
+
job_id: str = typer.Argument(..., help="The ID of the job to get."),
|
|
151
|
+
fmt: bool = typer.Option(
|
|
152
|
+
True, "--no-fmt", help="Disable rich console formatting (output raw data)"
|
|
153
|
+
),
|
|
154
|
+
) -> None:
|
|
155
|
+
"""Get a qBraid Quantum Job."""
|
|
156
|
+
|
|
157
|
+
def get_job():
|
|
158
|
+
from qbraid_core.services.quantum import QuantumClient
|
|
159
|
+
|
|
160
|
+
client = QuantumClient()
|
|
161
|
+
return client.get_job(job_id)
|
|
162
|
+
|
|
163
|
+
data: dict[str, Any] = run_progress_task(get_job)
|
|
164
|
+
|
|
165
|
+
print_formatted_data(data, fmt)
|
|
166
|
+
|
|
167
|
+
|
|
151
168
|
if __name__ == "__main__":
|
|
152
169
|
jobs_app()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.7
|
|
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: click
|
|
32
|
+
Requires-Dist: click<=8.1.8
|
|
33
33
|
Requires-Dist: qbraid-core<0.2,>=0.1.41
|
|
34
34
|
Provides-Extra: jobs
|
|
35
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
@@ -83,6 +83,7 @@ tests/configure/test_configure_prompt_for_config.py
|
|
|
83
83
|
tests/configure/test_configure_set.py
|
|
84
84
|
tests/configure/test_configure_validate_input.py
|
|
85
85
|
tests/devices/__init__.py
|
|
86
|
+
tests/devices/test_devices_get.py
|
|
86
87
|
tests/devices/test_devices_list.py
|
|
87
88
|
tests/devices/test_devices_validations.py
|
|
88
89
|
tests/envs/__init__.py
|
|
@@ -98,6 +99,7 @@ tests/files/test_files_commands.py
|
|
|
98
99
|
tests/jobs/__init__.py
|
|
99
100
|
tests/jobs/test_jobs_disable.py
|
|
100
101
|
tests/jobs/test_jobs_enable.py
|
|
102
|
+
tests/jobs/test_jobs_get.py
|
|
101
103
|
tests/jobs/test_jobs_list.py
|
|
102
104
|
tests/jobs/test_jobs_state.py
|
|
103
105
|
tests/jobs/test_jobs_toggle_braket_confirm.py
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Unit tests for the `devices_get` function in the `qbraid_cli.devices.app` module.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from unittest.mock import MagicMock, patch
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
|
+
import typer
|
|
13
|
+
from qbraid_core.services.quantum.exceptions import QuantumServiceRequestError
|
|
14
|
+
from typer.testing import CliRunner
|
|
15
|
+
|
|
16
|
+
from qbraid_cli.devices.app import devices_get
|
|
17
|
+
|
|
18
|
+
runner = CliRunner()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@pytest.mark.remote
|
|
22
|
+
def test_devices_get_formatted_output():
|
|
23
|
+
"""Test the `devices_get` function with formatted output (default behavior)."""
|
|
24
|
+
mock_device_data = {
|
|
25
|
+
"id": "test-device-123",
|
|
26
|
+
"name": "Test Quantum Computer",
|
|
27
|
+
"provider": "AWS",
|
|
28
|
+
"status": "ONLINE",
|
|
29
|
+
"type": "QPU",
|
|
30
|
+
"properties": {"qubits": 5, "connectivity": "all-to-all"},
|
|
31
|
+
}
|
|
32
|
+
device_id = "test-device-123"
|
|
33
|
+
|
|
34
|
+
with (
|
|
35
|
+
patch(
|
|
36
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
37
|
+
),
|
|
38
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
39
|
+
):
|
|
40
|
+
devices_get(device_id=device_id, fmt=True)
|
|
41
|
+
|
|
42
|
+
# Verify the console was called to print the formatted data (last call should be our data)
|
|
43
|
+
calls = mock_console_print.call_args_list
|
|
44
|
+
assert len(calls) >= 1
|
|
45
|
+
# The last call should be our device data
|
|
46
|
+
assert calls[-1][0][0] == mock_device_data
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@pytest.mark.remote
|
|
50
|
+
def test_devices_get_raw_output():
|
|
51
|
+
"""Test the `devices_get` function with raw output (fmt=False)."""
|
|
52
|
+
mock_device_data = {
|
|
53
|
+
"id": "test-device-456",
|
|
54
|
+
"name": "Test Simulator",
|
|
55
|
+
"provider": "IBM",
|
|
56
|
+
"status": "OFFLINE",
|
|
57
|
+
"type": "SIMULATOR",
|
|
58
|
+
}
|
|
59
|
+
device_id = "test-device-456"
|
|
60
|
+
|
|
61
|
+
with (
|
|
62
|
+
patch(
|
|
63
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
64
|
+
),
|
|
65
|
+
patch("builtins.print") as mock_print,
|
|
66
|
+
):
|
|
67
|
+
devices_get(device_id=device_id, fmt=False)
|
|
68
|
+
|
|
69
|
+
# Verify print was called with the raw data
|
|
70
|
+
mock_print.assert_called_once_with(mock_device_data)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@pytest.mark.remote
|
|
74
|
+
def test_devices_get_default_fmt_behavior():
|
|
75
|
+
"""Test that `devices_get` defaults to formatted output when fmt is not specified."""
|
|
76
|
+
mock_device_data = {
|
|
77
|
+
"id": "test-device-789",
|
|
78
|
+
"name": "Default Test Device",
|
|
79
|
+
"provider": "IonQ",
|
|
80
|
+
"status": "RETIRED",
|
|
81
|
+
"type": "QPU",
|
|
82
|
+
}
|
|
83
|
+
device_id = "test-device-789"
|
|
84
|
+
|
|
85
|
+
with (
|
|
86
|
+
patch(
|
|
87
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
88
|
+
),
|
|
89
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
90
|
+
):
|
|
91
|
+
devices_get(device_id=device_id) # fmt defaults to True
|
|
92
|
+
|
|
93
|
+
# Verify the console was called to print the formatted data (last call should be our data)
|
|
94
|
+
calls = mock_console_print.call_args_list
|
|
95
|
+
assert len(calls) >= 1
|
|
96
|
+
# The last call should be our device data
|
|
97
|
+
assert calls[-1][0][0] == mock_device_data
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@pytest.mark.remote
|
|
101
|
+
def test_devices_get_quantum_client_error():
|
|
102
|
+
"""Test error handling when QuantumClient.get_device raises an exception."""
|
|
103
|
+
device_id = "invalid-device-id"
|
|
104
|
+
|
|
105
|
+
with patch(
|
|
106
|
+
"qbraid_core.services.quantum.QuantumClient.get_device",
|
|
107
|
+
side_effect=QuantumServiceRequestError("Device not found"),
|
|
108
|
+
):
|
|
109
|
+
with pytest.raises(typer.Exit) as exc_info:
|
|
110
|
+
devices_get(device_id=device_id)
|
|
111
|
+
|
|
112
|
+
assert exc_info.value.exit_code == 1
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@pytest.mark.remote
|
|
116
|
+
def test_devices_get_empty_device_data():
|
|
117
|
+
"""Test handling of empty device data."""
|
|
118
|
+
mock_device_data = {}
|
|
119
|
+
device_id = "empty-device-id"
|
|
120
|
+
|
|
121
|
+
with (
|
|
122
|
+
patch(
|
|
123
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
124
|
+
),
|
|
125
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
126
|
+
):
|
|
127
|
+
devices_get(device_id=device_id, fmt=True)
|
|
128
|
+
|
|
129
|
+
# Verify the console was called with empty data (last call should be our data)
|
|
130
|
+
calls = mock_console_print.call_args_list
|
|
131
|
+
assert len(calls) >= 1
|
|
132
|
+
# The last call should be our device data
|
|
133
|
+
assert calls[-1][0][0] == mock_device_data
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@pytest.mark.remote
|
|
137
|
+
def test_devices_get_complex_device_data():
|
|
138
|
+
"""Test handling of complex device data with nested structures."""
|
|
139
|
+
mock_device_data = {
|
|
140
|
+
"id": "complex-device-123",
|
|
141
|
+
"name": "Advanced Quantum Computer",
|
|
142
|
+
"provider": "Rigetti",
|
|
143
|
+
"status": "ONLINE",
|
|
144
|
+
"type": "QPU",
|
|
145
|
+
"specifications": {
|
|
146
|
+
"qubits": 32,
|
|
147
|
+
"connectivity": "nearest-neighbor",
|
|
148
|
+
"gate_fidelity": 0.99,
|
|
149
|
+
"coherence_time": "100μs",
|
|
150
|
+
},
|
|
151
|
+
"calibration": {
|
|
152
|
+
"last_calibrated": "2023-03-19T12:00:00Z",
|
|
153
|
+
"next_calibration": "2023-03-26T12:00:00Z",
|
|
154
|
+
"calibration_data": {
|
|
155
|
+
"readout_fidelity": 0.95,
|
|
156
|
+
"single_qubit_gate_fidelity": 0.99,
|
|
157
|
+
"two_qubit_gate_fidelity": 0.97,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
}
|
|
161
|
+
device_id = "complex-device-123"
|
|
162
|
+
|
|
163
|
+
with (
|
|
164
|
+
patch(
|
|
165
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
166
|
+
),
|
|
167
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
168
|
+
):
|
|
169
|
+
devices_get(device_id=device_id, fmt=True)
|
|
170
|
+
|
|
171
|
+
# Verify the console was called with complex data (last call should be our data)
|
|
172
|
+
calls = mock_console_print.call_args_list
|
|
173
|
+
assert len(calls) >= 1
|
|
174
|
+
# The last call should be our device data
|
|
175
|
+
assert calls[-1][0][0] == mock_device_data
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@pytest.mark.remote
|
|
179
|
+
def test_devices_get_cli_integration_formatted():
|
|
180
|
+
"""Test the devices get command via CLI with formatted output."""
|
|
181
|
+
from qbraid_cli.devices.app import devices_app
|
|
182
|
+
|
|
183
|
+
mock_device_data = {"id": "cli-test-device", "name": "CLI Test Device", "status": "ONLINE"}
|
|
184
|
+
|
|
185
|
+
with (
|
|
186
|
+
patch(
|
|
187
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
188
|
+
),
|
|
189
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
190
|
+
):
|
|
191
|
+
result = runner.invoke(devices_app, ["get", "cli-test-device"])
|
|
192
|
+
|
|
193
|
+
assert result.exit_code == 0
|
|
194
|
+
calls = mock_console_print.call_args_list
|
|
195
|
+
assert len(calls) >= 1
|
|
196
|
+
# The last call should be our device data
|
|
197
|
+
assert calls[-1][0][0] == mock_device_data
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@pytest.mark.remote
|
|
201
|
+
def test_devices_get_cli_integration_raw():
|
|
202
|
+
"""Test the devices get command via CLI with raw output."""
|
|
203
|
+
from qbraid_cli.devices.app import devices_app
|
|
204
|
+
|
|
205
|
+
mock_device_data = {"id": "cli-raw-device", "name": "CLI Raw Device", "status": "OFFLINE"}
|
|
206
|
+
|
|
207
|
+
with (
|
|
208
|
+
patch(
|
|
209
|
+
"qbraid_core.services.quantum.QuantumClient.get_device", return_value=mock_device_data
|
|
210
|
+
),
|
|
211
|
+
patch("builtins.print") as mock_print,
|
|
212
|
+
):
|
|
213
|
+
result = runner.invoke(devices_app, ["get", "cli-raw-device", "--no-fmt"])
|
|
214
|
+
|
|
215
|
+
assert result.exit_code == 0
|
|
216
|
+
mock_print.assert_called_once_with(mock_device_data)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
@pytest.mark.remote
|
|
220
|
+
def test_devices_get_different_provider_devices():
|
|
221
|
+
"""Test getting devices from different providers."""
|
|
222
|
+
providers = ["AWS", "IBM", "IonQ", "Rigetti", "OQC", "QuEra"]
|
|
223
|
+
|
|
224
|
+
for provider in providers:
|
|
225
|
+
mock_device_data = {
|
|
226
|
+
"id": f"{provider.lower()}-device-123",
|
|
227
|
+
"name": f"{provider} Test Device",
|
|
228
|
+
"provider": provider,
|
|
229
|
+
"status": "ONLINE",
|
|
230
|
+
"type": "QPU",
|
|
231
|
+
}
|
|
232
|
+
device_id = f"{provider.lower()}-device-123"
|
|
233
|
+
|
|
234
|
+
with (
|
|
235
|
+
patch(
|
|
236
|
+
"qbraid_core.services.quantum.QuantumClient.get_device",
|
|
237
|
+
return_value=mock_device_data,
|
|
238
|
+
),
|
|
239
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
240
|
+
):
|
|
241
|
+
devices_get(device_id=device_id, fmt=True)
|
|
242
|
+
|
|
243
|
+
# Verify the console was called with the correct data (last call should be our data)
|
|
244
|
+
calls = mock_console_print.call_args_list
|
|
245
|
+
assert len(calls) >= 1
|
|
246
|
+
# The last call should be our device data
|
|
247
|
+
assert calls[-1][0][0] == mock_device_data
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@pytest.mark.remote
|
|
251
|
+
def test_devices_get_different_status_devices():
|
|
252
|
+
"""Test getting devices with different statuses."""
|
|
253
|
+
statuses = ["ONLINE", "OFFLINE", "RETIRED"]
|
|
254
|
+
|
|
255
|
+
for status in statuses:
|
|
256
|
+
mock_device_data = {
|
|
257
|
+
"id": f"status-{status.lower()}-device",
|
|
258
|
+
"name": f"Status {status} Device",
|
|
259
|
+
"provider": "Test Provider",
|
|
260
|
+
"status": status,
|
|
261
|
+
"type": "QPU",
|
|
262
|
+
}
|
|
263
|
+
device_id = f"status-{status.lower()}-device"
|
|
264
|
+
|
|
265
|
+
with (
|
|
266
|
+
patch(
|
|
267
|
+
"qbraid_core.services.quantum.QuantumClient.get_device",
|
|
268
|
+
return_value=mock_device_data,
|
|
269
|
+
),
|
|
270
|
+
patch("rich.console.Console.print") as mock_console_print,
|
|
271
|
+
):
|
|
272
|
+
devices_get(device_id=device_id, fmt=True)
|
|
273
|
+
|
|
274
|
+
# Verify the console was called with the correct data (last call should be our data)
|
|
275
|
+
calls = mock_console_print.call_args_list
|
|
276
|
+
assert len(calls) >= 1
|
|
277
|
+
# The last call should be our device data
|
|
278
|
+
assert calls[-1][0][0] == mock_device_data
|