qbraid-cli 0.10.3__tar.gz → 0.10.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.10.3 → qbraid_cli-0.10.5}/.github/workflows/ci-pr-target.yml +1 -1
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/main.yml +1 -1
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/PKG-INFO +4 -3
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/pyproject.toml +2 -2
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/_version.py +2 -2
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/configure/actions.py +11 -1
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/envs/app.py +1 -2
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/envs/create.py +3 -2
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/PKG-INFO +4 -3
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/SOURCES.txt +1 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/requires.txt +1 -1
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/configure/test_configure_commands.py +2 -0
- qbraid_cli-0.10.5/tests/configure/test_configure_default.py +54 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/configure/test_configure_prompt_for_config.py +24 -7
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.env.example +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/dependabot.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/bump-version.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/docs-pr.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/docs.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/format.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/pre-release.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/publish.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.github/workflows/tag-on-merge.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.gitignore +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/.readthedocs.yml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/CONTRIBUTING.md +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/LICENSE +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/MANIFEST.IN +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/Makefile +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/README.md +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/Makefile +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/conf.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/index.rst +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/make.bat +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/docs/requirements.txt +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/chat/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/chat/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/files/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/files/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/jobs/toggle_braket.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/jobs/validation.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/setup.cfg +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/account/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/account/test_account_credits.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/admin/test_headers.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/configure/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/configure/test_configure_set.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/configure/test_configure_validate_input.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/conftest.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/devices/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/devices/test_devices_list.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/devices/test_devices_validations.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_activate.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_activate_print_command.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_activate_pyenv.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_create_from_yaml.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_list.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/envs/test_envs_remove.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/files/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/files/test_files_commands.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_disable.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_enable.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_list.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_state.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_validate_get_state.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/jobs/test_jobs_validate_library.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/kernels/__init__.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/kernels/test_kernels_list.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/resources/envs/correct.yaml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/resources/envs/icon.png +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tests/resources/envs/incorrect.yaml +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/bump_version.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/create_dev_build.sh +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/install_wheel_extras.sh +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/split_md.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/split_rst.py +0 -0
- {qbraid_cli-0.10.3 → qbraid_cli-0.10.5}/tools/stamp_pre_release.py +0 -0
|
@@ -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.2
|
|
77
77
|
with:
|
|
78
78
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
79
79
|
fail_ci_if_error: false
|
|
@@ -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.2
|
|
80
80
|
with:
|
|
81
81
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
82
82
|
fail_ci_if_error: false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.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
|
|
@@ -30,7 +30,7 @@ License-File: LICENSE
|
|
|
30
30
|
Requires-Dist: typer>=0.12.1
|
|
31
31
|
Requires-Dist: rich>=10.11.0
|
|
32
32
|
Requires-Dist: click
|
|
33
|
-
Requires-Dist: qbraid-core<0.2,>=0.1.
|
|
33
|
+
Requires-Dist: qbraid-core<0.2,>=0.1.40
|
|
34
34
|
Provides-Extra: jobs
|
|
35
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
36
36
|
Provides-Extra: envs
|
|
@@ -40,6 +40,7 @@ Requires-Dist: isort; extra == "dev"
|
|
|
40
40
|
Requires-Dist: black; extra == "dev"
|
|
41
41
|
Requires-Dist: pytest; extra == "dev"
|
|
42
42
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
45
46
|
|
|
@@ -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.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" }]
|
|
@@ -31,7 +31,7 @@ dependencies = [
|
|
|
31
31
|
"typer>=0.12.1",
|
|
32
32
|
"rich>=10.11.0",
|
|
33
33
|
"click",
|
|
34
|
-
"qbraid-core>=0.1.
|
|
34
|
+
"qbraid-core>=0.1.40,<0.2",
|
|
35
35
|
]
|
|
36
36
|
requires-python = ">= 3.9"
|
|
37
37
|
|
|
@@ -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+gd532fb2'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'gd532fb2')
|
|
@@ -15,6 +15,8 @@ import typer
|
|
|
15
15
|
from qbraid_core.config import (
|
|
16
16
|
DEFAULT_CONFIG_SECTION,
|
|
17
17
|
DEFAULT_ENDPOINT_URL,
|
|
18
|
+
DEFAULT_ORGANIZATION,
|
|
19
|
+
DEFAULT_WORKSPACE,
|
|
18
20
|
USER_CONFIG_PATH,
|
|
19
21
|
load_config,
|
|
20
22
|
save_config,
|
|
@@ -92,10 +94,18 @@ def default_action(section: str = DEFAULT_CONFIG_SECTION):
|
|
|
92
94
|
if section not in config:
|
|
93
95
|
config[section] = {}
|
|
94
96
|
|
|
95
|
-
default_values = {
|
|
97
|
+
default_values = {
|
|
98
|
+
"url": DEFAULT_ENDPOINT_URL,
|
|
99
|
+
"organization": DEFAULT_ORGANIZATION,
|
|
100
|
+
"workspace": DEFAULT_WORKSPACE,
|
|
101
|
+
}
|
|
96
102
|
|
|
97
103
|
config[section]["url"] = prompt_for_config(config, section, "url", default_values)
|
|
98
104
|
config[section]["api-key"] = prompt_for_config(config, section, "api-key", default_values)
|
|
105
|
+
config[section]["organization"] = prompt_for_config(
|
|
106
|
+
config, section, "organization", default_values
|
|
107
|
+
)
|
|
108
|
+
config[section]["workspace"] = prompt_for_config(config, section, "workspace", default_values)
|
|
99
109
|
|
|
100
110
|
for key in list(config[section]):
|
|
101
111
|
if not config[section][key]:
|
|
@@ -150,9 +150,8 @@ def envs_create( # pylint: disable=too-many-statements
|
|
|
150
150
|
run_progress_task(
|
|
151
151
|
create_qbraid_env_assets,
|
|
152
152
|
slug,
|
|
153
|
-
prompt,
|
|
154
|
-
kernel_name,
|
|
155
153
|
slug_path,
|
|
154
|
+
custom_env_data,
|
|
156
155
|
description="Generating qBraid assets...",
|
|
157
156
|
error_message="Failed to create qBraid environment",
|
|
158
157
|
)
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
Module supporting 'qbraid envs create' command.
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
|
+
from qbraid_core.services.environments.schema import EnvironmentConfig
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
def create_venv(*args, **kwargs) -> None:
|
|
@@ -21,9 +22,9 @@ def update_state_json(*ags, **kwargs) -> None:
|
|
|
21
22
|
return update_state(*ags, **kwargs)
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
def create_qbraid_env_assets(slug: str,
|
|
25
|
+
def create_qbraid_env_assets(slug: str, slug_path: str, env_config: EnvironmentConfig) -> None:
|
|
25
26
|
"""Create a qBraid environment including python venv, PS1 configs,
|
|
26
27
|
kernel resource files, and qBraid state.json."""
|
|
27
28
|
from qbraid_core.services.environments.create import create_qbraid_env_assets as create_assets
|
|
28
29
|
|
|
29
|
-
return create_assets(slug,
|
|
30
|
+
return create_assets(slug, slug_path, env_config)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.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
|
|
@@ -30,7 +30,7 @@ License-File: LICENSE
|
|
|
30
30
|
Requires-Dist: typer>=0.12.1
|
|
31
31
|
Requires-Dist: rich>=10.11.0
|
|
32
32
|
Requires-Dist: click
|
|
33
|
-
Requires-Dist: qbraid-core<0.2,>=0.1.
|
|
33
|
+
Requires-Dist: qbraid-core<0.2,>=0.1.40
|
|
34
34
|
Provides-Extra: jobs
|
|
35
35
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
36
36
|
Provides-Extra: envs
|
|
@@ -40,6 +40,7 @@ Requires-Dist: isort; extra == "dev"
|
|
|
40
40
|
Requires-Dist: black; extra == "dev"
|
|
41
41
|
Requires-Dist: pytest; extra == "dev"
|
|
42
42
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
45
46
|
|
|
@@ -78,6 +78,7 @@ tests/account/test_account_credits.py
|
|
|
78
78
|
tests/admin/test_headers.py
|
|
79
79
|
tests/configure/__init__.py
|
|
80
80
|
tests/configure/test_configure_commands.py
|
|
81
|
+
tests/configure/test_configure_default.py
|
|
81
82
|
tests/configure/test_configure_prompt_for_config.py
|
|
82
83
|
tests/configure/test_configure_set.py
|
|
83
84
|
tests/configure/test_configure_validate_input.py
|
|
@@ -41,6 +41,7 @@ def test_configure_list_with_values(capsys):
|
|
|
41
41
|
"api-key": "abcdef123456",
|
|
42
42
|
"refresh-token": "xyz987654321",
|
|
43
43
|
"url": "https://example.com",
|
|
44
|
+
"organization": "test-org",
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
mock_load_config = MagicMock(return_value=mock_config)
|
|
@@ -54,6 +55,7 @@ def test_configure_list_with_values(capsys):
|
|
|
54
55
|
assert "*****321" in captured.out # last 3 chars of refresh-token
|
|
55
56
|
# Check that non-sensitive values are shown in full
|
|
56
57
|
assert "https://example.com" in captured.out
|
|
58
|
+
assert "test-org" in captured.out
|
|
57
59
|
|
|
58
60
|
|
|
59
61
|
def test_configure_get_success(capsys):
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Unit tests for the default_action function in the configure app.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import configparser
|
|
10
|
+
from unittest.mock import patch
|
|
11
|
+
|
|
12
|
+
from qbraid_cli.configure.actions import default_action
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_default_action():
|
|
16
|
+
"""Test default_action method with mocked dependencies."""
|
|
17
|
+
with (
|
|
18
|
+
patch("qbraid_cli.configure.actions.load_config") as mock_load_config,
|
|
19
|
+
patch("qbraid_cli.configure.actions.prompt_for_config") as mock_prompt,
|
|
20
|
+
patch("qbraid_cli.configure.actions.handle_filesystem_operation") as mock_handle_fs,
|
|
21
|
+
patch("qbraid_cli.configure.actions.Console") as mock_console,
|
|
22
|
+
):
|
|
23
|
+
# Setup mock returns
|
|
24
|
+
config = configparser.ConfigParser()
|
|
25
|
+
config.add_section("default")
|
|
26
|
+
mock_load_config.return_value = config
|
|
27
|
+
|
|
28
|
+
# Setup prompt_for_config to return different values
|
|
29
|
+
mock_prompt.side_effect = [
|
|
30
|
+
"https://new.example.com", # url
|
|
31
|
+
"api-key-123", # api-key
|
|
32
|
+
"new-organization", # organization
|
|
33
|
+
"new-workspace", # workspace
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
# Create mock console
|
|
37
|
+
mock_console_instance = mock_console.return_value
|
|
38
|
+
|
|
39
|
+
# Call the function to test
|
|
40
|
+
default_action()
|
|
41
|
+
|
|
42
|
+
# Verify config load/save was called
|
|
43
|
+
mock_load_config.assert_called_once()
|
|
44
|
+
|
|
45
|
+
# Verify prompt_for_config was called 4 times
|
|
46
|
+
assert mock_prompt.call_count == 4
|
|
47
|
+
|
|
48
|
+
# Verify handle_filesystem_operation was called to save config
|
|
49
|
+
mock_handle_fs.assert_called_once()
|
|
50
|
+
|
|
51
|
+
# Verify console.print was called with success message
|
|
52
|
+
mock_console_instance.print.assert_called_once_with(
|
|
53
|
+
"\n[bold green]Configuration updated successfully."
|
|
54
|
+
)
|
|
@@ -9,17 +9,34 @@ Unit tests for the prompt_for_config function in the configure app.
|
|
|
9
9
|
import configparser
|
|
10
10
|
from unittest.mock import patch
|
|
11
11
|
|
|
12
|
-
from qbraid_cli.configure.actions import prompt_for_config
|
|
12
|
+
from qbraid_cli.configure.actions import default_action, prompt_for_config
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
def
|
|
16
|
-
"""Test prompt_for_config when the user enters
|
|
15
|
+
def test_enter_new_values():
|
|
16
|
+
"""Test prompt_for_config when the user enters new values for multiple settings."""
|
|
17
17
|
config = configparser.ConfigParser()
|
|
18
18
|
config.add_section("Settings")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
|
|
20
|
+
# Initial values
|
|
21
|
+
settings = [
|
|
22
|
+
("url", "http://example.com", "http://newexample.com"),
|
|
23
|
+
("organization", "default-org", "new-org"),
|
|
24
|
+
("workspace", "default-workspace", "new-workspace"),
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
# Setup config with initial values
|
|
28
|
+
for key, initial_value, _ in settings:
|
|
29
|
+
config.set("Settings", key, initial_value)
|
|
30
|
+
|
|
31
|
+
# Test each setting one by one
|
|
32
|
+
results = {}
|
|
33
|
+
for key, _, new_value in settings:
|
|
34
|
+
with patch("typer.prompt", return_value=new_value):
|
|
35
|
+
results[key] = prompt_for_config(config, "Settings", key)
|
|
36
|
+
|
|
37
|
+
# Verify the results
|
|
38
|
+
for key, _, new_value in settings:
|
|
39
|
+
assert results[key] == new_value, f"Should return the new value for {key}"
|
|
23
40
|
|
|
24
41
|
|
|
25
42
|
def test_new_value_validation():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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
|