qbraid-cli 0.8.0.dev1__tar.gz → 0.8.0.dev3__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.

Files changed (143) hide show
  1. qbraid-cli-0.8.0.dev3/.env.example +3 -0
  2. qbraid-cli-0.8.0.dev3/.github/PULL_REQUEST_TEMPLATE.md +3 -0
  3. qbraid-cli-0.8.0.dev3/.github/workflows/format.yml +34 -0
  4. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/workflows/main.yml +13 -5
  5. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/workflows/publish.yml +1 -0
  6. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.gitignore +1 -1
  7. {qbraid-cli-0.8.0.dev1/qbraid_cli.egg-info → qbraid-cli-0.8.0.dev3}/PKG-INFO +13 -9
  8. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/README.md +3 -1
  9. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/guide/overview.rst +1 -1
  10. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/pyproject.toml +12 -9
  11. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/_version.py +2 -2
  12. qbraid-cli-0.8.0.dev3/qbraid_cli/configure/__init__.py +9 -0
  13. qbraid-cli-0.8.0.dev3/qbraid_cli/configure/actions.py +111 -0
  14. qbraid-cli-0.8.0.dev3/qbraid_cli/configure/app.py +54 -0
  15. qbraid-cli-0.8.0.dev3/qbraid_cli/credits/__init__.py +9 -0
  16. qbraid-cli-0.8.0.dev3/qbraid_cli/credits/app.py +32 -0
  17. qbraid-cli-0.8.0.dev3/qbraid_cli/devices/__init__.py +9 -0
  18. qbraid-cli-0.8.0.dev3/qbraid_cli/devices/app.py +80 -0
  19. qbraid-cli-0.8.0.dev3/qbraid_cli/devices/validation.py +27 -0
  20. qbraid-cli-0.8.0.dev3/qbraid_cli/envs/__init__.py +9 -0
  21. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/envs/activate.py +8 -5
  22. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/envs/app.py +38 -155
  23. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/envs/create.py +3 -0
  24. qbraid-cli-0.8.0.dev3/qbraid_cli/envs/data_handling.py +140 -0
  25. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/exceptions.py +3 -0
  26. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/handlers.py +3 -0
  27. qbraid-cli-0.8.0.dev3/qbraid_cli/jobs/__init__.py +9 -0
  28. qbraid-cli-0.8.0.dev3/qbraid_cli/jobs/app.py +150 -0
  29. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/jobs/toggle_braket.py +25 -23
  30. qbraid-cli-0.8.0.dev3/qbraid_cli/jobs/validation.py +74 -0
  31. qbraid-cli-0.8.0.dev3/qbraid_cli/kernels/__init__.py +9 -0
  32. qbraid-cli-0.8.0.dev3/qbraid_cli/kernels/app.py +111 -0
  33. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/main.py +15 -8
  34. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3/qbraid_cli.egg-info}/PKG-INFO +13 -9
  35. qbraid-cli-0.8.0.dev3/qbraid_cli.egg-info/SOURCES.txt +125 -0
  36. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli.egg-info/requires.txt +4 -5
  37. qbraid-cli-0.8.0.dev3/tests/test_configure/__init__.py +0 -0
  38. qbraid-cli-0.8.0.dev3/tests/test_configure/test_configure_set.py +37 -0
  39. qbraid-cli-0.8.0.dev3/tests/test_configure/test_prompt_for_config.py +39 -0
  40. qbraid-cli-0.8.0.dev3/tests/test_configure/test_validate_input.py +54 -0
  41. qbraid-cli-0.8.0.dev3/tests/test_credits/__init__.py +0 -0
  42. qbraid-cli-0.8.0.dev3/tests/test_credits/test_credits_value.py +41 -0
  43. qbraid-cli-0.8.0.dev3/tests/test_devices/__init__.py +0 -0
  44. qbraid-cli-0.8.0.dev3/tests/test_devices/test_devices_list.py +87 -0
  45. qbraid-cli-0.8.0.dev3/tests/test_devices/test_validations.py +72 -0
  46. qbraid-cli-0.8.0.dev3/tests/test_envs/__init__.py +0 -0
  47. qbraid-cli-0.8.0.dev3/tests/test_envs/test_activate/__init__.py +0 -0
  48. qbraid-cli-0.8.0.dev3/tests/test_envs/test_activate/test_activate_pyenv.py +70 -0
  49. qbraid-cli-0.8.0.dev3/tests/test_envs/test_activate/test_find_shell_rc.py +54 -0
  50. qbraid-cli-0.8.0.dev3/tests/test_envs/test_activate/test_print_activate_command.py +38 -0
  51. qbraid-cli-0.8.0.dev3/tests/test_envs/test_app/__init__.py +0 -0
  52. qbraid-cli-0.8.0.dev3/tests/test_envs/test_app/test_envs_activate.py +42 -0
  53. qbraid-cli-0.8.0.dev3/tests/test_envs/test_app/test_envs_create.py +67 -0
  54. qbraid-cli-0.8.0.dev3/tests/test_envs/test_app/test_envs_list.py +37 -0
  55. qbraid-cli-0.8.0.dev3/tests/test_envs/test_app/test_envs_remove.py +31 -0
  56. qbraid-cli-0.8.0.dev3/tests/test_envs/test_create/__init__.py +0 -0
  57. qbraid-cli-0.8.0.dev3/tests/test_envs/test_create/test_create_qbraid_env_assets.py +82 -0
  58. qbraid-cli-0.8.0.dev3/tests/test_envs/test_create/test_replace_str.py +25 -0
  59. qbraid-cli-0.8.0.dev3/tests/test_envs/test_create/test_update_state_json.py +61 -0
  60. qbraid-cli-0.8.0.dev3/tests/test_envs/test_data_handling/__init__.py +0 -0
  61. qbraid-cli-0.8.0.dev3/tests/test_envs/test_data_handling/test_installed_envs_data.py +87 -0
  62. qbraid-cli-0.8.0.dev1/tests/test_envs.py → qbraid-cli-0.8.0.dev3/tests/test_envs/test_data_handling/test_is_valid_env_name.py +5 -2
  63. qbraid-cli-0.8.0.dev3/tests/test_envs/test_data_handling/test_request_delete_env.py +31 -0
  64. qbraid-cli-0.8.0.dev3/tests/test_envs/test_data_handling/test_validate_env_name.py +31 -0
  65. qbraid-cli-0.8.0.dev3/tests/test_jobs/__init__.py +0 -0
  66. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_app/__init__.py +0 -0
  67. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_app/test_jobs_disable.py +49 -0
  68. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_app/test_jobs_enable.py +67 -0
  69. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_app/test_jobs_list.py +62 -0
  70. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_app/test_jobs_state.py +32 -0
  71. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/__init__.py +0 -0
  72. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/test_aws_configure_dummy.py +49 -0
  73. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/test_confirm_updates.py +52 -0
  74. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/test_disable_braket.py +101 -0
  75. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/test_enable_braket.py +104 -0
  76. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_toggle_braket/test_get_package_data.py +161 -0
  77. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_validation/__init__.py +0 -0
  78. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_validation/test_get_state.py +46 -0
  79. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_validation/test_handle_jobs_state.py +61 -0
  80. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_validation/test_run_progress_get_state.py +43 -0
  81. qbraid-cli-0.8.0.dev3/tests/test_jobs/test_validation/test_validate_library.py +35 -0
  82. qbraid-cli-0.8.0.dev3/tests/test_kernels/__init__.py +0 -0
  83. qbraid-cli-0.8.0.dev3/tests/test_kernels/test_kernels_list.py +74 -0
  84. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/tools/split_rst.py +3 -0
  85. qbraid-cli-0.8.0.dev3/tools/verify_headers.py +209 -0
  86. qbraid-cli-0.8.0.dev1/.env-example +0 -3
  87. qbraid-cli-0.8.0.dev1/.github/PULL_REQUEST_TEMPLATE.md +0 -3
  88. qbraid-cli-0.8.0.dev1/.github/workflows/format.yml +0 -25
  89. qbraid-cli-0.8.0.dev1/qbraid_cli/configure/__init__.py +0 -6
  90. qbraid-cli-0.8.0.dev1/qbraid_cli/configure/app.py +0 -151
  91. qbraid-cli-0.8.0.dev1/qbraid_cli/credits/__init__.py +0 -6
  92. qbraid-cli-0.8.0.dev1/qbraid_cli/credits/app.py +0 -30
  93. qbraid-cli-0.8.0.dev1/qbraid_cli/devices/__init__.py +0 -6
  94. qbraid-cli-0.8.0.dev1/qbraid_cli/devices/app.py +0 -72
  95. qbraid-cli-0.8.0.dev1/qbraid_cli/envs/__init__.py +0 -6
  96. qbraid-cli-0.8.0.dev1/qbraid_cli/jobs/__init__.py +0 -6
  97. qbraid-cli-0.8.0.dev1/qbraid_cli/jobs/app.py +0 -169
  98. qbraid-cli-0.8.0.dev1/qbraid_cli/kernels/__init__.py +0 -6
  99. qbraid-cli-0.8.0.dev1/qbraid_cli/kernels/app.py +0 -42
  100. qbraid-cli-0.8.0.dev1/qbraid_cli.egg-info/SOURCES.txt +0 -75
  101. qbraid-cli-0.8.0.dev1/requirements.txt +0 -5
  102. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  103. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  104. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/workflows/docs.yml +0 -0
  105. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.github/workflows/test-publish.yml +0 -0
  106. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/.readthedocs.yml +0 -0
  107. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/CONTRIBUTING.md +0 -0
  108. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/MANIFEST.IN +0 -0
  109. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/Makefile +0 -0
  110. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/Makefile +0 -0
  111. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/api-key.png +0 -0
  112. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/cards/jupyter.png +0 -0
  113. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/cards/python.png +0 -0
  114. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/cards/terminal.png +0 -0
  115. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/favicon.ico +0 -0
  116. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/logo.png +0 -0
  117. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/style/custom.css +0 -0
  118. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/_static/style/s4defs-roles.css +0 -0
  119. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/configure.rst +0 -0
  120. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/credits.rst +0 -0
  121. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/devices-list.rst +0 -0
  122. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/devices.rst +0 -0
  123. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/envs-activate.rst +0 -0
  124. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/envs-list.rst +0 -0
  125. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/envs-uninstall.rst +0 -0
  126. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/envs.rst +0 -0
  127. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/jobs-add.rst +0 -0
  128. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/jobs-disable.rst +0 -0
  129. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/jobs-enable.rst +0 -0
  130. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/jobs-list.rst +0 -0
  131. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/jobs.rst +0 -0
  132. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/kernels.rst +0 -0
  133. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/cli/qbraid.rst +0 -0
  134. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/conf.py +0 -0
  135. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/index.rst +0 -0
  136. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/make.bat +0 -0
  137. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/docs/requirements.txt +0 -0
  138. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli/__init__.py +0 -0
  139. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  140. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli.egg-info/entry_points.txt +0 -0
  141. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/qbraid_cli.egg-info/top_level.txt +0 -0
  142. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/setup.cfg +0 -0
  143. {qbraid-cli-0.8.0.dev1 → qbraid-cli-0.8.0.dev3}/tests/__init__.py +0 -0
