qbraid-cli 0.8.3__tar.gz → 0.8.4__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.4/.github/workflows/bump-version.yml +71 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/workflows/pre-release.yml +1 -1
- qbraid_cli-0.8.4/.github/workflows/tag-on-merge.yml +36 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.gitignore +3 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/PKG-INFO +12 -14
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/README.md +7 -6
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/pyproject.toml +5 -8
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/_version.py +2 -2
- qbraid_cli-0.8.4/qbraid_cli/envs/create.py +29 -0
- qbraid_cli-0.8.4/qbraid_cli/kernels/app.py +98 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/main.py +1 -1
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/PKG-INFO +12 -14
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/SOURCES.txt +3 -3
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/requires.txt +1 -3
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/kernels/test_kernels_list.py +30 -19
- qbraid_cli-0.8.4/tools/bump_version.py +28 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tools/split_md.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tools/stamp_pre_release.py +3 -3
- qbraid_cli-0.8.3/qbraid_cli/envs/create.py +0 -61
- qbraid_cli-0.8.3/qbraid_cli/kernels/app.py +0 -117
- qbraid_cli-0.8.3/tests/envs/test_envs_create.py +0 -67
- qbraid_cli-0.8.3/tests/envs/test_envs_create_qbraid_env_assets.py +0 -79
- qbraid_cli-0.8.3/tests/envs/test_envs_create_validate_env_name.py +0 -69
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.env.example +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/workflows/docs.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/workflows/format.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/workflows/main.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.github/workflows/publish.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/.readthedocs.yml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/CONTRIBUTING.md +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/LICENSE +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/MANIFEST.IN +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/Makefile +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/Makefile +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/api-key.png +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/cards/jupyter.png +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/cards/python.png +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/cards/terminal.png +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/favicon.ico +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/logo.png +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/style/custom.css +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/_static/style/s4defs-roles.css +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/configure.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/credits.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/devices-list.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/devices.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/envs-activate.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/envs-list.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/envs-uninstall.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/envs.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/jobs-add.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/jobs-disable.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/jobs-enable.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/jobs-list.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/jobs.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/kernels.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/cli/qbraid.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/conf.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/guide/overview.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/index.rst +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/make.bat +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/docs/requirements.txt +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/admin/buildlogs.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/credits/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/credits/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/envs/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/jobs/toggle_braket.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/jobs/validation.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/ruff.toml +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/setup.cfg +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/configure/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/configure/test_configure_prompt_for_config.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/configure/test_configure_set.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/configure/test_configure_validate_input.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/credits/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/credits/test_credits_value.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/devices/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/devices/test_devices_list.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/devices/test_devices_validations.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_activate.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_activate_print_command.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_activate_pyenv.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_list.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/envs/test_envs_remove.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_disable.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_enable.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_list.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_state.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_validate_get_state.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/jobs/test_jobs_validate_library.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tests/kernels/__init__.py +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tools/create_dev_build.sh +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tools/install_wheel_extras.sh +0 -0
- {qbraid_cli-0.8.3 → qbraid_cli-0.8.4}/tools/split_rst.py +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Bump Version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
bump_type:
|
|
7
|
+
description: 'Select the version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- major
|
|
12
|
+
- minor
|
|
13
|
+
- patch
|
|
14
|
+
default: 'patch'
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
bump-version:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
pull-requests: write
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout code
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
ref: 'main'
|
|
27
|
+
|
|
28
|
+
- name: Create feature branch
|
|
29
|
+
run: git checkout -b qbraid-bot/${{ github.run_id }}
|
|
30
|
+
|
|
31
|
+
- name: Setup Python
|
|
32
|
+
uses: actions/setup-python@v5
|
|
33
|
+
with:
|
|
34
|
+
python-version: '3.11'
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
python -m pip install "qbraid-core>=0.1.17"
|
|
40
|
+
|
|
41
|
+
- name: Setup Git config
|
|
42
|
+
run: |
|
|
43
|
+
git config --global user.name 'qbraidTeam'
|
|
44
|
+
git config --global user.email 'qbraid.team@qbraid.com'
|
|
45
|
+
|
|
46
|
+
- name: Bump version, commit and push
|
|
47
|
+
id: bump_version
|
|
48
|
+
run: |
|
|
49
|
+
BUMP_TYPE=${{ github.event.inputs.bump_type }}
|
|
50
|
+
VERSION=$(python3 tools/bump_version.py qbraid_cli $BUMP_TYPE)
|
|
51
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
52
|
+
git commit -am "Bump $BUMP_TYPE version to $VERSION"
|
|
53
|
+
git push origin qbraid-bot/${{ github.run_id }}
|
|
54
|
+
|
|
55
|
+
- name: Create Pull Request
|
|
56
|
+
id: create_pr
|
|
57
|
+
run: |
|
|
58
|
+
VERSION=${{ steps.bump_version.outputs.version }}
|
|
59
|
+
PR_URL=$(gh pr create -B main -H qbraid-bot/${{ github.run_id }} --title "Bump project version to $VERSION" --body "This PR bumps the project version to $VERSION")
|
|
60
|
+
PR_NUMBER=$(echo "$PR_URL" | grep -o '[0-9]*$')
|
|
61
|
+
echo "url=$PR_URL" >> $GITHUB_OUTPUT
|
|
62
|
+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
|
|
63
|
+
env:
|
|
64
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
65
|
+
|
|
66
|
+
- name: Summary
|
|
67
|
+
run: |
|
|
68
|
+
VERSION=${{ steps.bump_version.outputs.version }}
|
|
69
|
+
PR_URL=${{ steps.create_pr.outputs.url }}
|
|
70
|
+
PR_NUMBER=${{ steps.create_pr.outputs.number }}
|
|
71
|
+
echo "Opened PR [#$PR_NUMBER]($PR_URL) to update project to version **$VERSION**." >> $GITHUB_STEP_SUMMARY
|
|
@@ -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}"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Tag on PR Merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
tag-version:
|
|
9
|
+
if: github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' && startsWith(github.event.pull_request.title, 'Bump project version to ')
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
steps:
|
|
14
|
+
- name: Extract version
|
|
15
|
+
id: extract_version
|
|
16
|
+
run: |
|
|
17
|
+
VERSION=$(echo '${{ github.event.pull_request.title }}' | sed -E 's/Bump project version to (.*)/\1/')
|
|
18
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
19
|
+
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
ref: 'main'
|
|
24
|
+
|
|
25
|
+
- name: Setup Git config
|
|
26
|
+
run: |
|
|
27
|
+
git config --global user.name 'qbraidTeam'
|
|
28
|
+
git config --global user.email 'qbraid.team@qbraid.com'
|
|
29
|
+
|
|
30
|
+
- name: Create Tag
|
|
31
|
+
run: |
|
|
32
|
+
VERSION=${{ steps.extract_version.outputs.version }}
|
|
33
|
+
git tag v$VERSION
|
|
34
|
+
git push origin v$VERSION
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.4
|
|
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
|
|
7
|
-
Project-URL: Homepage, https://
|
|
8
|
-
Project-URL: Documentation, https://docs.qbraid.com/
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/qBraid/
|
|
7
|
+
Project-URL: Homepage, https://docs.qbraid.com/cli/user-guide/overview
|
|
8
|
+
Project-URL: Documentation, https://docs.qbraid.com/cli/api-reference/qbraid
|
|
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/qBraid-Lab.git
|
|
12
11
|
Keywords: qbraid,cli,quantum,cloud
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -29,9 +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:
|
|
33
|
-
Requires-Dist: ipykernel
|
|
34
|
-
Requires-Dist: qbraid-core>=0.1.16
|
|
31
|
+
Requires-Dist: qbraid-core[environments]>=0.1.17
|
|
35
32
|
Provides-Extra: jobs
|
|
36
33
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
37
34
|
Provides-Extra: dev
|
|
@@ -43,15 +40,16 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
43
40
|
|
|
44
41
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
45
42
|
|
|
46
|
-
[](https://docs.qbraid.com/
|
|
43
|
+
[](https://docs.qbraid.com/cli/user-guide/overview)
|
|
47
44
|
[](https://pypi.org/project/qbraid-cli/)
|
|
48
45
|
[](https://pypi.org/project/qbraid-cli/)
|
|
49
46
|
[](https://pepy.tech/project/qbraid-cli)
|
|
50
|
-
[](https://github.com/qBraid/
|
|
47
|
+
[](https://github.com/qBraid/community/issues)
|
|
48
|
+
[](https://stackoverflow.com/questions/tagged/qbraid)
|
|
51
49
|
|
|
52
50
|
Command Line Interface for interacting with all parts of the qBraid platform.
|
|
53
51
|
|
|
54
|
-
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/
|
|
52
|
+
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/lab/user-guide/overview) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/cli/user-guide/quantum-jobs), enabling direct acess to QPU devices from leading providers like IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and IQM, as well as on-demand simulators from qBraid and AWS, all using qBraid [credits](https://docs.qbraid.com/home/pricing), with no additional access keys required.
|
|
55
53
|
|
|
56
54
|
## Getting Started
|
|
57
55
|
|
|
@@ -60,7 +58,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
|
|
|
60
58
|
- [Launch qBraid Lab →](https://lab.qbraid.com/)
|
|
61
59
|
- [Make an account →](https://account.qbraid.com/)
|
|
62
60
|
|
|
63
|
-
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/
|
|
61
|
+
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
|
|
64
62
|
|
|
65
63
|
You can also install the qBraid-CLI from PyPI with:
|
|
66
64
|
|
|
@@ -102,7 +100,7 @@ $ qbraid
|
|
|
102
100
|
|
|
103
101
|
- Use 'qbraid --version' to see the current version.
|
|
104
102
|
|
|
105
|
-
Reference Docs: https://docs.qbraid.com/
|
|
103
|
+
Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
|
|
106
104
|
```
|
|
107
105
|
|
|
108
106
|
A qBraid CLI command has the following structure:
|
|
@@ -157,7 +155,7 @@ $ qbraid --version
|
|
|
157
155
|
|
|
158
156
|
## Magic Commands
|
|
159
157
|
|
|
160
|
-
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/
|
|
158
|
+
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
161
159
|
|
|
162
160
|
```bash
|
|
163
161
|
$ qbraid configure magic
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
2
2
|
|
|
3
|
-
[](https://docs.qbraid.com/
|
|
3
|
+
[](https://docs.qbraid.com/cli/user-guide/overview)
|
|
4
4
|
[](https://pypi.org/project/qbraid-cli/)
|
|
5
5
|
[](https://pypi.org/project/qbraid-cli/)
|
|
6
6
|
[](https://pepy.tech/project/qbraid-cli)
|
|
7
|
-
[](https://github.com/qBraid/
|
|
7
|
+
[](https://github.com/qBraid/community/issues)
|
|
8
|
+
[](https://stackoverflow.com/questions/tagged/qbraid)
|
|
8
9
|
|
|
9
10
|
Command Line Interface for interacting with all parts of the qBraid platform.
|
|
10
11
|
|
|
11
|
-
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/
|
|
12
|
+
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/lab/user-guide/overview) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/cli/user-guide/quantum-jobs), enabling direct acess to QPU devices from leading providers like IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and IQM, as well as on-demand simulators from qBraid and AWS, all using qBraid [credits](https://docs.qbraid.com/home/pricing), with no additional access keys required.
|
|
12
13
|
|
|
13
14
|
## Getting Started
|
|
14
15
|
|
|
@@ -17,7 +18,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
|
|
|
17
18
|
- [Launch qBraid Lab →](https://lab.qbraid.com/)
|
|
18
19
|
- [Make an account →](https://account.qbraid.com/)
|
|
19
20
|
|
|
20
|
-
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/
|
|
21
|
+
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
|
|
21
22
|
|
|
22
23
|
You can also install the qBraid-CLI from PyPI with:
|
|
23
24
|
|
|
@@ -59,7 +60,7 @@ $ qbraid
|
|
|
59
60
|
|
|
60
61
|
- Use 'qbraid --version' to see the current version.
|
|
61
62
|
|
|
62
|
-
Reference Docs: https://docs.qbraid.com/
|
|
63
|
+
Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
A qBraid CLI command has the following structure:
|
|
@@ -114,7 +115,7 @@ $ qbraid --version
|
|
|
114
115
|
|
|
115
116
|
## Magic Commands
|
|
116
117
|
|
|
117
|
-
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/
|
|
118
|
+
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
118
119
|
|
|
119
120
|
```bash
|
|
120
121
|
$ qbraid configure magic
|
|
@@ -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.4"
|
|
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,18 +29,15 @@ classifiers = [
|
|
|
29
29
|
dependencies = [
|
|
30
30
|
"typer>=0.12.1",
|
|
31
31
|
"rich>=10.11.0",
|
|
32
|
-
"
|
|
33
|
-
"ipykernel",
|
|
34
|
-
"qbraid-core>=0.1.16",
|
|
32
|
+
"qbraid-core[environments]>=0.1.17",
|
|
35
33
|
]
|
|
36
34
|
requires-python = ">= 3.9"
|
|
37
35
|
|
|
38
36
|
[project.urls]
|
|
39
|
-
Homepage = "https://
|
|
40
|
-
Documentation = "https://docs.qbraid.com/
|
|
41
|
-
"Bug Tracker" = "https://github.com/qBraid/
|
|
37
|
+
Homepage = "https://docs.qbraid.com/cli/user-guide/overview"
|
|
38
|
+
Documentation = "https://docs.qbraid.com/cli/api-reference/qbraid"
|
|
39
|
+
"Bug Tracker" = "https://github.com/qBraid/community/issues"
|
|
42
40
|
Discord = "https://discord.gg/KugF6Cnncm"
|
|
43
|
-
"Launch on Lab" = "https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/qBraid-Lab.git"
|
|
44
41
|
|
|
45
42
|
[project.optional-dependencies]
|
|
46
43
|
jobs = ["amazon-braket-sdk>=1.48.1"]
|
|
@@ -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+g00f25d1'
|
|
16
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev1', 'g00f25d1')
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module supporting 'qbraid envs create' command.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def create_venv(*args, **kwargs) -> None:
|
|
11
|
+
"""Create a python virtual environment for the qBraid environment."""
|
|
12
|
+
from qbraid_core.services.environments import create_local_venv
|
|
13
|
+
|
|
14
|
+
return create_local_venv(*args, **kwargs)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def update_state_json(*ags, **kwargs) -> None:
|
|
18
|
+
"""Update the state.json file for the qBraid environment."""
|
|
19
|
+
from qbraid_core.services.environments.state import update_state_json as update_state
|
|
20
|
+
|
|
21
|
+
return update_state(*ags, **kwargs)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def create_qbraid_env_assets(slug: str, alias: str, kernel_name: str, slug_path: str) -> None:
|
|
25
|
+
"""Create a qBraid environment including python venv, PS1 configs,
|
|
26
|
+
kernel resource files, and qBraid state.json."""
|
|
27
|
+
from qbraid_core.services.environments.create import create_qbraid_env_assets as create_assets
|
|
28
|
+
|
|
29
|
+
return create_assets(slug, alias, kernel_name, slug_path)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Copyright (c) 2024, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module defining commands in the 'qbraid kernels' namespace.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
import typer
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
from qbraid_cli.handlers import handle_error
|
|
12
|
+
|
|
13
|
+
kernels_app = typer.Typer(help="Manage qBraid kernels.")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@kernels_app.command(name="list")
|
|
17
|
+
def kernels_list():
|
|
18
|
+
"""List all available kernels."""
|
|
19
|
+
from qbraid_core.services.environments.kernels import get_all_kernels
|
|
20
|
+
|
|
21
|
+
console = Console()
|
|
22
|
+
# Get the list of kernelspecs
|
|
23
|
+
kernelspecs: dict = get_all_kernels()
|
|
24
|
+
|
|
25
|
+
if len(kernelspecs) == 0:
|
|
26
|
+
console.print("No qBraid kernels are active.")
|
|
27
|
+
console.print("\nUse 'qbraid kernels add' to add a new kernel.")
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
longest_kernel_name = max(len(kernel_name) for kernel_name in kernelspecs)
|
|
31
|
+
spacing = longest_kernel_name + 10
|
|
32
|
+
|
|
33
|
+
output_lines = []
|
|
34
|
+
output_lines.append("# qbraid kernels:")
|
|
35
|
+
output_lines.append("#")
|
|
36
|
+
output_lines.append("")
|
|
37
|
+
|
|
38
|
+
# Ensure 'python3' kernel is printed first if it exists
|
|
39
|
+
default_kernel_name = "python3"
|
|
40
|
+
python3_kernel_info = kernelspecs.pop(default_kernel_name, None)
|
|
41
|
+
if python3_kernel_info:
|
|
42
|
+
line = f"{default_kernel_name.ljust(spacing)}{python3_kernel_info['resource_dir']}"
|
|
43
|
+
output_lines.append(line)
|
|
44
|
+
# print rest of the kernels
|
|
45
|
+
for kernel_name, kernel_info in sorted(kernelspecs.items()):
|
|
46
|
+
line = f"{kernel_name.ljust(spacing)}{kernel_info['resource_dir']}"
|
|
47
|
+
output_lines.append(line)
|
|
48
|
+
|
|
49
|
+
final_output = "\n".join(output_lines)
|
|
50
|
+
|
|
51
|
+
console.print(final_output)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@kernels_app.command(name="add")
|
|
55
|
+
def kernels_add(
|
|
56
|
+
environment: str = typer.Argument(
|
|
57
|
+
..., help="Name of environment for which to add ipykernel. Values from 'qbraid envs list'."
|
|
58
|
+
)
|
|
59
|
+
):
|
|
60
|
+
"""Add a kernel."""
|
|
61
|
+
from qbraid_core.services.environments.kernels import add_kernels
|
|
62
|
+
|
|
63
|
+
try:
|
|
64
|
+
add_kernels(environment)
|
|
65
|
+
except ValueError:
|
|
66
|
+
handle_error(
|
|
67
|
+
message="Failed to add kernel(s). Please verify that the environment exists.",
|
|
68
|
+
include_traceback=True,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
console = Console()
|
|
72
|
+
console.print(f"\nSuccessfully added '{environment}' kernel(s).", highlight=False)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@kernels_app.command(name="remove")
|
|
76
|
+
def kernels_remove(
|
|
77
|
+
environment: str = typer.Argument(
|
|
78
|
+
...,
|
|
79
|
+
help=("Name of environment for which to remove ipykernel. Values from 'qbraid envs list'."),
|
|
80
|
+
)
|
|
81
|
+
):
|
|
82
|
+
"""Remove a kernel."""
|
|
83
|
+
from qbraid_core.services.environments.kernels import remove_kernels
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
remove_kernels(environment)
|
|
87
|
+
except ValueError:
|
|
88
|
+
handle_error(
|
|
89
|
+
message="Failed to remove kernel(s). Please verify that the environment exists.",
|
|
90
|
+
include_traceback=True,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
console = Console()
|
|
94
|
+
console.print(f"\nSuccessfully removed '{environment}' kernel(s).", highlight=False)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == "__main__":
|
|
98
|
+
kernels_app()
|
|
@@ -59,7 +59,7 @@ def show_banner():
|
|
|
59
59
|
typer.echo("")
|
|
60
60
|
typer.echo("- Use 'qbraid --version' to see the current version.")
|
|
61
61
|
typer.echo("")
|
|
62
|
-
typer.echo("Reference Docs: https://docs.qbraid.com/
|
|
62
|
+
typer.echo("Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid")
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
@app.callback(invoke_without_command=True)
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.4
|
|
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
|
|
7
|
-
Project-URL: Homepage, https://
|
|
8
|
-
Project-URL: Documentation, https://docs.qbraid.com/
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/qBraid/
|
|
7
|
+
Project-URL: Homepage, https://docs.qbraid.com/cli/user-guide/overview
|
|
8
|
+
Project-URL: Documentation, https://docs.qbraid.com/cli/api-reference/qbraid
|
|
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/qBraid-Lab.git
|
|
12
11
|
Keywords: qbraid,cli,quantum,cloud
|
|
13
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -29,9 +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:
|
|
33
|
-
Requires-Dist: ipykernel
|
|
34
|
-
Requires-Dist: qbraid-core>=0.1.16
|
|
31
|
+
Requires-Dist: qbraid-core[environments]>=0.1.17
|
|
35
32
|
Provides-Extra: jobs
|
|
36
33
|
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
37
34
|
Provides-Extra: dev
|
|
@@ -43,15 +40,16 @@ Requires-Dist: pytest-cov; extra == "dev"
|
|
|
43
40
|
|
|
44
41
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
45
42
|
|
|
46
|
-
[](https://docs.qbraid.com/
|
|
43
|
+
[](https://docs.qbraid.com/cli/user-guide/overview)
|
|
47
44
|
[](https://pypi.org/project/qbraid-cli/)
|
|
48
45
|
[](https://pypi.org/project/qbraid-cli/)
|
|
49
46
|
[](https://pepy.tech/project/qbraid-cli)
|
|
50
|
-
[](https://github.com/qBraid/
|
|
47
|
+
[](https://github.com/qBraid/community/issues)
|
|
48
|
+
[](https://stackoverflow.com/questions/tagged/qbraid)
|
|
51
49
|
|
|
52
50
|
Command Line Interface for interacting with all parts of the qBraid platform.
|
|
53
51
|
|
|
54
|
-
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/
|
|
52
|
+
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/lab/user-guide/overview) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/cli/user-guide/quantum-jobs), enabling direct acess to QPU devices from leading providers like IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and IQM, as well as on-demand simulators from qBraid and AWS, all using qBraid [credits](https://docs.qbraid.com/home/pricing), with no additional access keys required.
|
|
55
53
|
|
|
56
54
|
## Getting Started
|
|
57
55
|
|
|
@@ -60,7 +58,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
|
|
|
60
58
|
- [Launch qBraid Lab →](https://lab.qbraid.com/)
|
|
61
59
|
- [Make an account →](https://account.qbraid.com/)
|
|
62
60
|
|
|
63
|
-
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/
|
|
61
|
+
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
|
|
64
62
|
|
|
65
63
|
You can also install the qBraid-CLI from PyPI with:
|
|
66
64
|
|
|
@@ -102,7 +100,7 @@ $ qbraid
|
|
|
102
100
|
|
|
103
101
|
- Use 'qbraid --version' to see the current version.
|
|
104
102
|
|
|
105
|
-
Reference Docs: https://docs.qbraid.com/
|
|
103
|
+
Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
|
|
106
104
|
```
|
|
107
105
|
|
|
108
106
|
A qBraid CLI command has the following structure:
|
|
@@ -157,7 +155,7 @@ $ qbraid --version
|
|
|
157
155
|
|
|
158
156
|
## Magic Commands
|
|
159
157
|
|
|
160
|
-
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/
|
|
158
|
+
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
161
159
|
|
|
162
160
|
```bash
|
|
163
161
|
$ qbraid configure magic
|
|
@@ -11,11 +11,13 @@ ruff.toml
|
|
|
11
11
|
.github/PULL_REQUEST_TEMPLATE.md
|
|
12
12
|
.github/ISSUE_TEMPLATE/bug_report.yml
|
|
13
13
|
.github/ISSUE_TEMPLATE/feature_request.yml
|
|
14
|
+
.github/workflows/bump-version.yml
|
|
14
15
|
.github/workflows/docs.yml
|
|
15
16
|
.github/workflows/format.yml
|
|
16
17
|
.github/workflows/main.yml
|
|
17
18
|
.github/workflows/pre-release.yml
|
|
18
19
|
.github/workflows/publish.yml
|
|
20
|
+
.github/workflows/tag-on-merge.yml
|
|
19
21
|
docs/Makefile
|
|
20
22
|
docs/conf.py
|
|
21
23
|
docs/index.rst
|
|
@@ -99,9 +101,6 @@ tests/envs/test_envs_activate.py
|
|
|
99
101
|
tests/envs/test_envs_activate_find_shell_rc.py
|
|
100
102
|
tests/envs/test_envs_activate_print_command.py
|
|
101
103
|
tests/envs/test_envs_activate_pyenv.py
|
|
102
|
-
tests/envs/test_envs_create.py
|
|
103
|
-
tests/envs/test_envs_create_qbraid_env_assets.py
|
|
104
|
-
tests/envs/test_envs_create_validate_env_name.py
|
|
105
104
|
tests/envs/test_envs_list.py
|
|
106
105
|
tests/envs/test_envs_remove.py
|
|
107
106
|
tests/jobs/__init__.py
|
|
@@ -118,6 +117,7 @@ tests/jobs/test_jobs_validate_handle_state.py
|
|
|
118
117
|
tests/jobs/test_jobs_validate_library.py
|
|
119
118
|
tests/kernels/__init__.py
|
|
120
119
|
tests/kernels/test_kernels_list.py
|
|
120
|
+
tools/bump_version.py
|
|
121
121
|
tools/create_dev_build.sh
|
|
122
122
|
tools/install_wheel_extras.sh
|
|
123
123
|
tools/split_md.py
|
|
@@ -11,11 +11,14 @@ from unittest.mock import call, patch
|
|
|
11
11
|
from qbraid_cli.kernels.app import kernels_list
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
def mock_is_exe(path):
|
|
15
|
+
return path == "/path/to/bin/python3", "-m", "ipykernel_launcher", "-f", "test"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@patch("qbraid_core.services.environments.kernels.get_all_kernels", return_value={})
|
|
15
19
|
@patch("qbraid_cli.kernels.app.Console")
|
|
16
|
-
def test_kernels_list_no_active_kernels(mock_console,
|
|
20
|
+
def test_kernels_list_no_active_kernels(mock_console, mock_list_kernels):
|
|
17
21
|
"""Test listing kernels when no kernels are active."""
|
|
18
|
-
mock_kernel_spec_manager.return_value.get_all_specs.return_value = {}
|
|
19
22
|
|
|
20
23
|
kernels_list()
|
|
21
24
|
|
|
@@ -24,42 +27,50 @@ def test_kernels_list_no_active_kernels(mock_console, mock_kernel_spec_manager):
|
|
|
24
27
|
call("\nUse 'qbraid kernels add' to add a new kernel."),
|
|
25
28
|
]
|
|
26
29
|
actual_calls = mock_console.return_value.print.call_args_list
|
|
30
|
+
print(actual_calls, "actual_calls")
|
|
27
31
|
assert actual_calls == expected_calls
|
|
28
32
|
|
|
29
33
|
|
|
30
|
-
@patch(
|
|
34
|
+
@patch(
|
|
35
|
+
"qbraid_core.services.environments.kernels.get_all_kernels",
|
|
36
|
+
return_value={"python3": {"resource_dir": "/path/to/python3/kernel"}},
|
|
37
|
+
)
|
|
31
38
|
@patch("qbraid_cli.kernels.app.Console")
|
|
32
|
-
def test_kernels_list_default_python3_kernel_present(mock_console,
|
|
39
|
+
def test_kernels_list_default_python3_kernel_present(mock_console, mock_list_kernels):
|
|
33
40
|
"""Test listing kernels when the default python3 kernel is present."""
|
|
34
|
-
mock_kernel_spec_manager.return_value.get_all_specs.return_value = {
|
|
35
|
-
"python3": {"resource_dir": "/path/to/python3/kernel"}
|
|
36
|
-
}
|
|
37
41
|
|
|
38
42
|
kernels_list()
|
|
39
43
|
|
|
40
44
|
expected_calls = [
|
|
41
|
-
call("# qbraid kernels:\n#\n\
|
|
45
|
+
call("# qbraid kernels:\n#\n\npython3 /path/to/python3/kernel"),
|
|
42
46
|
]
|
|
43
47
|
actual_calls = mock_console.return_value.print.call_args_list
|
|
44
48
|
assert actual_calls == expected_calls
|
|
45
49
|
|
|
46
50
|
|
|
47
|
-
@patch(
|
|
51
|
+
@patch(
|
|
52
|
+
"qbraid_core.services.environments.kernels.get_all_kernels",
|
|
53
|
+
return_value={
|
|
54
|
+
"python3": {"resource_dir": "/path/to/python3/kernel"},
|
|
55
|
+
"another_kernel": {
|
|
56
|
+
"resource_dir": "/path/to/another/kernel",
|
|
57
|
+
"spec": {
|
|
58
|
+
"display_name": "Another Kernel",
|
|
59
|
+
"argv": ["/path/to/bin/python3", "-m", "ipykernel_launcher", "-f", "test"],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
)
|
|
48
64
|
@patch("qbraid_cli.kernels.app.Console")
|
|
49
|
-
def test_kernels_list_multiple_kernels_available(mock_console,
|
|
65
|
+
def test_kernels_list_multiple_kernels_available(mock_console, mock_list_kernels):
|
|
50
66
|
"""Test listing multiple kernels when multiple kernels are available."""
|
|
51
|
-
mock_kernel_spec_manager.return_value.get_all_specs.return_value = {
|
|
52
|
-
"python3": {"resource_dir": "/path/to/python3/kernel"},
|
|
53
|
-
"another_kernel": {"resource_dir": "/path/to/another/kernel"},
|
|
54
|
-
}
|
|
55
67
|
|
|
56
|
-
|
|
68
|
+
with patch("qbraid_core.services.environments.kernels.is_exe", mock_is_exe):
|
|
69
|
+
kernels_list()
|
|
57
70
|
|
|
58
71
|
expected_calls = [
|
|
59
72
|
call(
|
|
60
|
-
"# qbraid kernels:\n#\n\
|
|
61
|
-
"python3 /path/to/python3/kernel\n"
|
|
62
|
-
"another_kernel /path/to/another/kernel"
|
|
73
|
+
"# qbraid kernels:\n#\n\npython3 /path/to/python3/kernel\nanother_kernel /path/to/another/kernel"
|
|
63
74
|
),
|
|
64
75
|
]
|
|
65
76
|
actual_calls = mock_console.return_value.print.call_args_list
|