qbraid-cli 0.8.4b0__tar.gz → 0.8.5__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.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/bump-version.yml +2 -2
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/pre-release.yml +1 -1
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/PKG-INFO +2 -3
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/pyproject.toml +3 -6
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/_version.py +2 -2
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/admin/app.py +3 -7
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/admin/headers.py +3 -3
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/admin/validation.py +1 -2
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/configure/actions.py +2 -2
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/devices/app.py +3 -3
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/envs/app.py +4 -4
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/handlers.py +5 -5
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/jobs/app.py +10 -8
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/jobs/toggle_braket.py +32 -14
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/jobs/validation.py +5 -5
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/pip/hooks.py +1 -1
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/PKG-INFO +2 -3
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/SOURCES.txt +0 -1
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/requires.txt +1 -1
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_toggle_braket_confirm.py +1 -1
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_toggle_braket_enable.py +5 -3
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/kernels/test_kernels_list.py +6 -1
- qbraid_cli-0.8.5/tools/bump_version.py +28 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tools/create_dev_build.sh +2 -2
- qbraid_cli-0.8.5/tools/stamp_pre_release.py +36 -0
- qbraid_cli-0.8.4b0/qbraid_cli/admin/buildlogs.py +0 -114
- qbraid_cli-0.8.4b0/tools/bump_version.py +0 -21
- qbraid_cli-0.8.4b0/tools/stamp_pre_release.py +0 -18
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.env.example +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/docs.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/format.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/main.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/publish.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.github/workflows/tag-on-merge.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.gitignore +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/.readthedocs.yml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/CONTRIBUTING.md +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/LICENSE +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/MANIFEST.IN +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/Makefile +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/README.md +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/Makefile +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/api-key.png +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/cards/jupyter.png +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/cards/python.png +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/cards/terminal.png +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/configure.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/credits.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/devices-list.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/devices.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/envs-activate.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/envs-list.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/envs-uninstall.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/envs.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/jobs-add.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/jobs-disable.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/jobs-enable.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/jobs-list.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/jobs.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/kernels.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/cli/qbraid.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/conf.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/guide/overview.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/index.rst +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/make.bat +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/docs/requirements.txt +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/credits/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/credits/app.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/ruff.toml +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/setup.cfg +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/configure/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/configure/test_configure_prompt_for_config.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/configure/test_configure_set.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/configure/test_configure_validate_input.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/credits/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/credits/test_credits_value.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/devices/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/devices/test_devices_list.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/devices/test_devices_validations.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_activate.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_activate_print_command.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_activate_pyenv.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_list.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/envs/test_envs_remove.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_disable.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_enable.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_list.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_state.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_validate_get_state.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/jobs/test_jobs_validate_library.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tests/kernels/__init__.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tools/install_wheel_extras.sh +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tools/split_md.py +0 -0
- {qbraid_cli-0.8.4b0 → qbraid_cli-0.8.5}/tools/split_rst.py +0 -0
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
- name: Install dependencies
|
|
37
37
|
run: |
|
|
38
38
|
python -m pip install --upgrade pip
|
|
39
|
-
python -m pip install "qbraid-core>=0.1.
|
|
39
|
+
python -m pip install "qbraid-core>=0.1.17"
|
|
40
40
|
|
|
41
41
|
- name: Setup Git config
|
|
42
42
|
run: |
|
|
@@ -47,7 +47,7 @@ jobs:
|
|
|
47
47
|
id: bump_version
|
|
48
48
|
run: |
|
|
49
49
|
BUMP_TYPE=${{ github.event.inputs.bump_type }}
|
|
50
|
-
VERSION=$(python3 tools/bump_version.py $BUMP_TYPE)
|
|
50
|
+
VERSION=$(python3 tools/bump_version.py qbraid_cli $BUMP_TYPE)
|
|
51
51
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
52
52
|
git commit -am "Bump $BUMP_TYPE version to $VERSION"
|
|
53
53
|
git push origin qbraid-bot/${{ github.run_id }}
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
- name: Build binary wheel + source tarball
|
|
25
25
|
id: build-dev
|
|
26
26
|
run: |
|
|
27
|
-
export PRE_RELEASE_VERSION=$(python tools/stamp_pre_release.py)
|
|
27
|
+
export PRE_RELEASE_VERSION=$(python tools/stamp_pre_release.py qbraid_cli)
|
|
28
28
|
[[ "$PRE_RELEASE_VERSION" =~ .*(-a\.|-b\.|-rc\.).* ]] && echo "Deploying pre-release version '$PRE_RELEASE_VERSION'" || (echo "not pre-release version"; exit 0)
|
|
29
29
|
out_dir="${PWD}/dist"
|
|
30
30
|
tools/create_dev_build.sh $PRE_RELEASE_VERSION "${out_dir}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.5
|
|
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,7 +8,6 @@ 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
|
|
12
11
|
Keywords: qbraid,cli,quantum,cloud
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -29,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
29
28
|
License-File: LICENSE
|
|
30
29
|
Requires-Dist: typer>=0.12.1
|
|
31
30
|
Requires-Dist: rich>=10.11.0
|
|
32
|
-
Requires-Dist: qbraid-core[environments]>=0.1.
|
|
31
|
+
Requires-Dist: qbraid-core[environments]>=0.1.23
|
|
33
32
|
Provides-Extra: jobs
|
|
34
33
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
34
|
Provides-Extra: dev
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.5"
|
|
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" }]
|
|
@@ -29,7 +29,7 @@ classifiers = [
|
|
|
29
29
|
dependencies = [
|
|
30
30
|
"typer>=0.12.1",
|
|
31
31
|
"rich>=10.11.0",
|
|
32
|
-
"qbraid-core[environments]>=0.1.
|
|
32
|
+
"qbraid-core[environments]>=0.1.23",
|
|
33
33
|
]
|
|
34
34
|
requires-python = ">= 3.9"
|
|
35
35
|
|
|
@@ -38,7 +38,6 @@ Homepage = "https://docs.qbraid.com/cli/user-guide/overview"
|
|
|
38
38
|
Documentation = "https://docs.qbraid.com/cli/api-reference/qbraid"
|
|
39
39
|
"Bug Tracker" = "https://github.com/qBraid/community/issues"
|
|
40
40
|
Discord = "https://discord.gg/KugF6Cnncm"
|
|
41
|
-
"Launch on Lab" = "https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/.git"
|
|
42
41
|
|
|
43
42
|
[project.optional-dependencies]
|
|
44
43
|
jobs = ["amazon-braket-sdk>=1.48.1"]
|
|
@@ -78,9 +77,7 @@ testpaths = ["tests"]
|
|
|
78
77
|
[tool.coverage.run]
|
|
79
78
|
parallel = true
|
|
80
79
|
source = ["qbraid_cli"]
|
|
81
|
-
omit = [
|
|
82
|
-
"**/qbraid_cli/admin/buildlogs.py"
|
|
83
|
-
]
|
|
80
|
+
omit = []
|
|
84
81
|
|
|
85
82
|
[tool.coverage.report]
|
|
86
83
|
show_missing = true
|
|
@@ -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+gaaf2fca'
|
|
16
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'gaaf2fca')
|
|
@@ -3,25 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
"""
|
|
5
5
|
Module defining commands in the 'qbraid admin' namespace.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from typing import List
|
|
9
6
|
|
|
7
|
+
"""
|
|
10
8
|
import typer
|
|
11
9
|
|
|
12
|
-
from qbraid_cli.admin.buildlogs import buildlogs_app
|
|
13
10
|
from qbraid_cli.admin.headers import check_and_fix_headers
|
|
14
11
|
from qbraid_cli.admin.validation import validate_header_type, validate_paths_exist
|
|
15
12
|
|
|
16
13
|
admin_app = typer.Typer(
|
|
17
14
|
help="CI/CD commands for qBraid maintainers.", pretty_exceptions_show_locals=False
|
|
18
15
|
)
|
|
19
|
-
admin_app.add_typer(buildlogs_app, name="buildlogs")
|
|
20
16
|
|
|
21
17
|
|
|
22
18
|
@admin_app.command(name="headers")
|
|
23
19
|
def admin_headers(
|
|
24
|
-
src_paths:
|
|
20
|
+
src_paths: list[str] = typer.Argument(
|
|
25
21
|
..., help="Source file or directory paths to verify.", callback=validate_paths_exist
|
|
26
22
|
),
|
|
27
23
|
header_type: str = typer.Option(
|
|
@@ -31,7 +27,7 @@ def admin_headers(
|
|
|
31
27
|
help="Type of header to use ('default' or 'gpl').",
|
|
32
28
|
callback=validate_header_type,
|
|
33
29
|
),
|
|
34
|
-
skip_files:
|
|
30
|
+
skip_files: list[str] = typer.Option(
|
|
35
31
|
[], "--skip", "-s", help="Files to skip during verification.", callback=validate_paths_exist
|
|
36
32
|
),
|
|
37
33
|
fix: bool = typer.Option(
|
|
@@ -6,7 +6,7 @@ Script to verify qBraid copyright file headers
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
import os
|
|
9
|
-
from typing import
|
|
9
|
+
from typing import Optional
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
12
|
from rich.console import Console
|
|
@@ -37,9 +37,9 @@ HEADER_TYPES = {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def check_and_fix_headers(
|
|
40
|
-
src_paths:
|
|
40
|
+
src_paths: list[str],
|
|
41
41
|
header_type: str = "default",
|
|
42
|
-
skip_files: Optional[
|
|
42
|
+
skip_files: Optional[list[str]] = None,
|
|
43
43
|
fix: bool = False,
|
|
44
44
|
) -> None:
|
|
45
45
|
"""Script to add or verify qBraid copyright file headers"""
|
|
@@ -7,7 +7,6 @@ Module for validating command arguments for qBraid admin commands.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import os
|
|
10
|
-
from typing import List
|
|
11
10
|
|
|
12
11
|
import typer
|
|
13
12
|
|
|
@@ -21,7 +20,7 @@ def validate_header_type(value: str) -> str:
|
|
|
21
20
|
return validate_item(value, header_types, "Header type")
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
def validate_paths_exist(paths:
|
|
23
|
+
def validate_paths_exist(paths: list[str]) -> list[str]:
|
|
25
24
|
"""Verifies that each path in the provided list exists."""
|
|
26
25
|
non_existent_paths = [path for path in paths if not os.path.exists(path)]
|
|
27
26
|
if non_existent_paths:
|
|
@@ -9,7 +9,7 @@ Module defining actions invoked by 'qbraid configure' command(s).
|
|
|
9
9
|
import configparser
|
|
10
10
|
import re
|
|
11
11
|
from copy import deepcopy
|
|
12
|
-
from typing import
|
|
12
|
+
from typing import Optional
|
|
13
13
|
|
|
14
14
|
import typer
|
|
15
15
|
from qbraid_core.config import (
|
|
@@ -53,7 +53,7 @@ def prompt_for_config(
|
|
|
53
53
|
config: configparser.ConfigParser,
|
|
54
54
|
section: str,
|
|
55
55
|
key: str,
|
|
56
|
-
default_values: Optional[
|
|
56
|
+
default_values: Optional[dict[str, str]] = None,
|
|
57
57
|
) -> str:
|
|
58
58
|
"""Prompt the user for a configuration setting, showing the current value as default."""
|
|
59
59
|
default_values = default_values or {}
|
|
@@ -6,7 +6,7 @@ Module defining commands in the 'qbraid devices' namespace.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import Any, Callable, Optional
|
|
9
|
+
from typing import Any, Callable, Optional
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
12
|
from rich.console import Console
|
|
@@ -42,14 +42,14 @@ def devices_list( # pylint: disable=too-many-branches
|
|
|
42
42
|
if provider:
|
|
43
43
|
filters["provider"] = provider
|
|
44
44
|
|
|
45
|
-
def import_devices() ->
|
|
45
|
+
def import_devices() -> tuple[Any, Callable]:
|
|
46
46
|
from qbraid_core.services.quantum import QuantumClient, process_device_data
|
|
47
47
|
|
|
48
48
|
client = QuantumClient()
|
|
49
49
|
|
|
50
50
|
return client, process_device_data
|
|
51
51
|
|
|
52
|
-
result:
|
|
52
|
+
result: tuple[Callable, Callable] = run_progress_task(import_devices)
|
|
53
53
|
client, process_device_data = result
|
|
54
54
|
raw_data = client.search_devices(filters)
|
|
55
55
|
device_data, msg = process_device_data(raw_data)
|
|
@@ -10,7 +10,7 @@ import shutil
|
|
|
10
10
|
import subprocess
|
|
11
11
|
import sys
|
|
12
12
|
from pathlib import Path
|
|
13
|
-
from typing import TYPE_CHECKING, Optional
|
|
13
|
+
from typing import TYPE_CHECKING, Optional
|
|
14
14
|
|
|
15
15
|
import typer
|
|
16
16
|
from rich.console import Console
|
|
@@ -41,14 +41,14 @@ def envs_create( # pylint: disable=too-many-statements
|
|
|
41
41
|
"""Create a new qBraid environment."""
|
|
42
42
|
env_description = description or ""
|
|
43
43
|
|
|
44
|
-
def create_environment(*args, **kwargs) -> "
|
|
44
|
+
def create_environment(*args, **kwargs) -> "tuple[dict, EMC]":
|
|
45
45
|
"""Create a qBraid environment."""
|
|
46
46
|
from qbraid_core.services.environments.client import EnvironmentManagerClient
|
|
47
47
|
|
|
48
48
|
client = EnvironmentManagerClient()
|
|
49
49
|
return client.create_environment(*args, **kwargs), client
|
|
50
50
|
|
|
51
|
-
def gather_local_data() ->
|
|
51
|
+
def gather_local_data() -> tuple[Path, str]:
|
|
52
52
|
"""Gather environment data and return the slug."""
|
|
53
53
|
from qbraid_core.services.environments import get_default_envs_paths
|
|
54
54
|
|
|
@@ -155,7 +155,7 @@ def envs_remove(
|
|
|
155
155
|
emc = EnvironmentManagerClient()
|
|
156
156
|
emc.delete_environment(slug)
|
|
157
157
|
|
|
158
|
-
def gather_local_data(env_name: str) ->
|
|
158
|
+
def gather_local_data(env_name: str) -> tuple[Path, str]:
|
|
159
159
|
"""Get environment path and slug from name (alias)."""
|
|
160
160
|
installed, aliases = installed_envs_data()
|
|
161
161
|
for alias, slug in aliases.items():
|
|
@@ -10,7 +10,7 @@ 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 typing import Any, Callable,
|
|
13
|
+
from typing import Any, Callable, Optional, Union
|
|
14
14
|
|
|
15
15
|
import typer
|
|
16
16
|
from rich.console import Console
|
|
@@ -136,13 +136,13 @@ def run_progress_task(
|
|
|
136
136
|
return handle_error(message=custom_message)
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
def _format_list_items(items:
|
|
139
|
+
def _format_list_items(items: list[str]) -> str:
|
|
140
140
|
"""
|
|
141
141
|
Formats a list of items as a string with values comma-separated and
|
|
142
142
|
each item surrounded by single quotes
|
|
143
143
|
|
|
144
144
|
Args:
|
|
145
|
-
items (
|
|
145
|
+
items (list[str]): The list of items to format.
|
|
146
146
|
|
|
147
147
|
Returns:
|
|
148
148
|
str: The formatted string.
|
|
@@ -151,14 +151,14 @@ def _format_list_items(items: List[str]) -> str:
|
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
def validate_item(
|
|
154
|
-
value: Optional[str], allowed_items:
|
|
154
|
+
value: Optional[str], allowed_items: list[str], item_type: str
|
|
155
155
|
) -> Union[str, None]:
|
|
156
156
|
"""
|
|
157
157
|
Generic item validation function.
|
|
158
158
|
|
|
159
159
|
Args:
|
|
160
160
|
value (optional, str): The value to validate.
|
|
161
|
-
allowed_items (
|
|
161
|
+
allowed_items (list[str]): A list of allowed items.
|
|
162
162
|
item_type (str): A description of the item type (e.g., 'provider', 'status', 'type') for
|
|
163
163
|
error messages.
|
|
164
164
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Module defining commands in the 'qbraid jobs' namespace.
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
|
-
from typing import Any, Callable
|
|
8
|
+
from typing import Any, Callable
|
|
9
9
|
|
|
10
10
|
import typer
|
|
11
11
|
from rich.console import Console
|
|
@@ -66,7 +66,7 @@ def jobs_state(
|
|
|
66
66
|
)
|
|
67
67
|
) -> None:
|
|
68
68
|
"""Display the state of qBraid Quantum Jobs for the current environment."""
|
|
69
|
-
result:
|
|
69
|
+
result: tuple[str, dict[str, tuple[bool, bool]]] = run_progress_get_state(library)
|
|
70
70
|
python_exe, state_values = result
|
|
71
71
|
state_values = dict(sorted(state_values.items()))
|
|
72
72
|
|
|
@@ -75,16 +75,18 @@ def jobs_state(
|
|
|
75
75
|
max_lib_length = max((len(lib) for lib in state_values.keys()), default=len(header_1))
|
|
76
76
|
padding = max_lib_length + 9
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
console.print(f"\n{header_1:<{padding}}{header_2}", style="bold")
|
|
80
|
-
|
|
78
|
+
output = ""
|
|
81
79
|
for lib, (installed, enabled) in state_values.items():
|
|
82
80
|
state_str = (
|
|
83
81
|
"[green]enabled"
|
|
84
82
|
if enabled and installed
|
|
85
83
|
else "[red]disabled" if installed else "[grey70]unavailable"
|
|
86
84
|
)
|
|
87
|
-
|
|
85
|
+
output += f"{lib:<{padding-1}} {state_str}\n"
|
|
86
|
+
|
|
87
|
+
console.print(f"Executable: {python_exe}")
|
|
88
|
+
console.print(f"\n{header_1:<{padding}}{header_2}", style="bold")
|
|
89
|
+
console.print(output)
|
|
88
90
|
|
|
89
91
|
|
|
90
92
|
@jobs_app.command(name="list")
|
|
@@ -95,14 +97,14 @@ def jobs_list(
|
|
|
95
97
|
) -> None:
|
|
96
98
|
"""List qBraid Quantum Jobs."""
|
|
97
99
|
|
|
98
|
-
def import_jobs() ->
|
|
100
|
+
def import_jobs() -> tuple[Any, Callable]:
|
|
99
101
|
from qbraid_core.services.quantum import QuantumClient, process_job_data
|
|
100
102
|
|
|
101
103
|
client = QuantumClient()
|
|
102
104
|
|
|
103
105
|
return client, process_job_data
|
|
104
106
|
|
|
105
|
-
result:
|
|
107
|
+
result: tuple[Any, Callable] = run_progress_task(import_jobs)
|
|
106
108
|
client, process_job_data = result
|
|
107
109
|
# https://github.com/qBraid/api/issues/644
|
|
108
110
|
# raw_data = client.search_jobs(query={"numResults": limit})
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
Module supporting 'qbraid jobs enable/disable braket' and commands.
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
|
-
|
|
9
8
|
import logging
|
|
10
9
|
import os
|
|
10
|
+
import re
|
|
11
11
|
import subprocess
|
|
12
12
|
from pathlib import Path
|
|
13
|
-
from typing import Optional
|
|
13
|
+
from typing import Optional
|
|
14
14
|
|
|
15
|
+
import requests
|
|
15
16
|
import typer
|
|
16
17
|
|
|
17
18
|
from qbraid_cli.exceptions import QbraidException
|
|
@@ -21,14 +22,26 @@ logging.basicConfig(level=logging.INFO)
|
|
|
21
22
|
logger = logging.getLogger(__name__)
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
def
|
|
25
|
+
def fetch_botocore_version() -> Optional[str]:
|
|
26
|
+
"""Fetch the latest version of the botocore package from the qBraid GitHub repository."""
|
|
27
|
+
url = "https://raw.githubusercontent.com/qBraid/botocore/develop/botocore/__init__.py"
|
|
28
|
+
response = requests.get(url, timeout=5)
|
|
29
|
+
if response.status_code == 200:
|
|
30
|
+
content = response.text
|
|
31
|
+
version_match = re.search(r"__version__\s*=\s*['\"]([^'\"]+)['\"]", content)
|
|
32
|
+
if version_match:
|
|
33
|
+
return version_match.group(1)
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_package_data(package: str) -> tuple[str, str, str, str]:
|
|
25
38
|
"""Retrieve package version and location data.
|
|
26
39
|
|
|
27
40
|
Args:
|
|
28
41
|
package (str): The name of the package to retrieve data for.
|
|
29
42
|
|
|
30
43
|
Returns:
|
|
31
|
-
|
|
44
|
+
tuple[str, str, str, str]: The installed and latest versions of the package, and the
|
|
32
45
|
local site-packages path where it is / would be installed.
|
|
33
46
|
|
|
34
47
|
Raises:
|
|
@@ -45,7 +58,12 @@ def get_package_data(package: str) -> Tuple[str, str, str, str]:
|
|
|
45
58
|
python_pathlib = get_active_python_path()
|
|
46
59
|
site_packages_path = get_active_site_packages_path(python_path=python_pathlib)
|
|
47
60
|
installed_version = get_local_package_version(package, python_path=python_pathlib)
|
|
48
|
-
|
|
61
|
+
|
|
62
|
+
latest_version = None
|
|
63
|
+
if package in ["botocore", "boto3"]:
|
|
64
|
+
latest_version = fetch_botocore_version()
|
|
65
|
+
latest_version = latest_version or get_latest_package_version(package)
|
|
66
|
+
|
|
49
67
|
except QbraidSystemError as err:
|
|
50
68
|
raise QbraidException("Failed to retrieve required system and/or package metadata") from err
|
|
51
69
|
|
|
@@ -56,7 +74,7 @@ def confirm_updates(
|
|
|
56
74
|
mode: str,
|
|
57
75
|
site_packages_path: str,
|
|
58
76
|
installed_version: Optional[str] = None,
|
|
59
|
-
|
|
77
|
+
target_version: Optional[str] = None,
|
|
60
78
|
) -> None:
|
|
61
79
|
"""
|
|
62
80
|
Prompts the user to proceed with enabling or disabling qBraid Quantum Jobs.
|
|
@@ -66,7 +84,7 @@ def confirm_updates(
|
|
|
66
84
|
site_packages_path (str): The location of the site-packages directory where
|
|
67
85
|
target package(s) will be updated.
|
|
68
86
|
installed_version (optional, str): The installed version of the target package.
|
|
69
|
-
|
|
87
|
+
target_version (optional, str): The latest version of the target package available on PyPI.
|
|
70
88
|
|
|
71
89
|
Raises:
|
|
72
90
|
ValueError: If an invalid mode is provided.
|
|
@@ -87,12 +105,12 @@ def confirm_updates(
|
|
|
87
105
|
typer.echo(f"\n==> WARNING: {provider}/{core_package} package required <==")
|
|
88
106
|
if (
|
|
89
107
|
installed_version is not None
|
|
90
|
-
and
|
|
91
|
-
and installed_version !=
|
|
108
|
+
and target_version is not None
|
|
109
|
+
and installed_version != target_version
|
|
92
110
|
):
|
|
93
|
-
typer.echo(f"==> WARNING: A
|
|
111
|
+
typer.echo(f"==> WARNING: A different version of {versioned_package} is required. <==")
|
|
94
112
|
typer.echo(f" current version: {installed_version}")
|
|
95
|
-
typer.echo(f"
|
|
113
|
+
typer.echo(f" target version: {target_version}")
|
|
96
114
|
|
|
97
115
|
gerund = mode[:-2].capitalize() + "ing"
|
|
98
116
|
|
|
@@ -128,18 +146,18 @@ def aws_configure_dummy() -> None:
|
|
|
128
146
|
|
|
129
147
|
def enable_braket(auto_confirm: bool = False):
|
|
130
148
|
"""Enable qBraid quantum jobs for Amazon Braket."""
|
|
131
|
-
installed,
|
|
149
|
+
installed, target, path, python_exe = run_progress_task(
|
|
132
150
|
get_package_data, "boto3", description="Solving environment..."
|
|
133
151
|
)
|
|
134
152
|
|
|
135
153
|
if not auto_confirm:
|
|
136
|
-
confirm_updates("enable", path, installed_version=installed,
|
|
154
|
+
confirm_updates("enable", path, installed_version=installed, target_version=target)
|
|
137
155
|
typer.echo("")
|
|
138
156
|
|
|
139
157
|
aws_configure_dummy() # TODO: possibly add another confirmation for writing aws config files
|
|
140
158
|
|
|
141
159
|
try:
|
|
142
|
-
subprocess.check_call([python_exe, "-m", "pip", "install", "
|
|
160
|
+
subprocess.check_call([python_exe, "-m", "pip", "install", f"boto3=={target}"])
|
|
143
161
|
subprocess.check_call([python_exe, "-m", "pip", "uninstall", "botocore", "-y", "--quiet"])
|
|
144
162
|
subprocess.check_call(
|
|
145
163
|
[python_exe, "-m", "pip", "install", "git+https://github.com/qBraid/botocore.git"]
|
|
@@ -6,14 +6,14 @@ Module for validating command arguments for qBraid Quantum Jobs.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
import sys
|
|
9
|
-
from typing import Any, Callable,
|
|
9
|
+
from typing import Any, Callable, Optional
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
12
|
from rich.console import Console
|
|
13
13
|
|
|
14
14
|
from qbraid_cli.handlers import handle_error, run_progress_task, validate_item
|
|
15
15
|
|
|
16
|
-
LEGACY_ARGS:
|
|
16
|
+
LEGACY_ARGS: dict[str, str] = {
|
|
17
17
|
"amazon_braket": "braket",
|
|
18
18
|
"aws_braket": "braket",
|
|
19
19
|
}
|
|
@@ -39,14 +39,14 @@ def validate_library(value: str) -> str:
|
|
|
39
39
|
return validate_item(value, qjobs_libs, "Library")
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def get_state(library: Optional[str] = None) ->
|
|
42
|
+
def get_state(library: Optional[str] = None) -> tuple[str, dict[str, tuple[bool, bool]]]:
|
|
43
43
|
"""Get the state of qBraid Quantum Jobs for the specified library."""
|
|
44
44
|
from qbraid_core.services.quantum import QuantumClient
|
|
45
45
|
|
|
46
46
|
jobs_state = QuantumClient.qbraid_jobs_state(device_lib=library)
|
|
47
47
|
|
|
48
48
|
python_exe: str = jobs_state.get("exe", sys.executable)
|
|
49
|
-
libs_state:
|
|
49
|
+
libs_state: dict[str, Any] = jobs_state.get("libs", {})
|
|
50
50
|
|
|
51
51
|
state_values = {
|
|
52
52
|
lib: (state["supported"], state["enabled"]) for lib, state in libs_state.items()
|
|
@@ -57,7 +57,7 @@ def get_state(library: Optional[str] = None) -> Tuple[str, Dict[str, Tuple[bool,
|
|
|
57
57
|
|
|
58
58
|
def run_progress_get_state(
|
|
59
59
|
library: Optional[str] = None,
|
|
60
|
-
) ->
|
|
60
|
+
) -> tuple[str, dict[str, tuple[bool, bool]]]:
|
|
61
61
|
"""Run get state function with rich progress UI."""
|
|
62
62
|
return run_progress_task(
|
|
63
63
|
get_state,
|
|
@@ -36,7 +36,7 @@ def find_matching_prefix(python_executable: Path, path_list: list[Path]) -> Opti
|
|
|
36
36
|
|
|
37
37
|
Args:
|
|
38
38
|
python_executable (Path): The path to the Python executable.
|
|
39
|
-
path_list (
|
|
39
|
+
path_list (list[Path]): A list of paths to check against the Python executable path.
|
|
40
40
|
|
|
41
41
|
Returns:
|
|
42
42
|
Optional[Path]: The first matching path that is a prefix of the Python executable path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.5
|
|
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,7 +8,6 @@ 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
|
|
12
11
|
Keywords: qbraid,cli,quantum,cloud
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -29,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
29
28
|
License-File: LICENSE
|
|
30
29
|
Requires-Dist: typer>=0.12.1
|
|
31
30
|
Requires-Dist: rich>=10.11.0
|
|
32
|
-
Requires-Dist: qbraid-core[environments]>=0.1.
|
|
31
|
+
Requires-Dist: qbraid-core[environments]>=0.1.23
|
|
33
32
|
Provides-Extra: jobs
|
|
34
33
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
34
|
Provides-Extra: dev
|
|
@@ -61,7 +61,6 @@ qbraid_cli.egg-info/requires.txt
|
|
|
61
61
|
qbraid_cli.egg-info/top_level.txt
|
|
62
62
|
qbraid_cli/admin/__init__.py
|
|
63
63
|
qbraid_cli/admin/app.py
|
|
64
|
-
qbraid_cli/admin/buildlogs.py
|
|
65
64
|
qbraid_cli/admin/headers.py
|
|
66
65
|
qbraid_cli/admin/validation.py
|
|
67
66
|
qbraid_cli/configure/__init__.py
|
|
@@ -49,4 +49,4 @@ def test_version_warning():
|
|
|
49
49
|
latest_version = "1.2.0"
|
|
50
50
|
with patch("typer.echo") as mock_echo, patch("typer.confirm", return_value=True):
|
|
51
51
|
confirm_updates("enable", "/fake/site-packages", installed_version, latest_version)
|
|
52
|
-
mock_echo.assert_any_call("==> WARNING: A
|
|
52
|
+
mock_echo.assert_any_call("==> WARNING: A different version of boto3 is required. <==")
|
|
@@ -12,7 +12,7 @@ from unittest.mock import call, patch
|
|
|
12
12
|
import pytest
|
|
13
13
|
import typer
|
|
14
14
|
|
|
15
|
-
from qbraid_cli.jobs.toggle_braket import enable_braket
|
|
15
|
+
from qbraid_cli.jobs.toggle_braket import enable_braket, fetch_botocore_version
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def test_helper_function_invocations():
|
|
@@ -37,10 +37,12 @@ def test_subprocess_calls():
|
|
|
37
37
|
"""Test the subprocess calls within `enable_braket`."""
|
|
38
38
|
mock_python_path = "/usr/bin/python"
|
|
39
39
|
|
|
40
|
+
version = fetch_botocore_version()
|
|
41
|
+
|
|
40
42
|
with (
|
|
41
43
|
patch(
|
|
42
44
|
"qbraid_cli.jobs.toggle_braket.get_package_data",
|
|
43
|
-
return_value=("1.0.0",
|
|
45
|
+
return_value=("1.0.0", version, "/some/path", mock_python_path),
|
|
44
46
|
),
|
|
45
47
|
patch("qbraid_cli.jobs.toggle_braket.confirm_updates"),
|
|
46
48
|
patch("qbraid_cli.jobs.toggle_braket.aws_configure_dummy"),
|
|
@@ -50,7 +52,7 @@ def test_subprocess_calls():
|
|
|
50
52
|
|
|
51
53
|
# Expected subprocess calls in order
|
|
52
54
|
expected_calls = [
|
|
53
|
-
call([mock_python_path, "-m", "pip", "install", "
|
|
55
|
+
call([mock_python_path, "-m", "pip", "install", f"boto3=={version}"]),
|
|
54
56
|
call([mock_python_path, "-m", "pip", "uninstall", "botocore", "-y", "--quiet"]),
|
|
55
57
|
call(
|
|
56
58
|
[
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Copyright (c) 2024, qBraid Development Team
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
|
+
# pylint: disable=unused-argument
|
|
5
|
+
|
|
4
6
|
"""
|
|
5
7
|
Unit tests for commands and helper functions in the 'qbraid envs' namespace.
|
|
6
8
|
|
|
@@ -12,6 +14,7 @@ from qbraid_cli.kernels.app import kernels_list
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def mock_is_exe(path):
|
|
17
|
+
"""Mock function checking if given path is a valid executable."""
|
|
15
18
|
return path == "/path/to/bin/python3", "-m", "ipykernel_launcher", "-f", "test"
|
|
16
19
|
|
|
17
20
|
|
|
@@ -70,7 +73,9 @@ def test_kernels_list_multiple_kernels_available(mock_console, mock_list_kernels
|
|
|
70
73
|
|
|
71
74
|
expected_calls = [
|
|
72
75
|
call(
|
|
73
|
-
"# qbraid kernels:\n#\n\npython3
|
|
76
|
+
"# qbraid kernels:\n#\n\npython3 "
|
|
77
|
+
"/path/to/python3/kernel\nanother_kernel "
|
|
78
|
+
"/path/to/another/kernel"
|
|
74
79
|
),
|
|
75
80
|
]
|
|
76
81
|
actual_calls = mock_console.return_value.print.call_args_list
|