@@ -0,0 +1,3 @@
1
+ QBRAID_API_KEY= # YOURAPIKEY
2
+ QBRAID_ENVS_PATH= # default: ~/.qbraid/environments
3
+ QBRAID_CONFIG_FILE= # default: ~/.qbraid/qbraidrc
@@ -0,0 +1,3 @@
1
+ <!-- Please link or tag any issues that is PR closes -->
2
+
3
+ ## Changes
@@ -0,0 +1,34 @@
1
+ name: Formatting check
2
+
3
+ on:
4
+ pull_request:
5
+ branches: ['main']
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ main:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v4
16
+ with:
17
+ python-version: '3.10'
18
+ - name: Install dependencies
19
+ run: |
20
+ pip install --upgrade pip
21
+ pip install black isort pylint
22
+ - name: Check isort, black, pylint
23
+ run: |
24
+ black --check qbraid_cli tests tools
25
+ isort --check-only qbraid_cli tests tools
26
+ # if pylint qbraid_cli tests tools --disable=C0415,R0914,W0511 2>&1 | grep 'Your code has been rated at 10\.00/10' > /dev/null; then
27
+ # echo "Perfect pylint score!"
28
+ # else
29
+ # echo "Pylint score is not 10/10."
30
+ # exit 1
31
+ # fi
32
+ - name: Check copyright headers
33
+ run: |
34
+ python tools/verify_headers.py qbraid_cli tests tools --skip qbraid_cli/_version.py
@@ -23,7 +23,7 @@ jobs:
23
23
  cache: pip
