qbraid-cli 0.8.0.dev4__tar.gz → 0.8.0.dev6__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.dev4/qbraid_cli.egg-info → qbraid_cli-0.8.0.dev6}/PKG-INFO +4 -3
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/index.rst +2 -1
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/requirements.txt +1 -1
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/pyproject.toml +4 -3
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/_version.py +2 -2
- qbraid_cli-0.8.0.dev6/qbraid_cli/admin/__init__.py +9 -0
- qbraid_cli-0.8.0.dev6/qbraid_cli/admin/app.py +50 -0
- qbraid_cli-0.8.0.dev6/qbraid_cli/admin/headers.py +193 -0
- qbraid_cli-0.8.0.dev6/qbraid_cli/admin/validation.py +33 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/configure/app.py +16 -1
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/devices/validation.py +0 -1
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/jobs/toggle_braket.py +2 -23
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/main.py +5 -5
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6/qbraid_cli.egg-info}/PKG-INFO +4 -3
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli.egg-info/SOURCES.txt +4 -1
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli.egg-info/requires.txt +3 -2
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_configure/test_configure_set.py +2 -2
- qbraid_cli-0.8.dev4/tests/test_jobs/test_toggle_braket/test_aws_configure_dummy.py +0 -49
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.env.example +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/workflows/docs.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/workflows/format.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/workflows/main.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/workflows/publish.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.github/workflows/test-publish.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.gitignore +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/.readthedocs.yml +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/CONTRIBUTING.md +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/MANIFEST.IN +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/Makefile +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/README.md +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/Makefile +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/api-key.png +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/cards/jupyter.png +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/cards/python.png +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/cards/terminal.png +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/configure.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/credits.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/devices-list.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/devices.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/envs-activate.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/envs-list.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/envs-uninstall.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/envs.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/jobs-add.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/jobs-disable.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/jobs-enable.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/jobs-list.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/jobs.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/kernels.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/cli/qbraid.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/conf.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/guide/overview.rst +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/docs/make.bat +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/credits/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/credits/app.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/envs/app.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/jobs/validation.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/setup.cfg +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_configure/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_configure/test_prompt_for_config.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_configure/test_validate_input.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_credits/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_credits/test_credits_value.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_devices/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_devices/test_devices_list.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_devices/test_validations.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/test_activate_pyenv.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/test_find_shell_rc.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/test_print_activate_command.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/test_envs_activate.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/test_envs_create.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/test_envs_list.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/test_envs_remove.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/test_create_qbraid_env_assets.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/test_replace_str.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/test_update_state_json.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/test_installed_envs_data.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/test_is_valid_env_name.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/test_request_delete_env.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/test_validate_env_name.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_app/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_app/test_jobs_disable.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_app/test_jobs_enable.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_app/test_jobs_list.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_app/test_jobs_state.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/test_confirm_updates.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/test_disable_braket.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/test_enable_braket.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/test_get_package_data.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/test_get_state.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/test_handle_jobs_state.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/test_run_progress_get_state.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/test_validate_library.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_kernels/__init__.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_kernels/test_kernels_list.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tools/split_rst.py +0 -0
- {qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tools/verify_headers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.0.
|
|
3
|
+
Version: 0.8.0.dev6
|
|
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,8 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
Requires-Dist: typer>=0.12.1
|
|
30
30
|
Requires-Dist: rich>=10.11.0
|
|
31
31
|
Requires-Dist: jupyter_client<9.0.0,>=7.0.0
|
|
32
|
-
Requires-Dist:
|
|
32
|
+
Requires-Dist: ipykernel
|
|
33
|
+
Requires-Dist: qbraid-core>=0.1.4
|
|
33
34
|
Provides-Extra: jobs
|
|
34
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
36
|
Provides-Extra: dev
|
|
@@ -40,7 +41,7 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
40
41
|
Provides-Extra: docs
|
|
41
42
|
Requires-Dist: sphinx~=7.2.6; extra == "docs"
|
|
42
43
|
Requires-Dist: sphinx-rtd-theme<2.1,>=1.3; extra == "docs"
|
|
43
|
-
Requires-Dist: docutils<0.
|
|
44
|
+
Requires-Dist: docutils<0.22; extra == "docs"
|
|
44
45
|
Requires-Dist: toml; extra == "docs"
|
|
45
46
|
Requires-Dist: build; extra == "docs"
|
|
46
47
|
Requires-Dist: m2r; extra == "docs"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.8.0.
|
|
7
|
+
version = "0.8.0.dev6"
|
|
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,8 @@ dependencies = [
|
|
|
30
30
|
"typer>=0.12.1",
|
|
31
31
|
"rich>=10.11.0",
|
|
32
32
|
"jupyter_client>=7.0.0,<9.0.0",
|
|
33
|
-
"
|
|
33
|
+
"ipykernel",
|
|
34
|
+
"qbraid-core>=0.1.4",
|
|
34
35
|
]
|
|
35
36
|
requires-python = ">= 3.9"
|
|
36
37
|
|
|
@@ -44,7 +45,7 @@ Discord = "https://discord.gg/KugF6Cnncm"
|
|
|
44
45
|
[project.optional-dependencies]
|
|
45
46
|
jobs = ["amazon-braket-sdk>=1.48.1"]
|
|
46
47
|
dev = ["black", "isort", "pylint", "pytest"]
|
|
47
|
-
docs = ["sphinx~=7.2.6", "sphinx-rtd-theme>=1.3,<2.1", "docutils<0.
|
|
48
|
+
docs = ["sphinx~=7.2.6", "sphinx-rtd-theme>=1.3,<2.1", "docutils<0.22", "toml", "build", "m2r", "typer"]
|
|
48
49
|
|
|
49
50
|
[project.scripts]
|
|
50
51
|
qbraid = "qbraid_cli.main:app"
|
|
@@ -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+gac06e26'
|
|
16
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'gac06e26')
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module defining commands in the 'qbraid admin' namespace.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
from qbraid_cli.admin.headers import check_and_fix_headers
|
|
14
|
+
from qbraid_cli.admin.validation import validate_header_type, validate_paths_exist
|
|
15
|
+
|
|
16
|
+
# disable pretty_exceptions_show_locals to avoid printing sensative information in the traceback
|
|
17
|
+
admin_app = typer.Typer(
|
|
18
|
+
help="CI/CD commands for qBraid maintainers.",
|
|
19
|
+
pretty_exceptions_show_locals=False,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@admin_app.command(name="headers")
|
|
24
|
+
def admin_headers(
|
|
25
|
+
src_paths: List[str] = typer.Argument(
|
|
26
|
+
..., help="Source file or directory paths to verify.", callback=validate_paths_exist
|
|
27
|
+
),
|
|
28
|
+
header_type: str = typer.Option(
|
|
29
|
+
"default",
|
|
30
|
+
"--type",
|
|
31
|
+
"-t",
|
|
32
|
+
help="Type of header to use ('default' or 'gpl').",
|
|
33
|
+
callback=validate_header_type,
|
|
34
|
+
),
|
|
35
|
+
skip_files: List[str] = typer.Option(
|
|
36
|
+
[], "--skip", "-s", help="Files to skip during verification.", callback=validate_paths_exist
|
|
37
|
+
),
|
|
38
|
+
fix: bool = typer.Option(
|
|
39
|
+
False, "--fix", "-f", help="Whether to fix the headers instead of just verifying."
|
|
40
|
+
),
|
|
41
|
+
):
|
|
42
|
+
"""
|
|
43
|
+
Verifies and optionally fixes qBraid headers in specified files and directories.
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
check_and_fix_headers(src_paths, header_type=header_type, skip_files=skip_files, fix=fix)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
admin_app()
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Script to verify qBraid copyright file headers
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
import os
|
|
9
|
+
import sys
|
|
10
|
+
from typing import List, Optional
|
|
11
|
+
|
|
12
|
+
from rich.console import Console
|
|
13
|
+
|
|
14
|
+
# pylint: disable=too-many-branches,too-many-statements
|
|
15
|
+
|
|
16
|
+
DEFAULT_HEADER = """# Copyright (c) 2024, qBraid Development Team
|
|
17
|
+
# All rights reserved.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
DEFAULT_HEADER_GPL = """# Copyright (C) 2024 qBraid
|
|
21
|
+
#
|
|
22
|
+
# This file is part of the qBraid-SDK
|
|
23
|
+
#
|
|
24
|
+
# The qBraid-SDK is free software released under the GNU General Public License v3
|
|
25
|
+
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
|
|
26
|
+
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
|
|
27
|
+
#
|
|
28
|
+
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
HEADER_TYPES = {
|
|
32
|
+
"default": DEFAULT_HEADER,
|
|
33
|
+
"gpl": DEFAULT_HEADER_GPL,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def check_and_fix_headers(
|
|
38
|
+
src_paths: List[str],
|
|
39
|
+
header_type: str = "default",
|
|
40
|
+
skip_files: Optional[List[str]] = None,
|
|
41
|
+
fix: bool = False,
|
|
42
|
+
) -> None:
|
|
43
|
+
"""Script to add or verify qBraid copyright file headers"""
|
|
44
|
+
try:
|
|
45
|
+
header = HEADER_TYPES[header_type]
|
|
46
|
+
except KeyError as err:
|
|
47
|
+
raise ValueError(
|
|
48
|
+
f"Invalid header type: {HEADER_TYPES}. Expected one of {list(HEADER_TYPES.keys())}"
|
|
49
|
+
) from err
|
|
50
|
+
|
|
51
|
+
for path in src_paths:
|
|
52
|
+
if not os.path.exists(path):
|
|
53
|
+
sys.stderr.write(
|
|
54
|
+
f"Usage: qbraid verify_headers [OPTIONS] SRC ...\n"
|
|
55
|
+
f"Try 'qbraid verify_headers --help' for help.\n\n"
|
|
56
|
+
f"Error: Invalid value for 'SRC ...': Path '{path}' does not exist.\n"
|
|
57
|
+
)
|
|
58
|
+
sys.exit(1)
|
|
59
|
+
|
|
60
|
+
header_2023 = header.replace("2024", "2023")
|
|
61
|
+
|
|
62
|
+
skip_files = skip_files or []
|
|
63
|
+
|
|
64
|
+
failed_headers = []
|
|
65
|
+
fixed_headers = []
|
|
66
|
+
|
|
67
|
+
console = Console()
|
|
68
|
+
|
|
69
|
+
def should_skip(file_path: str, content: str) -> bool:
|
|
70
|
+
if file_path in skip_files:
|
|
71
|
+
return True
|
|
72
|
+
|
|
73
|
+
if os.path.basename(file_path) == "__init__.py":
|
|
74
|
+
return not content.strip()
|
|
75
|
+
|
|
76
|
+
skip_header_tag = "# qbraid: skip-header"
|
|
77
|
+
line_number = 0
|
|
78
|
+
|
|
79
|
+
for line in content.splitlines():
|
|
80
|
+
line_number += 1
|
|
81
|
+
if 5 <= line_number <= 30 and skip_header_tag in line:
|
|
82
|
+
return True
|
|
83
|
+
if line_number > 30:
|
|
84
|
+
break
|
|
85
|
+
|
|
86
|
+
return False
|
|
87
|
+
|
|
88
|
+
def replace_or_add_header(file_path: str, fix: bool = False) -> None:
|
|
89
|
+
with open(file_path, "r", encoding="ISO-8859-1") as f:
|
|
90
|
+
content = f.read()
|
|
91
|
+
|
|
92
|
+
# This finds the start of the actual content after skipping initial whitespace and comments.
|
|
93
|
+
lines = content.splitlines()
|
|
94
|
+
first_non_comment_line_index = next(
|
|
95
|
+
(i for i, line in enumerate(lines) if not line.strip().startswith("#")), None
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
# Prepare the content by stripping leading and trailing whitespace and separating into lines
|
|
99
|
+
actual_content = (
|
|
100
|
+
"\n".join(lines[first_non_comment_line_index:]).strip()
|
|
101
|
+
if first_non_comment_line_index is not None
|
|
102
|
+
else ""
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# Check if the content already starts with the header or if the file should be skipped
|
|
106
|
+
if (
|
|
107
|
+
content.lstrip().startswith(header)
|
|
108
|
+
or content.lstrip().startswith(header_2023)
|
|
109
|
+
or should_skip(file_path, content)
|
|
110
|
+
):
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
if not fix:
|
|
114
|
+
failed_headers.append(file_path)
|
|
115
|
+
else:
|
|
116
|
+
# Form the new content by combining the header, one blank line, and the actual content
|
|
117
|
+
new_content = header.strip() + "\n\n" + actual_content
|
|
118
|
+
with open(file_path, "w", encoding="ISO-8859-1") as f:
|
|
119
|
+
f.write(new_content)
|
|
120
|
+
fixed_headers.append(file_path)
|
|
121
|
+
|
|
122
|
+
def process_files_in_directory(directory: str, fix: bool = False) -> int:
|
|
123
|
+
count = 0
|
|
124
|
+
if not os.path.isdir(directory):
|
|
125
|
+
return count
|
|
126
|
+
for root, _, files in os.walk(directory):
|
|
127
|
+
for file in files:
|
|
128
|
+
if file.endswith(".py"):
|
|
129
|
+
file_path = os.path.join(root, file)
|
|
130
|
+
replace_or_add_header(file_path, fix)
|
|
131
|
+
count += 1
|
|
132
|
+
return count
|
|
133
|
+
|
|
134
|
+
checked = 0
|
|
135
|
+
for item in src_paths:
|
|
136
|
+
if os.path.isdir(item):
|
|
137
|
+
checked += process_files_in_directory(item, fix)
|
|
138
|
+
elif os.path.isfile(item) and item.endswith(".py"):
|
|
139
|
+
replace_or_add_header(item, fix)
|
|
140
|
+
checked += 1
|
|
141
|
+
else:
|
|
142
|
+
failed_headers.append(item)
|
|
143
|
+
print(f"File or directory not found: {item}")
|
|
144
|
+
|
|
145
|
+
if not fix:
|
|
146
|
+
if failed_headers:
|
|
147
|
+
for file in failed_headers:
|
|
148
|
+
console.print(f"[bold]would fix {file}[/bold]")
|
|
149
|
+
num_failed = len(failed_headers)
|
|
150
|
+
num_passed = checked - num_failed
|
|
151
|
+
s1, s2 = ("", "s") if num_failed == 1 else ("s", "")
|
|
152
|
+
s_passed = "" if num_passed == 1 else "s"
|
|
153
|
+
console.print("[bold]\nOh no![/bold] 💥 💔 💥")
|
|
154
|
+
if num_passed > 0:
|
|
155
|
+
punc = ", "
|
|
156
|
+
passed_msg = f"[blue]{num_passed}[/blue] file{s_passed} would be left unchanged."
|
|
157
|
+
else:
|
|
158
|
+
punc = "."
|
|
159
|
+
passed_msg = ""
|
|
160
|
+
|
|
161
|
+
failed_msg = f"[bold][blue]{num_failed}[/blue] file{s1} need{s2} updating{punc}[/bold]"
|
|
162
|
+
console.print(f"{failed_msg}{passed_msg}")
|
|
163
|
+
elif checked == 0:
|
|
164
|
+
console.print("[bold]No Python files present. Nothing to do[/bold] 😴")
|
|
165
|
+
else:
|
|
166
|
+
s_checked = "" if checked == 1 else "s"
|
|
167
|
+
console.print("[bold]All done![/bold] ✨ 🚀 ✨")
|
|
168
|
+
console.print(f"[blue]{checked}[/blue] file{s_checked} would be left unchanged.")
|
|
169
|
+
|
|
170
|
+
else:
|
|
171
|
+
for file in fixed_headers:
|
|
172
|
+
console.print(f"[bold]fixed {file}[/bold]")
|
|
173
|
+
num_fixed = len(fixed_headers)
|
|
174
|
+
num_ok = checked - num_fixed
|
|
175
|
+
s_fixed = "" if num_fixed == 1 else "s"
|
|
176
|
+
s_ok = "" if num_ok == 1 else "s"
|
|
177
|
+
console.print("\n[bold]All done![/bold] ✨ 🚀 ✨")
|
|
178
|
+
if num_ok > 0:
|
|
179
|
+
punc = ", "
|
|
180
|
+
unchanged_msg = f"[blue]{num_ok}[/blue] file{s_ok} left unchanged."
|
|
181
|
+
else:
|
|
182
|
+
punc = "."
|
|
183
|
+
unchanged_msg = ""
|
|
184
|
+
|
|
185
|
+
if num_fixed > 0:
|
|
186
|
+
fixed_msg = f"[bold][blue]{num_fixed}[/blue] file{s_fixed} fixed{punc}[/bold]"
|
|
187
|
+
else:
|
|
188
|
+
fixed_msg = ""
|
|
189
|
+
|
|
190
|
+
if fixed_msg or unchanged_msg:
|
|
191
|
+
console.print(f"{fixed_msg}{unchanged_msg}")
|
|
192
|
+
else:
|
|
193
|
+
console.print("[bold]No Python files present. Nothing to do[/bold] 😴")
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module for validating command arguments for qBraid admin commands.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
from typing import List
|
|
11
|
+
|
|
12
|
+
import typer
|
|
13
|
+
|
|
14
|
+
from qbraid_cli.admin.headers import HEADER_TYPES
|
|
15
|
+
from qbraid_cli.handlers import _format_list_items, validate_item
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def validate_header_type(value: str) -> str:
|
|
19
|
+
"""Validate header type."""
|
|
20
|
+
header_types = list(HEADER_TYPES.keys())
|
|
21
|
+
return validate_item(value, header_types, "Header type")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def validate_paths_exist(paths: List[str]) -> List[str]:
|
|
25
|
+
"""Verifies that each path in the provided list exists."""
|
|
26
|
+
non_existent_paths = [path for path in paths if not os.path.exists(path)]
|
|
27
|
+
if non_existent_paths:
|
|
28
|
+
if len(non_existent_paths) == 1:
|
|
29
|
+
raise typer.BadParameter(f"Path '{non_existent_paths[0]}' does not exist")
|
|
30
|
+
raise typer.BadParameter(
|
|
31
|
+
f"The following paths do not exist: {_format_list_items(non_existent_paths)}"
|
|
32
|
+
)
|
|
33
|
+
return paths
|
|
@@ -7,7 +7,6 @@ Module defining commands in the 'qbraid configure' namespace.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import typer
|
|
10
|
-
from qbraid_core.config import load_config, save_config
|
|
11
10
|
|
|
12
11
|
from qbraid_cli.configure.actions import default_action
|
|
13
12
|
|
|
@@ -39,6 +38,9 @@ def configure_set(
|
|
|
39
38
|
profile: str = typer.Option("default", help="Profile name"),
|
|
40
39
|
):
|
|
41
40
|
"""Set configuration value in qbraidrc file."""
|
|
41
|
+
# pylint: disable-next=import-outside-toplevel
|
|
42
|
+
from qbraid_core.config import load_config, save_config
|
|
43
|
+
|
|
42
44
|
config = load_config()
|
|
43
45
|
|
|
44
46
|
if profile not in config:
|
|
@@ -50,5 +52,18 @@ def configure_set(
|
|
|
50
52
|
typer.echo("Configuration updated successfully.")
|
|
51
53
|
|
|
52
54
|
|
|
55
|
+
@configure_app.command(name="magic")
|
|
56
|
+
def configure_magic():
|
|
57
|
+
"""Configure qBraid IPython magic commands."""
|
|
58
|
+
# pylint: disable-next=import-outside-toplevel
|
|
59
|
+
from qbraid_core.services.environments import add_magic_config
|
|
60
|
+
|
|
61
|
+
add_magic_config()
|
|
62
|
+
|
|
63
|
+
typer.echo("Successfully configured qBraid IPython magic commands.")
|
|
64
|
+
typer.echo("You can now use the qBraid-CLI from inside a Jupyter notebook as follows:")
|
|
65
|
+
typer.echo("\n\n\t[ ] %load_ext qbraid_magic\n\n\t[ ] %qbraid")
|
|
66
|
+
|
|
67
|
+
|
|
53
68
|
if __name__ == "__main__":
|
|
54
69
|
configure_app()
|
|
@@ -120,32 +120,11 @@ def aws_configure_dummy() -> None:
|
|
|
120
120
|
"""
|
|
121
121
|
Initializes AWS configuration and credentials files with placeholder values.
|
|
122
122
|
|
|
123
|
-
This function ensures the existence of AWS config and credentials files in the user's home
|
|
124
|
-
directory. If these files do not already exist, it creates them and populates them with
|
|
125
|
-
placeholder values for the AWS access key and secret access key. While AWS credentials are not
|
|
126
|
-
required when submitting quantum tasks through qBraid, Amazon Braket requires these files to be
|
|
127
|
-
present to prevent configuration errors.
|
|
128
123
|
"""
|
|
129
|
-
|
|
130
|
-
config_path = aws_dir / "config"
|
|
131
|
-
credentials_path = aws_dir / "credentials"
|
|
132
|
-
|
|
133
|
-
def configure_aws():
|
|
134
|
-
aws_dir.mkdir(exist_ok=True)
|
|
135
|
-
if not config_path.exists():
|
|
136
|
-
config_content = "[default]\nregion = us-east-1\noutput = json\n"
|
|
137
|
-
config_path.write_text(config_content)
|
|
138
|
-
if not credentials_path.exists():
|
|
139
|
-
access_key, secret_key = "MYACCESSKEY", "MYSECRETKEY"
|
|
140
|
-
credentials_content = (
|
|
141
|
-
f"[default]\n"
|
|
142
|
-
f"aws_access_key_id = {access_key}\n"
|
|
143
|
-
f"aws_secret_access_key = {secret_key}\n"
|
|
144
|
-
)
|
|
145
|
-
credentials_path.write_text(credentials_content)
|
|
124
|
+
from qbraid_core.services.quantum.proxy_braket import aws_configure
|
|
146
125
|
|
|
147
126
|
try:
|
|
148
|
-
handle_filesystem_operation(
|
|
127
|
+
handle_filesystem_operation(aws_configure, Path.home() / ".aws")
|
|
149
128
|
except QbraidException:
|
|
150
129
|
handle_error(message="Failed to configure qBraid quantum jobs.")
|
|
151
130
|
|
|
@@ -7,8 +7,8 @@ Entrypoint for the qBraid CLI.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import typer
|
|
10
|
-
import urllib3
|
|
11
10
|
|
|
11
|
+
from qbraid_cli.admin.app import admin_app
|
|
12
12
|
from qbraid_cli.configure.app import configure_app
|
|
13
13
|
from qbraid_cli.credits.app import credits_app
|
|
14
14
|
from qbraid_cli.devices.app import devices_app
|
|
@@ -17,14 +17,14 @@ from qbraid_cli.jobs.app import jobs_app
|
|
|
17
17
|
from qbraid_cli.kernels.app import kernels_app
|
|
18
18
|
|
|
19
19
|
app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})
|
|
20
|
+
|
|
21
|
+
app.add_typer(admin_app, name="admin")
|
|
20
22
|
app.add_typer(configure_app, name="configure")
|
|
23
|
+
app.add_typer(credits_app, name="credits")
|
|
24
|
+
app.add_typer(devices_app, name="devices")
|
|
21
25
|
app.add_typer(envs_app, name="envs")
|
|
22
26
|
app.add_typer(jobs_app, name="jobs")
|
|
23
|
-
app.add_typer(devices_app, name="devices")
|
|
24
27
|
app.add_typer(kernels_app, name="kernels")
|
|
25
|
-
app.add_typer(credits_app, name="credits")
|
|
26
|
-
|
|
27
|
-
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def version_callback(value: bool):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.0.
|
|
3
|
+
Version: 0.8.0.dev6
|
|
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,8 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
Requires-Dist: typer>=0.12.1
|
|
30
30
|
Requires-Dist: rich>=10.11.0
|
|
31
31
|
Requires-Dist: jupyter_client<9.0.0,>=7.0.0
|
|
32
|
-
Requires-Dist:
|
|
32
|
+
Requires-Dist: ipykernel
|
|
33
|
+
Requires-Dist: qbraid-core>=0.1.4
|
|
33
34
|
Provides-Extra: jobs
|
|
34
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
35
36
|
Provides-Extra: dev
|
|
@@ -40,7 +41,7 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
40
41
|
Provides-Extra: docs
|
|
41
42
|
Requires-Dist: sphinx~=7.2.6; extra == "docs"
|
|
42
43
|
Requires-Dist: sphinx-rtd-theme<2.1,>=1.3; extra == "docs"
|
|
43
|
-
Requires-Dist: docutils<0.
|
|
44
|
+
Requires-Dist: docutils<0.22; extra == "docs"
|
|
44
45
|
Requires-Dist: toml; extra == "docs"
|
|
45
46
|
Requires-Dist: build; extra == "docs"
|
|
46
47
|
Requires-Dist: m2r; extra == "docs"
|
|
@@ -54,6 +54,10 @@ qbraid_cli.egg-info/dependency_links.txt
|
|
|
54
54
|
qbraid_cli.egg-info/entry_points.txt
|
|
55
55
|
qbraid_cli.egg-info/requires.txt
|
|
56
56
|
qbraid_cli.egg-info/top_level.txt
|
|
57
|
+
qbraid_cli/admin/__init__.py
|
|
58
|
+
qbraid_cli/admin/app.py
|
|
59
|
+
qbraid_cli/admin/headers.py
|
|
60
|
+
qbraid_cli/admin/validation.py
|
|
57
61
|
qbraid_cli/configure/__init__.py
|
|
58
62
|
qbraid_cli/configure/actions.py
|
|
59
63
|
qbraid_cli/configure/app.py
|
|
@@ -109,7 +113,6 @@ tests/test_jobs/test_app/test_jobs_enable.py
|
|
|
109
113
|
tests/test_jobs/test_app/test_jobs_list.py
|
|
110
114
|
tests/test_jobs/test_app/test_jobs_state.py
|
|
111
115
|
tests/test_jobs/test_toggle_braket/__init__.py
|
|
112
|
-
tests/test_jobs/test_toggle_braket/test_aws_configure_dummy.py
|
|
113
116
|
tests/test_jobs/test_toggle_braket/test_confirm_updates.py
|
|
114
117
|
tests/test_jobs/test_toggle_braket/test_disable_braket.py
|
|
115
118
|
tests/test_jobs/test_toggle_braket/test_enable_braket.py
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
typer>=0.12.1
|
|
2
2
|
rich>=10.11.0
|
|
3
3
|
jupyter_client<9.0.0,>=7.0.0
|
|
4
|
-
|
|
4
|
+
ipykernel
|
|
5
|
+
qbraid-core>=0.1.4
|
|
5
6
|
|
|
6
7
|
[dev]
|
|
7
8
|
black
|
|
@@ -12,7 +13,7 @@ pytest
|
|
|
12
13
|
[docs]
|
|
13
14
|
sphinx~=7.2.6
|
|
14
15
|
sphinx-rtd-theme<2.1,>=1.3
|
|
15
|
-
docutils<0.
|
|
16
|
+
docutils<0.22
|
|
16
17
|
toml
|
|
17
18
|
build
|
|
18
19
|
m2r
|
|
@@ -17,8 +17,8 @@ def test_configure_set(capsys):
|
|
|
17
17
|
mock_save_config = MagicMock()
|
|
18
18
|
|
|
19
19
|
with (
|
|
20
|
-
patch("
|
|
21
|
-
patch("
|
|
20
|
+
patch("qbraid_core.config.load_config", mock_load_config),
|
|
21
|
+
patch("qbraid_core.config.save_config", mock_save_config),
|
|
22
22
|
):
|
|
23
23
|
configure_set("test_config", "test_value", "test_profile")
|
|
24
24
|
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
-
# All rights reserved.
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
Unit tests for the aws_configure_dummy function in the toggle_braket module.
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from unittest.mock import patch
|
|
10
|
-
|
|
11
|
-
from qbraid_cli.jobs.toggle_braket import aws_configure_dummy
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def test_aws_directory_and_files_creation():
|
|
15
|
-
"""Test create AWS dummy configuration files."""
|
|
16
|
-
with (
|
|
17
|
-
patch("pathlib.Path.mkdir") as mock_mkdir,
|
|
18
|
-
patch("pathlib.Path.exists", side_effect=[False, False]),
|
|
19
|
-
patch("pathlib.Path.write_text") as mock_write_text,
|
|
20
|
-
):
|
|
21
|
-
aws_configure_dummy()
|
|
22
|
-
mock_mkdir.assert_called_once()
|
|
23
|
-
assert mock_write_text.call_count == 2
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def test_preservation_of_existing_files():
|
|
27
|
-
"""Test if the correct placeholder values are written to the files when they are created."""
|
|
28
|
-
with (
|
|
29
|
-
patch("pathlib.Path.exists", side_effect=[True, True]),
|
|
30
|
-
patch("pathlib.Path.write_text") as mock_write_text,
|
|
31
|
-
):
|
|
32
|
-
aws_configure_dummy()
|
|
33
|
-
mock_write_text.assert_not_called()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_correct_content_in_files():
|
|
37
|
-
"""Test if the correct placeholder values are written to the files when they are created."""
|
|
38
|
-
expected_config_content = "[default]\nregion = us-east-1\noutput = json\n"
|
|
39
|
-
expected_credentials_content = (
|
|
40
|
-
"[default]\naws_access_key_id = MYACCESSKEY\naws_secret_access_key = MYSECRETKEY\n"
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
with (
|
|
44
|
-
patch("pathlib.Path.exists", side_effect=[False, False]),
|
|
45
|
-
patch("pathlib.Path.write_text") as mock_write_text,
|
|
46
|
-
):
|
|
47
|
-
aws_configure_dummy()
|
|
48
|
-
mock_write_text.assert_any_call(expected_config_content)
|
|
49
|
-
mock_write_text.assert_any_call(expected_credentials_content)
|
|
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
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_configure/test_prompt_for_config.py
RENAMED
|
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
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/test_activate_pyenv.py
RENAMED
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_activate/test_find_shell_rc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_app/test_envs_activate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/test_replace_str.py
RENAMED
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_create/test_update_state_json.py
RENAMED
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_envs/test_data_handling/__init__.py
RENAMED
|
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
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_toggle_braket/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qbraid_cli-0.8.dev4 → qbraid_cli-0.8.0.dev6}/tests/test_jobs/test_validation/test_get_state.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|