24
24
  - name: Upgrade pip and install build tools
25
25
  run: |
26
- python -m pip install --upgrade pip
26
+ pip install --upgrade pip
27
27
  pip install setuptools wheel build
28
28
  - name: Build the package
29
29
  run: |
@@ -36,10 +36,11 @@ jobs:
36
36
 
37
37
  test:
38
38
  needs: build
39
- runs-on: ubuntu-latest
39
+ runs-on: ${{ matrix.os }}
40
40
  strategy:
41
41
  matrix:
42
- python-version: ['3.9', '3.10', '3.11']
42
+ os: [ubuntu-latest, windows-latest]
43
+ python-version: ['3.9', '3.10', '3.11', '3.12']
43
44
 
44
45
  steps:
45
46
  - uses: actions/checkout@v3
@@ -55,10 +56,17 @@ jobs:
55
56
  path: dist
56
57
  - name: Install package
57
58
  run: |
58
- pip install dist/*.whl
59
+ if ($env:RUNNER_OS -eq "Windows") {
60
+ Get-ChildItem dist/*.whl | ForEach-Object { pip install $_.FullName }
61
+ } else {
62
+ pip install dist/*.whl
63
+ }
64
+ shell: pwsh
59
65
  - name: Install testing dependencies
60
66
  run: |
61
67
  pip install pytest
62
68
  - name: Run tests with pytest
63
69
  run: |
64
- pytest
70
+ pytest
71
+ env:
72
+ QBRAID_API_KEY: ${{ secrets.QBRAID_API_KEY }}
@@ -8,6 +8,7 @@ on:
8
8
  jobs:
9
9
  pypi-publish:
10
10
  name: Build dist & upload to PyPI
11
+ environment: publish
11
12
  runs-on: ubuntu-latest
12
13
  steps:
13
14
  - uses: actions/checkout@v3
@@ -161,4 +161,4 @@ cython_debug/
161
161
  # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
162
  # and can be added to the global gitignore or merged into this file. For a more nuclear
163
163
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
- #.idea/
164
+ .idea/
@@ -1,19 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.0.dev1
3
+ Version: 0.8.0.dev3
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
7
  Project-URL: Homepage, https://www.qbraid.com/
8
- Project-URL: Documentation, https://docs.qbraid.com/projects/cli/en/latest/cli/qbraid.html
8
+ Project-URL: Documentation, https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
9
9
  Project-URL: Bug Tracker, https://github.com/qBraid/qBraid-Lab/issues
10
10
  Project-URL: Discord, https://discord.gg/KugF6Cnncm
11
11
  Project-URL: Launch on Lab, https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/qBraid-Lab.git
12
12
  Keywords: qbraid,cli,quantum,cloud
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Developers
15
- Classifier: Intended Audience :: System Administrators
16
15
  Classifier: Natural Language :: English
16
+ Classifier: License :: Other/Proprietary License
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Operating System :: POSIX :: Linux
17
20
  Classifier: Programming Language :: Python
18
21
  Classifier: Programming Language :: Python :: 3
19
22
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -23,11 +26,10 @@ Classifier: Programming Language :: Python :: 3.11
23
26
  Classifier: Programming Language :: Python :: 3.12
24
27
  Requires-Python: >=3.9
25
28
  Description-Content-Type: text/markdown
26
- Requires-Dist: typer[all]
27
- Requires-Dist: rich
28
- Requires-Dist: requests
29
- Requires-Dist: jupyter_client
30
- Requires-Dist: qbraid==0.5.1
29
+ Requires-Dist: typer>=0.12.1
30
+ Requires-Dist: rich>=10.11.0
31
+ Requires-Dist: jupyter_client<9.0.0,>=7.0.0
32
+ Requires-Dist: qbraid-core>=0.1.1
31
33
  Provides-Extra: jobs
32
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
33
35
  Provides-Extra: dev
@@ -46,6 +48,8 @@ Requires-Dist: build; extra == "docs"
46
48
 
47
49
  [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html)
48
50
  [![PyPI version](https://img.shields.io/pypi/v/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
51
+ [![Python verions](https://img.shields.io/pypi/pyversions/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
52
+ [![Downloads](https://static.pepy.tech/badge/qbraid-cli)](https://pepy.tech/project/qbraid-cli)
49
53
  [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/qBraid-Lab/issues)
50
54
  [![Discord](https://img.shields.io/discord/771898982564626445.svg?color=pink)](https://discord.gg/KugF6Cnncm)
51
55
 
@@ -82,7 +86,7 @@ $ qbraid
82
86
 
83
87
  - Use 'qbraid --version' to see the current version.
84
88
 
85
- Reference Docs: https://docs.qbraid.com/projects/cli/en/latest/cli/qbraid.html
89
+ Reference Docs: https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
86
90
  ```
87
91
 
88
92
  A qBraid CLI command has the following structure:
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html)
4
4
  [![PyPI version](https://img.shields.io/pypi/v/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
5
+ [![Python verions](https://img.shields.io/pypi/pyversions/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
6
+ [![Downloads](https://static.pepy.tech/badge/qbraid-cli)](https://pepy.tech/project/qbraid-cli)
5
7
  [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/qBraid-Lab/issues)
6
8
  [![Discord](https://img.shields.io/discord/771898982564626445.svg?color=pink)](https://discord.gg/KugF6Cnncm)
7
9
 
@@ -38,7 +40,7 @@ $ qbraid
38
40
 
39
41
  - Use 'qbraid --version' to see the current version.
40
42
 
41
- Reference Docs: https://docs.qbraid.com/projects/cli/en/latest/cli/qbraid.html
43
+ Reference Docs: https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
42
44
  ```
43
45
 
44
46
  A qBraid CLI command has the following structure:
@@ -62,7 +62,7 @@ Quick start
62
62
 
63
63
  - Use `qbraid --version` to display the current version.
64
64
 
65
- Reference Docs: https://docs.qbraid.com/projects/cli/en/latest/cli/qbraid.html
65
+ Reference Docs: https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
66
66
 
67
67
 
68
68
  **List environments** installed in your qBraid Lab instance using:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qbraid-cli"
7
- version = "0.8.0.dev1"
7
+ version = "0.8.0.dev3"
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" }]
@@ -13,8 +13,11 @@ keywords = ["qbraid", "cli", "quantum", "cloud"]
13
13
  classifiers = [
14
14
  "Development Status :: 5 - Production/Stable",
15
15
  "Intended Audience :: Developers",
16
- "Intended Audience :: System Administrators",
17
16
  "Natural Language :: English",
17
+ "License :: Other/Proprietary License",
18
+ "Intended Audience :: System Administrators",
19
+ "Operating System :: Microsoft :: Windows",
20
+ "Operating System :: POSIX :: Linux",
18
21
  "Programming Language :: Python",
19
22
  "Programming Language :: Python :: 3",
20
23
  "Programming Language :: Python :: 3 :: Only",
@@ -24,17 +27,16 @@ classifiers = [
24
27
  "Programming Language :: Python :: 3.12",
25
28
  ]
26
29
  dependencies = [
27
- "typer[all]",
28
- "rich",
29
- "requests",
30
- "jupyter_client",
31
- "qbraid==0.5.1"
30
+ "typer>=0.12.1",
31
+ "rich>=10.11.0",
32
+ "jupyter_client>=7.0.0,<9.0.0",
33
+ "qbraid-core>=0.1.1",
32
34
  ]
33
35
  requires-python = ">= 3.9"
34
36
 
35
37
  [project.urls]
36
38
  Homepage = "https://www.qbraid.com/"
37
- Documentation = "https://docs.qbraid.com/projects/cli/en/latest/cli/qbraid.html"
39
+ Documentation = "https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html"
38
40
  "Bug Tracker" = "https://github.com/qBraid/qBraid-Lab/issues"
39
41
  Discord = "https://discord.gg/KugF6Cnncm"
40
42
  "Launch on Lab" = "https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/qBraid-Lab.git"
@@ -52,6 +54,7 @@ write_to = "qbraid_cli/_version.py"
52
54
 
53
55
  [tool.black]
54
56
  line-length = 100
57
+ target-version = ["py39", "py310", "py311", "py312"]
55
58
 
56
59
  [tool.isort]
57
60
  profile = "black"
@@ -72,4 +75,4 @@ ignore-paths = [
72
75
 
73
76
  [tool.pytest.ini_options]
74
77
  addopts = "-ra"
75
- testpaths = ["tests"]
78
+ testpaths = ["tests"]
@@ -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+g7301c9d'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g7301c9d')
15
+ __version__ = version = '0.1.dev1+g272a1c1'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g272a1c1')
@@ -0,0 +1,9 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining the qbraid configure namespace
6
+
7
+ """
8
+
9
+ from .app import configure_app
@@ -0,0 +1,111 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining actions invoked by 'qbraid configure' command(s).
6
+
7
+ """
8
+
9
+ import configparser
10
+ import re
11
+ from copy import deepcopy
12
+ from typing import Dict, Optional
13
+
14
+ import typer
15
+ from qbraid_core.config import (
16
+ DEFAULT_CONFIG_SECTION,
17
+ DEFAULT_ENDPOINT_URL,
18
+ USER_CONFIG_PATH,
19
+ load_config,
20
+ save_config,
21
+ )
22
+ from rich.console import Console
23
+
24
+ from qbraid_cli.handlers import handle_filesystem_operation
25
+
26
+
27
+ def validate_input(key: str, value: str) -> str:
28
+ """Validate the user input based on the key.
29
+
30
+ Args:
31
+ key (str): The configuration key
32
+ value (str): The user input value
33
+
34
+ Returns:
35
+ str: The validated value
36
+
37
+ Raises:
38
+ typer.BadParameter: If the value is invalid
39
+ """
40
+ if key == "url":
41
+ if not re.match(r"^https?://\S+$", value):
42
+ raise typer.BadParameter("Invalid URL format.")
43
+ elif key == "email":
44
+ if not re.match(r"^\S+@\S+\.\S+$", value):
45
+ raise typer.BadParameter("Invalid email format.")
46
+ elif key == "api-key":
47
+ if not re.match(r"^[a-zA-Z0-9]{11}$", value):
48
+ raise typer.BadParameter("Invalid API key format.")
49
+ return value
50
+
51
+
52
+ def prompt_for_config(
53
+ config: configparser.ConfigParser,
54
+ section: str,
55
+ key: str,
56
+ default_values: Optional[Dict[str, str]] = None,
57
+ ) -> str:
58
+ """Prompt the user for a configuration setting, showing the current value as default."""
59
+ default_values = default_values or {}
60
+ current_value = config.get(section, key, fallback=default_values.get(key, ""))
61
+ display_value = "None" if not current_value else current_value
62
+ hide_input = False
63
+ show_default = True
64
+
65
+ if section == DEFAULT_CONFIG_SECTION:
66
+ if key == "url":
67
+ return current_value
68
+
69
+ if key == "api-key":
70
+ if current_value:
71
+ display_value = "*" * len(current_value[:-4]) + current_value[-4:]
72
+ hide_input = True
73
+ show_default = False
74
+
75
+ new_value = typer.prompt(
76
+ f"Enter {key}", default=display_value, show_default=show_default, hide_input=hide_input
77
+ ).strip()
78
+
79
+ if new_value == display_value:
80
+ return current_value
81
+
82
+ return validate_input(key, new_value)
83
+
84
+
85
+ def default_action(section: str = DEFAULT_CONFIG_SECTION):
86
+ """Configure qBraid CLI options."""
87
+ config = load_config()
88
+ original_config = deepcopy(config)
89
+
90
+ if section not in config:
91
+ config[section] = {}
92
+
93
+ default_values = {"url": DEFAULT_ENDPOINT_URL}
94
+
95
+ config[section]["url"] = prompt_for_config(config, section, "url", default_values)
96
+ config[section]["api-key"] = prompt_for_config(config, section, "api-key", default_values)
97
+
98
+ for key in list(config[section]):
99
+ if not config[section][key]:
100
+ del config[section][key]
101
+
102
+ console = Console()
103
+ if config == original_config:
104
+ console.print("\n[bold grey70]Configuration saved, unchanged.")
105
+ else:
106
+
107
+ def _save_config():
108
+ save_config(config)
109
+
110
+ handle_filesystem_operation(_save_config, USER_CONFIG_PATH)
111
+ console.print("\n[bold green]Configuration updated successfully.")
@@ -0,0 +1,54 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining commands in the 'qbraid configure' namespace.
6
+
7
+ """
8
+
9
+ import typer
10
+ from qbraid_core.config import load_config, save_config
11
+
12
+ from qbraid_cli.configure.actions import default_action
13
+
14
+ # disable pretty_exceptions_show_locals to avoid printing sensative information in the traceback
15
+ configure_app = typer.Typer(
16
+ help="Configure qBraid CLI options.", pretty_exceptions_show_locals=False
17
+ )
18
+
19
+
20
+ @configure_app.callback(invoke_without_command=True)
21
+ def configure(ctx: typer.Context):
22
+ """
23
+ Prompts user for configuration values such as your qBraid API Key.
24
+ If your config file does not exist (the default location is ~/.qbraid/qbraidrc),
25
+ the qBraid CLI will create it for you. To keep an existing value, hit enter
26
+ when prompted for the value. When you are prompted for information, the current
27
+ value will be displayed in [brackets]. If the config item has no value, it be
28
+ displayed as [None].
29
+
30
+ """
31
+ if ctx.invoked_subcommand is None:
32
+ default_action()
33
+
34
+
35
+ @configure_app.command(name="set")
36
+ def configure_set(
37
+ name: str = typer.Argument(..., help="Config name"),
38
+ value: str = typer.Argument(..., help="Config value"),
39
+ profile: str = typer.Option("default", help="Profile name"),
40
+ ):
41
+ """Set configuration value in qbraidrc file."""
42
+ config = load_config()
43
+
44
+ if profile not in config:
45
+ config[profile] = {}
46
+
47
+ config[profile][name] = value
48
+
49
+ save_config(config)
50
+ typer.echo("Configuration updated successfully.")
51
+
52
+
53
+ if __name__ == "__main__":
54
+ configure_app()
@@ -0,0 +1,9 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining the qbraid credits namespace
6
+
7
+ """
8
+
9
+ from .app import credits_app
@@ -0,0 +1,32 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining commands in the 'qbraid credits' namespace.
6
+
7
+ """
8
+
9
+ import typer
10
+
11
+ from qbraid_cli.handlers import run_progress_task
12
+
13
+ credits_app = typer.Typer(help="Manage qBraid credits.")
14
+
15
+
16
+ @credits_app.command(name="value")
17
+ def credits_value():
18
+ """Get number of qBraid credits remaining."""
19
+
20
+ def get_credits() -> float:
21
+ from qbraid_core import QbraidClient
22
+
23
+ client = QbraidClient()
24
+ return client.user_credits_value()
25
+
26
+ qbraid_credits: float = run_progress_task(get_credits)
27
+ credits_text = typer.style(f"{qbraid_credits:.2f}", fg=typer.colors.GREEN, bold=True)
28
+ typer.secho(f"\nqBraid credits: {credits_text}")
29
+
30
+
31
+ if __name__ == "__main__":
32
+ credits_app()
@@ -0,0 +1,9 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining the qbraid devices namespace
6
+
7
+ """
8
+
9
+ from .app import devices_app
@@ -0,0 +1,80 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining commands in the 'qbraid devices' namespace.
6
+
7
+ """
8
+
9
+ from typing import Any, Callable, Optional, Tuple
10
+
11
+ import typer
12
+ from rich.console import Console
13
+
14
+ from qbraid_cli.devices.validation import validate_provider, validate_status, validate_type
15
+ from qbraid_cli.handlers import run_progress_task
16
+
17
+ devices_app = typer.Typer(help="Manage qBraid quantum devices.")
18
+
19
+
20
+ @devices_app.command(name="list")
21
+ def devices_list( # pylint: disable=too-many-branches
22
+ status: Optional[str] = typer.Option(
23
+ None, "--status", "-s", help="'ONLINE'|'OFFLINE'|'RETIRED'", callback=validate_status
24
+ ),
25
+ device_type: Optional[str] = typer.Option(
26
+ None, "--type", "-t", help="'QPU'|'SIMULATOR'", callback=validate_type
27
+ ),
28
+ provider: Optional[str] = typer.Option(
29
+ None,
30
+ "--provider",
31
+ "-p",
32
+ help="'AWS'|'IBM'|'IonQ'|'Rigetti'|'OQC'|'QuEra'",
33
+ callback=validate_provider,
34
+ ),
35
+ ) -> None:
36
+ """List qBraid quantum devices."""
37
+ filters = {}
38
+ if status:
39
+ filters["status"] = status
40
+ if device_type:
41
+ filters["type"] = "Simulator" if device_type == "SIMULATOR" else device_type
42
+ if provider:
43
+ filters["provider"] = provider
44
+
45
+ def import_devices() -> Tuple[Any, Callable]:
46
+ from qbraid_core.services.quantum import QuantumClient, process_device_data
47
+
48
+ client = QuantumClient()
49
+
50
+ return client, process_device_data
51
+
52
+ result: Tuple[Callable, Callable] = run_progress_task(import_devices)
53
+ client, process_device_data = result
54
+ raw_data = client.search_devices(filters)
55
+ device_data, msg = process_device_data(raw_data)
56
+
57
+ console = Console()
58
+ header_1 = "Provider"
59
+ header_2 = "Device Name"
60
+ header_3 = "ID"
61
+ header_4 = "Status"
62
+ console.print(
63
+ f"\n[bold]{header_1.ljust(12)}{header_2.ljust(35)}{header_3.ljust(41)}{header_4}[/bold]"
64
+ )
65
+ for device_provider, device_name, device_id, device_status in device_data:
66
+ if device_status == "ONLINE":
67
+ status_color = "green"
68
+ elif device_status == "OFFLINE":
69
+ status_color = "red"
70
+ else:
71
+ status_color = "grey"
72
+ console.print(
73
+ f"{device_provider.ljust(12)}{device_name.ljust(35)}{device_id.ljust(40)}",
74
+ f"[{status_color}]{device_status}[/{status_color}]",
75
+ )
76
+ console.print(f"\n{msg}", style="italic", justify="left")
77
+
78
+
79
+ if __name__ == "__main__":
80
+ devices_app()
@@ -0,0 +1,27 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module for validating command arguments for qBraid devices commands.
6
+
7
+
8
+ """
9
+
10
+ from typing import Optional, Union
11
+
12
+ from qbraid_cli.handlers import validate_item
13
+
14
+
15
+ def validate_status(value: Optional[str]) -> Union[str, None]:
16
+ """Validate device status query parameter."""
17
+ return validate_item(value, ["ONLINE", "OFFLINE", "RETIRED"], "Status")
18
+
19
+
20
+ def validate_type(value: Optional[str]) -> Union[str, None]:
21
+ """Validate device type query parameter."""
22
+ return validate_item(value, ["QPU", "SIMULATOR"], "Type")
23
+
24
+
25
+ def validate_provider(value: Optional[str]) -> Union[str, None]:
26
+ """Validate device provider query parameter."""
27
+ return validate_item(value, ["AWS", "IBM", "IonQ", "Rigetti", "OQC", "QuEra"], "Provider")
@@ -0,0 +1,9 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining the qbraid envs namespace
6
+
7
+ """
8
+
9
+ from .app import envs_app
@@ -1,3 +1,6 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
1
4
  """
2
5
  Module supporting 'qbraid envs activate' command.
3
6
 
@@ -31,13 +34,13 @@ def print_activate_command(venv_path: Path) -> None:
31
34
  # Windows operating system
32
35
  activate_script = venv_path / "Scripts" / "activate"
33
36
  activate_script_ps = venv_path / "Scripts" / "Activate.ps1"
34
- typer.echo(" " + str(activate_script))
37
+ typer.echo("\t$ " + str(activate_script))
35
38
  typer.echo("\nOr for PowerShell, use:\n")
36
- typer.echo(" " + f"& {activate_script_ps}")
39
+ typer.echo("\t$ " + f"& {activate_script_ps}")
37
40
  else:
38
41
  # Unix-like operating systems (Linux/macOS)
39
42
  activate_script = venv_path / "bin" / "activate"
40
- typer.echo(" " + f"source {activate_script}")
43
+ typer.echo("\t$ " + f"source {activate_script}")
41
44
  typer.echo("")
42
45
  raise typer.Exit()
43
46
 
@@ -48,12 +51,12 @@ def activate_pyvenv(venv_path: Path):
48
51
 
49
52
  if shell_path is None:
50
53
  print_activate_command(venv_path)
51
-
54
+ return # Return early since we can't proceed without a shell
52
55
  try:
53
56
  shell_rc = find_shell_rc(shell_path)
54
57
  except (FileNotFoundError, ValueError):
55
58
  print_activate_command(venv_path)
56
-
59
+ return # Return early since no suitable shell rc file was found
57
60
  bin_path = str(venv_path / "bin")
58
61
 
59
62
  os.system(