qbraid-cli 0.8.7__tar.gz → 0.9.0a0__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 (130) hide show
  1. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/docs.yml +3 -1
  2. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/format.yml +4 -2
  3. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/main.yml +4 -1
  4. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/CONTRIBUTING.md +6 -5
  5. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/Makefile +8 -2
  6. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/PKG-INFO +5 -4
  7. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/README.md +1 -1
  8. qbraid_cli-0.8.7/docs/guide/overview.rst → qbraid_cli-0.9.0a0/docs/index.rst +19 -5
  9. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/pyproject.toml +5 -4
  10. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/_version.py +2 -2
  11. qbraid_cli-0.9.0a0/qbraid_cli/account/__init__.py +11 -0
  12. qbraid_cli-0.9.0a0/qbraid_cli/account/app.py +65 -0
  13. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/main.py +16 -8
  14. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/PKG-INFO +5 -4
  15. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/SOURCES.txt +4 -25
  16. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/requires.txt +4 -2
  17. qbraid_cli-0.9.0a0/tests/account/test_account_credits.py +88 -0
  18. qbraid_cli-0.8.7/docs/_static/api-key.png +0 -0
  19. qbraid_cli-0.8.7/docs/_static/cards/jupyter.png +0 -0
  20. qbraid_cli-0.8.7/docs/_static/cards/python.png +0 -0
  21. qbraid_cli-0.8.7/docs/_static/cards/terminal.png +0 -0
  22. qbraid_cli-0.8.7/docs/cli/configure.rst +0 -60
  23. qbraid_cli-0.8.7/docs/cli/credits.rst +0 -23
  24. qbraid_cli-0.8.7/docs/cli/devices-list.rst +0 -35
  25. qbraid_cli-0.8.7/docs/cli/devices.rst +0 -17
  26. qbraid_cli-0.8.7/docs/cli/envs-activate.rst +0 -36
  27. qbraid_cli-0.8.7/docs/cli/envs-list.rst +0 -37
  28. qbraid_cli-0.8.7/docs/cli/envs-uninstall.rst +0 -40
  29. qbraid_cli-0.8.7/docs/cli/envs.rst +0 -25
  30. qbraid_cli-0.8.7/docs/cli/jobs-add.rst +0 -49
  31. qbraid_cli-0.8.7/docs/cli/jobs-disable.rst +0 -36
  32. qbraid_cli-0.8.7/docs/cli/jobs-enable.rst +0 -35
  33. qbraid_cli-0.8.7/docs/cli/jobs-list.rst +0 -35
  34. qbraid_cli-0.8.7/docs/cli/jobs.rst +0 -26
  35. qbraid_cli-0.8.7/docs/cli/kernels.rst +0 -31
  36. qbraid_cli-0.8.7/docs/cli/qbraid.rst +0 -68
  37. qbraid_cli-0.8.7/docs/index.rst +0 -113
  38. qbraid_cli-0.8.7/qbraid_cli/credits/__init__.py +0 -11
  39. qbraid_cli-0.8.7/qbraid_cli/credits/app.py +0 -35
  40. qbraid_cli-0.8.7/ruff.toml +0 -62
  41. qbraid_cli-0.8.7/tests/credits/test_credits_value.py +0 -43
  42. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.env.example +0 -0
  43. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  44. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  45. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  46. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/bump-version.yml +0 -0
  47. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/pre-release.yml +0 -0
  48. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/publish.yml +0 -0
  49. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.github/workflows/tag-on-merge.yml +0 -0
  50. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.gitignore +0 -0
  51. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/.readthedocs.yml +0 -0
  52. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/LICENSE +0 -0
  53. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/MANIFEST.IN +0 -0
  54. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/Makefile +0 -0
  55. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/_static/favicon.ico +0 -0
  56. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/_static/logo.png +0 -0
  57. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/_static/style/custom.css +0 -0
  58. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/_static/style/s4defs-roles.css +0 -0
  59. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/conf.py +0 -0
  60. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/make.bat +0 -0
  61. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/docs/requirements.txt +0 -0
  62. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/__init__.py +0 -0
  63. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/__init__.py +0 -0
  64. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/app.py +0 -0
  65. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/headers.py +0 -0
  66. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/admin/validation.py +0 -0
  67. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/__init__.py +0 -0
  68. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/actions.py +0 -0
  69. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/configure/app.py +0 -0
  70. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/__init__.py +0 -0
  71. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/app.py +0 -0
  72. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/devices/validation.py +0 -0
  73. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/__init__.py +0 -0
  74. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/activate.py +0 -0
  75. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/app.py +0 -0
  76. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/create.py +0 -0
  77. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/envs/data_handling.py +0 -0
  78. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/exceptions.py +0 -0
  79. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/handlers.py +0 -0
  80. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/__init__.py +0 -0
  81. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/app.py +0 -0
  82. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/toggle_braket.py +0 -0
  83. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/jobs/validation.py +0 -0
  84. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/kernels/__init__.py +0 -0
  85. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/kernels/app.py +0 -0
  86. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/__init__.py +0 -0
  87. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/app.py +0 -0
  88. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/pip/hooks.py +0 -0
  89. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli/py.typed +0 -0
  90. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  91. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/entry_points.txt +0 -0
  92. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/qbraid_cli.egg-info/top_level.txt +0 -0
  93. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/setup.cfg +0 -0
  94. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/__init__.py +0 -0
  95. {qbraid_cli-0.8.7/tests/configure → qbraid_cli-0.9.0a0/tests/account}/__init__.py +0 -0
  96. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/admin/test_headers.py +0 -0
  97. {qbraid_cli-0.8.7/tests/credits → qbraid_cli-0.9.0a0/tests/configure}/__init__.py +0 -0
  98. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_prompt_for_config.py +0 -0
  99. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_set.py +0 -0
  100. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/configure/test_configure_validate_input.py +0 -0
  101. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/devices/__init__.py +0 -0
  102. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/devices/test_devices_list.py +0 -0
  103. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/devices/test_devices_validations.py +0 -0
  104. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/__init__.py +0 -0
  105. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate.py +0 -0
  106. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
  107. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_print_command.py +0 -0
  108. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_activate_pyenv.py +0 -0
  109. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_list.py +0 -0
  110. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/envs/test_envs_remove.py +0 -0
  111. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/__init__.py +0 -0
  112. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_disable.py +0 -0
  113. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_enable.py +0 -0
  114. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_list.py +0 -0
  115. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_state.py +0 -0
  116. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
  117. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
  118. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
  119. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
  120. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_get_state.py +0 -0
  121. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
  122. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/jobs/test_jobs_validate_library.py +0 -0
  123. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/kernels/__init__.py +0 -0
  124. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tests/kernels/test_kernels_list.py +0 -0
  125. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/bump_version.py +0 -0
  126. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/create_dev_build.sh +0 -0
  127. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/install_wheel_extras.sh +0 -0
  128. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/split_md.py +0 -0
  129. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/split_rst.py +0 -0
  130. {qbraid_cli-0.8.7 → qbraid_cli-0.9.0a0}/tools/stamp_pre_release.py +0 -0
@@ -3,12 +3,14 @@ name: Build Docs
3
3
  on:
4
4
  pull_request:
5
5
  branches: ['main']
6
+ types: [opened, reopened, ready_for_review, synchronize]
6
7
  push:
7
8
  branches: ['main']
8
9
  workflow_dispatch:
9
10
 
10
11
  jobs:
11
12
  build:
13
+ if: github.event.pull_request.draft == false
12
14
  runs-on: ubuntu-latest
13
15
 
14
16
  steps:
@@ -25,7 +27,7 @@ jobs:
25
27
  - name: Build & install package
26
28
  run: |
27
29
  python -m build .
28
- python -m pip install dist/*.whl
30
+ tools/install_wheel_extras.sh dist --extra envs
29
31
  - name: Generate docs assets
30
32
  run: |
31
33
  python -c "import pathlib; pathlib.Path('docs/tree').mkdir(parents=True, exist_ok=True)"
@@ -1,12 +1,14 @@
1
- name: Formatting check
1
+ name: Format
2
2
 
3
3
  on:
4
4
  pull_request:
5
5
  branches: ['main']
6
+ types: [opened, reopened, ready_for_review, synchronize]
6
7
  workflow_dispatch:
7
8
 
8
9
  jobs:
9
- main:
10
+ check:
11
+ if: github.event.pull_request.draft == false
10
12
  runs-on: ubuntu-latest
11
13
 
12
14
  steps:
@@ -3,12 +3,14 @@ name: CI
3
3
  on:
4
4
  pull_request:
5
5
  branches: ['main']
6
+ types: [opened, reopened, ready_for_review, synchronize]
6
7
  push:
7
8
  branches: ['main']
8
9
  workflow_dispatch:
9
10
 
10
11
  jobs:
11
12
  build:
13
+ if: github.event.pull_request.draft == false
12
14
  runs-on: ubuntu-latest
13
15
  strategy:
14
16
  matrix:
@@ -35,6 +37,7 @@ jobs:
35
37
  path: dist/*.whl
36
38
 
37
39
  test:
40
+ if: github.event.pull_request.draft == false
38
41
  needs: build
39
42
  runs-on: ${{ matrix.os }}
40
43
  strategy:
@@ -64,7 +67,7 @@ jobs:
64
67
  shell: pwsh
65
68
  - name: Install testing dependencies
66
69
  run: |
67
- pip install pytest pytest-cov
70
+ pip install pytest pytest-cov qbraid-core[environments]
68
71
  - name: Run tests with pytest
69
72
  run: |
70
73
  pytest --cov=qbraid_cli tests/ --cov-report=html --cov-report=xml --cov-report=term --cov-config=pyproject.toml
@@ -1,10 +1,8 @@
1
1
  # Contributing
2
2
 
3
3
  [![CI](https://github.com/qBraid/qBraid-CLI/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/qBraid/qBraid-CLI/actions/workflows/main.yml)
4
- [![Documentation Status](https://readthedocs.com/projects/qbraid-qbraid-cli/badge/?version=latest)](https://docs.qbraid.com/projects/cli/en/latest/?badge=latest)
5
4
  [![codecov](https://codecov.io/gh/qBraid/qBraid-CLI/graph/badge.svg?token=wVNrLILy9c)](https://codecov.io/gh/qBraid/qBraid-CLI)
6
5
 
7
-
8
6
  Welcome! We're delighted that you're interested in contributing. Your help is essential for keeping the project great.
9
7
 
10
8
  ## Getting Started
@@ -99,17 +97,20 @@ open docs/build/html/index.html
99
97
 
100
98
  ## Code style
101
99
 
102
- For code style, our project uses [ruff](https://github.com/astral-sh/ruff). Specific configurations for these tools should be added to [`pyproject.toml`](pyproject.toml).
100
+ For code style, our project uses a combination of [isort](https://github.com/PyCQA/isort), [pylint](https://github.com/pylint-dev/pylint), [black](https://github.com/psf/black), and [mypy](https://github.com/python/mypy). Specific configurations for these tools should be added to [`pyproject.toml`](pyproject.toml).
103
101
 
104
102
  Install linters:
105
103
 
106
104
  ```bash
107
- pip install ruff qbraid-cli
105
+ pip install black isort pylint mypy
108
106
  ```
109
107
 
110
108
  Run the following and make changes as needed to satisfy format checks:
111
109
 
112
110
  ```bash
113
- ruff format qbraid_cli tests tools
111
+ black qbraid_cli tests tools
112
+ isort qbraid_cli tests tools
113
+ pylint qbraid_cli tests tools
114
+ mypy qbraid_cli tests tools
114
115
  qbraid admin headers qbraid_cli tests tools --type=default --fix
115
116
  ```
@@ -16,15 +16,21 @@ help: ## Display this help message
16
16
  @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
17
17
  @echo
18
18
 
19
- docs: check_dependencies_docs check_build_version ## Generate documentation
19
+ docs: check_dependencies_docs check_build_version ## Generate documentation (Sphinx)
20
20
  @python -c "import pathlib; pathlib.Path('$(TREE_DIR)').mkdir(parents=True, exist_ok=True)"
21
- @python -c "import glob, os; [os.remove(f) for f in glob.glob('$(TREE_DIR)/*.rst')]"
21
+ @python -c "import glob, os; [os.remove(f) for f in glob.glob('$(TREE_DIR)/*')]"
22
22
  @typer qbraid_cli.main utils docs --name=qbraid --output=$(TREE_DIR)/qbraid.md
23
23
  @m2r $(TREE_DIR)/qbraid.md
24
24
  @python -c "import os; os.remove('$(TREE_DIR)/qbraid.md')"
25
25
  @python $(TOOLS_DIR)/split_rst.py $(TREE_DIR)/qbraid.rst
26
26
  @sphinx-build -W -b html $(DOCS_DIR) $(BUILD_DIR)
27
27
 
28
+ docs-mdx: check_dependencies_docs check_build_version ## Generate documentation (Mintlify)
29
+ @python -c "import pathlib; pathlib.Path('$(TREE_DIR)').mkdir(parents=True, exist_ok=True)"
30
+ @python -c "import glob, os; [os.remove(f) for f in glob.glob('$(TREE_DIR)/*')]"
31
+ @typer qbraid_cli.main utils docs --name=qbraid --output=$(TREE_DIR)/qbraid.md
32
+ @python $(TOOLS_DIR)/split_md.py $(TREE_DIR)/qbraid.md
33
+
28
34
  test: check_dependencies_test ## Run tests with pytest
29
35
  @python -m pytest $(TESTS_DIR)
30
36
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.7
3
+ Version: 0.9.0a0
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License: Proprietary
@@ -29,11 +29,12 @@ Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  Requires-Dist: typer>=0.12.1
31
31
  Requires-Dist: rich>=10.11.0
32
- Requires-Dist: qbraid-core[environments]>=0.1.23
32
+ Requires-Dist: qbraid-core>=0.1.28
33
33
  Provides-Extra: jobs
34
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
35
+ Provides-Extra: envs
36
+ Requires-Dist: qbraid-core[environments]; extra == "envs"
35
37
  Provides-Extra: dev
36
- Requires-Dist: ruff; extra == "dev"
37
38
  Requires-Dist: isort; extra == "dev"
38
39
  Requires-Dist: black; extra == "dev"
39
40
  Requires-Dist: pytest; extra == "dev"
@@ -141,7 +142,7 @@ Options
141
142
 
142
143
  Commands
143
144
  configure Configure qBraid CLI options.
144
- credits Manage qBraid credits.
145
+ account Manage qBraid account.
145
146
  devices Manage qBraid quantum devices.
146
147
  envs Manage qBraid environments.
147
148
  jobs Manage qBraid quantum jobs.
@@ -100,7 +100,7 @@ Options
100
100
 
101
101
  Commands
102
102
  configure Configure qBraid CLI options.
103
- credits Manage qBraid credits.
103
+ account Manage qBraid account.
104
104
  devices Manage qBraid quantum devices.
105
105
  envs Manage qBraid environments.
106
106
  jobs Manage qBraid quantum jobs.
@@ -1,7 +1,5 @@
1
- .. _cli_overview:
2
-
3
- Overview
4
- =========
1
+ Documentation
2
+ ==============
5
3
 
6
4
  .. raw:: html
7
5
 
@@ -33,7 +31,7 @@ the qBraid CLI can be intalled using `pip <https://pypi.org/project/qbraid-cli/>
33
31
  pip install qbraid-cli
34
32
 
35
33
  To use the qBraid CLI, login to qBraid (or create an account), launch Lab, and then open Terminal.
36
- You can also access the CLI directly from within `Notebooks <https://docs.qbraid.com/projects/lab/en/latest/lab/notebooks.html>`_
34
+ You can also access the CLI directly from within `Notebooks <https://docs.qbraid.com/lab/user-guide/notebooks>`_
37
35
  using the ``!`` operator. See `quantum jobs example <https://github.com/qBraid/qbraid-lab-demo/blob/045c7a8fbdcae66a7e64533dd9fe0e981dc02cf4/qbraid_lab/quantum_jobs/aws_quantum_jobs.ipynb>`_.
38
36
 
39
37
  - `Launch qBraid Lab → <https://lab.qbraid.com/>`_
@@ -107,3 +105,19 @@ by disabling quantum jobs:
107
105
  .. code-block:: console
108
106
 
109
107
  $ qbraid jobs disable braket # toggle quantum jobs off
108
+
109
+
110
+ .. toctree::
111
+ :maxdepth: 1
112
+ :caption: CLI API Reference
113
+ :hidden:
114
+
115
+ tree/qbraid
116
+ tree/qbraid_admin
117
+ tree/qbraid_configure
118
+ tree/qbraid_account
119
+ tree/qbraid_devices
120
+ tree/qbraid_envs
121
+ tree/qbraid_jobs
122
+ tree/qbraid_kernels
123
+ tree/qbraid_pip
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qbraid-cli"
7
- version = "0.8.7"
7
+ version = "0.9.0a0"
8
8
  description = "Command Line Interface for interacting with all parts of the qBraid platform."
9
9
  readme = "README.md"
10
10
  authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
@@ -30,7 +30,7 @@ classifiers = [
30
30
  dependencies = [
31
31
  "typer>=0.12.1",
32
32
  "rich>=10.11.0",
33
- "qbraid-core[environments]>=0.1.23",
33
+ "qbraid-core>=0.1.28",
34
34
  ]
35
35
  requires-python = ">= 3.9"
36
36
 
@@ -42,7 +42,8 @@ Discord = "https://discord.gg/KugF6Cnncm"
42
42
 
43
43
  [project.optional-dependencies]
44
44
  jobs = ["amazon-braket-sdk>=1.48.1"]
45
- dev = ["ruff", "isort", "black", "pytest", "pytest-cov"]
45
+ envs = ["qbraid-core[environments]"]
46
+ dev = ["isort", "black", "pytest", "pytest-cov"]
46
47
 
47
48
  [project.scripts]
48
49
  qbraid = "qbraid_cli.main:app"
@@ -52,7 +53,7 @@ write_to = "qbraid_cli/_version.py"
52
53
 
53
54
  [tool.black]
54
55
  line-length = 100
55
- target-version = ["py39", "py310", "py311"]
56
+ target-version = ["py39", "py310", "py311", "py312"]
56
57
 
57
58
  [tool.isort]
58
59
  profile = "black"
@@ -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+g49939c4'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g49939c4')
15
+ __version__ = version = '0.1.dev1+ge41229b.d20241106'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1', 'ge41229b.d20241106')
@@ -0,0 +1,11 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining the qbraid account namespace
6
+
7
+ """
8
+
9
+ from .app import account_app
10
+
11
+ __all__ = ["account_app"]
@@ -0,0 +1,65 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining commands in the 'qbraid user' namespace.
6
+
7
+ """
8
+
9
+ from typing import Any
10
+
11
+ import rich
12
+ import typer
13
+
14
+ from qbraid_cli.handlers import run_progress_task
15
+
16
+ account_app = typer.Typer(help="Manage qBraid account.")
17
+
18
+
19
+ @account_app.command(name="credits")
20
+ def account_credits():
21
+ """Get number of qBraid credits remaining."""
22
+
23
+ def get_credits() -> float:
24
+ from qbraid_core import QbraidClient
25
+
26
+ client = QbraidClient()
27
+ return client.user_credits_value()
28
+
29
+ qbraid_credits: float = run_progress_task(get_credits)
30
+ typer.secho(
31
+ f"\n{typer.style('qBraid credits remaining:')} "
32
+ f"{typer.style(f'{qbraid_credits:.4f}', fg=typer.colors.MAGENTA, bold=True)}",
33
+ nl=True, # Ensure a newline after output (default is True)
34
+ )
35
+ rich.print("\nFor more information, visit: https://docs.qbraid.com/home/pricing#credits")
36
+
37
+
38
+ @account_app.command(name="info")
39
+ def account_info():
40
+ """Get qBraid account (user) metadata."""
41
+
42
+ def get_user() -> dict[str, Any]:
43
+ from qbraid_core import QbraidSession
44
+
45
+ session = QbraidSession()
46
+ user = session.get_user()
47
+ personal_info: dict = user.get("personalInformation", {})
48
+ metadata = {
49
+ "_id": user.get("_id"),
50
+ "userName": user.get("userName"),
51
+ "email": user.get("email"),
52
+ "joinedDate": user.get("createdAt", "Unknown"),
53
+ "activePlan": user.get("activePlan", "") or "Free",
54
+ "organization": personal_info.get("organization", "") or "qbraid",
55
+ "role": personal_info.get("role", "") or "guest",
56
+ }
57
+
58
+ return metadata
59
+
60
+ info = run_progress_task(get_user)
61
+ rich.print(info)
62
+
63
+
64
+ if __name__ == "__main__":
65
+ account_app()
@@ -8,25 +8,33 @@ Entrypoint for the qBraid CLI.
8
8
 
9
9
  import typer
10
10
 
11
+ from qbraid_cli.account.app import account_app
11
12
  from qbraid_cli.admin.app import admin_app
12
13
  from qbraid_cli.configure.app import configure_app
13
- from qbraid_cli.credits.app import credits_app
14
14
  from qbraid_cli.devices.app import devices_app
15
- from qbraid_cli.envs.app import envs_app
16
15
  from qbraid_cli.jobs.app import jobs_app
17
- from qbraid_cli.kernels.app import kernels_app
18
- from qbraid_cli.pip.app import pip_app
16
+
17
+ try:
18
+ from qbraid_cli.envs.app import envs_app
19
+ from qbraid_cli.kernels.app import kernels_app
20
+ from qbraid_cli.pip.app import pip_app
21
+
22
+ ENVS_COMMANDS = True
23
+ except ImportError:
24
+ ENVS_COMMANDS = False
19
25
 
20
26
  app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})
21
27
 
22
28
  app.add_typer(admin_app, name="admin")
23
29
  app.add_typer(configure_app, name="configure")
24
- app.add_typer(credits_app, name="credits")
30
+ app.add_typer(account_app, name="account")
25
31
  app.add_typer(devices_app, name="devices")
26
- app.add_typer(envs_app, name="envs")
27
32
  app.add_typer(jobs_app, name="jobs")
28
- app.add_typer(kernels_app, name="kernels")
29
- app.add_typer(pip_app, name="pip")
33
+
34
+ if ENVS_COMMANDS is True:
35
+ app.add_typer(envs_app, name="envs")
36
+ app.add_typer(kernels_app, name="kernels")
37
+ app.add_typer(pip_app, name="pip")
30
38
 
31
39
 
32
40
  def version_callback(value: bool):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.7
3
+ Version: 0.9.0a0
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License: Proprietary
@@ -29,11 +29,12 @@ Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  Requires-Dist: typer>=0.12.1
31
31
  Requires-Dist: rich>=10.11.0
32
- Requires-Dist: qbraid-core[environments]>=0.1.23
32
+ Requires-Dist: qbraid-core>=0.1.28
33
33
  Provides-Extra: jobs
34
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
35
+ Provides-Extra: envs
36
+ Requires-Dist: qbraid-core[environments]; extra == "envs"
35
37
  Provides-Extra: dev
36
- Requires-Dist: ruff; extra == "dev"
37
38
  Requires-Dist: isort; extra == "dev"
38
39
  Requires-Dist: black; extra == "dev"
39
40
  Requires-Dist: pytest; extra == "dev"
@@ -141,7 +142,7 @@ Options
141
142
 
142
143
  Commands
143
144
  configure Configure qBraid CLI options.
144
- credits Manage qBraid credits.
145
+ account Manage qBraid account.
145
146
  devices Manage qBraid quantum devices.
146
147
  envs Manage qBraid environments.
147
148
  jobs Manage qBraid quantum jobs.
@@ -7,7 +7,6 @@ MANIFEST.IN
7
7
  Makefile
8
8
  README.md
9
9
  pyproject.toml
10
- ruff.toml
11
10
  .github/PULL_REQUEST_TEMPLATE.md
12
11
  .github/ISSUE_TEMPLATE/bug_report.yml
13
12
  .github/ISSUE_TEMPLATE/feature_request.yml
@@ -23,30 +22,10 @@ docs/conf.py
23
22
  docs/index.rst
24
23
  docs/make.bat
25
24
  docs/requirements.txt
26
- docs/_static/api-key.png
27
25
  docs/_static/favicon.ico
28
26
  docs/_static/logo.png
29
- docs/_static/cards/jupyter.png
30
- docs/_static/cards/python.png
31
- docs/_static/cards/terminal.png
32
27
  docs/_static/style/custom.css
33
28
  docs/_static/style/s4defs-roles.css
34
- docs/cli/configure.rst
35
- docs/cli/credits.rst
36
- docs/cli/devices-list.rst
37
- docs/cli/devices.rst
38
- docs/cli/envs-activate.rst
39
- docs/cli/envs-list.rst
40
- docs/cli/envs-uninstall.rst
41
- docs/cli/envs.rst
42
- docs/cli/jobs-add.rst
43
- docs/cli/jobs-disable.rst
44
- docs/cli/jobs-enable.rst
45
- docs/cli/jobs-list.rst
46
- docs/cli/jobs.rst
47
- docs/cli/kernels.rst
48
- docs/cli/qbraid.rst
49
- docs/guide/overview.rst
50
29
  qbraid_cli/__init__.py
51
30
  qbraid_cli/_version.py
52
31
  qbraid_cli/exceptions.py
@@ -59,6 +38,8 @@ qbraid_cli.egg-info/dependency_links.txt
59
38
  qbraid_cli.egg-info/entry_points.txt
60
39
  qbraid_cli.egg-info/requires.txt
61
40
  qbraid_cli.egg-info/top_level.txt
41
+ qbraid_cli/account/__init__.py
42
+ qbraid_cli/account/app.py
62
43
  qbraid_cli/admin/__init__.py
63
44
  qbraid_cli/admin/app.py
64
45
  qbraid_cli/admin/headers.py
@@ -66,8 +47,6 @@ qbraid_cli/admin/validation.py
66
47
  qbraid_cli/configure/__init__.py
67
48
  qbraid_cli/configure/actions.py
68
49
  qbraid_cli/configure/app.py
69
- qbraid_cli/credits/__init__.py
70
- qbraid_cli/credits/app.py
71
50
  qbraid_cli/devices/__init__.py
72
51
  qbraid_cli/devices/app.py
73
52
  qbraid_cli/devices/validation.py
@@ -86,13 +65,13 @@ qbraid_cli/pip/__init__.py
86
65
  qbraid_cli/pip/app.py
87
66
  qbraid_cli/pip/hooks.py
88
67
  tests/__init__.py
68
+ tests/account/__init__.py
69
+ tests/account/test_account_credits.py
89
70
  tests/admin/test_headers.py
90
71
  tests/configure/__init__.py
91
72
  tests/configure/test_configure_prompt_for_config.py
92
73
  tests/configure/test_configure_set.py
93
74
  tests/configure/test_configure_validate_input.py
94
- tests/credits/__init__.py
95
- tests/credits/test_credits_value.py
96
75
  tests/devices/__init__.py
97
76
  tests/devices/test_devices_list.py
98
77
  tests/devices/test_devices_validations.py
@@ -1,13 +1,15 @@
1
1
  typer>=0.12.1
2
2
  rich>=10.11.0
3
- qbraid-core[environments]>=0.1.23
3
+ qbraid-core>=0.1.28
4
4
 
5
5
  [dev]
6
- ruff
7
6
  isort
8
7
  black
9
8
  pytest
10
9
  pytest-cov
11
10
 
11
+ [envs]
12
+ qbraid-core[environments]
13
+
12
14
  [jobs]
13
15
  amazon-braket-sdk>=1.48.1
@@ -0,0 +1,88 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Unit tests for the 'qbraid account credits' command.
6
+
7
+ """
8
+
9
+ from unittest.mock import patch
10
+
11
+ from typer.testing import CliRunner
12
+
13
+ from qbraid_cli.account import account_app
14
+
15
+ runner = CliRunner()
16
+
17
+
18
+ def test_account_credits_success():
19
+ """Test the 'qbraid account credts' command with a successful response."""
20
+ credits_value = 100.4573
21
+
22
+ class MockQbraidClient: # pylint: disable=too-few-public-methods
23
+ """Mock class for the QbraidClient."""
24
+
25
+ def user_credits_value(self):
26
+ """ "Mock user_credits_value method."""
27
+ return credits_value
28
+
29
+ with (
30
+ patch("qbraid_cli.handlers.run_progress_task") as mock_run_progress_task,
31
+ patch("qbraid_core.QbraidClient") as mock_qbraid_client,
32
+ ):
33
+ mock_response = credits_value
34
+ mock_qbraid_client.return_value = MockQbraidClient()
35
+
36
+ # Setup mock for run_progress_task to return the credits directly
37
+ mock_run_progress_task.return_value = mock_response
38
+
39
+ result = runner.invoke(account_app, ["credits"])
40
+
41
+ assert result.exit_code == 0
42
+ assert "qBraid credits remaining:" in result.output
43
+ assert str(credits_value) in result.output
44
+
45
+
46
+ def test_account_info_success():
47
+ """Test the 'qbraid account info' command with a successful response."""
48
+ mock_info = {
49
+ "_id": "123456789",
50
+ "userName": "mockUser",
51
+ "email": "mock@example.com",
52
+ "joinedDate": "2022-03-10T03:52:08.743Z",
53
+ "activePlan": "Free",
54
+ "organization": "qbraid",
55
+ "role": "guest",
56
+ }
57
+
58
+ class MockQbraidSession: # pylint: disable=too-few-public-methods
59
+ """Mock class for the QbraidSession."""
60
+
61
+ def get_user(self):
62
+ """ "Mock get_user method."""
63
+ return {
64
+ "_id": "123456789",
65
+ "userName": "mockUser",
66
+ "email": "mock@example.com",
67
+ "createdAt": "2022-03-10T03:52:08.743Z",
68
+ "activePlan": "Free",
69
+ "organization": "qbraid",
70
+ "role": "guest",
71
+ }
72
+
73
+ with (
74
+ patch("qbraid_cli.handlers.run_progress_task") as mock_run_progress_task,
75
+ patch("qbraid_core.QbraidSession") as mock_qbraid_session,
76
+ ):
77
+ mock_response = mock_info
78
+ mock_qbraid_session.return_value = MockQbraidSession()
79
+
80
+ # Setup mock for run_progress_task to return the user info directly
81
+ mock_run_progress_task.return_value = mock_response
82
+
83
+ result = runner.invoke(account_app, ["info"])
84
+
85
+ assert result.exit_code == 0
86
+ for key, value in mock_info.items():
87
+ assert key in result.output
88
+ assert str(value) in result.output
Binary file
@@ -1,60 +0,0 @@
1
- .. _cli_configure:
2
-
3
- qbraid configure
4
- =================
5
-
6
- Update or add qbraidrc config/credential values.
7
-
8
- .. code-block:: bash
9
-
10
- qbraid configure
11
-
12
-
13
- The qbraid configure command streamlines the setup of your qBraid CLI installation
14
- by allowing you to manage and save frequently used credentials and configurations directly
15
- from your preferred terminal. Upon executing ``qbraid configure``, the CLI will prompt you
16
- for necessary credentials and configuration details. Unless a specific profile is designated,
17
- these details are automatically stored under the ``[default]`` section in your local ``qbraidrc``
18
- file. This file is located in the ``.qbraid`` folder within your home directory.
19
-
20
-
21
- Examples
22
- ---------
23
-
24
- .. code-block:: console
25
-
26
- $ qbraid configure
27
- email [None]: contact@qbraid.com
28
- api-key [None]: 1234567890
29
-
30
-
31
- This input will result in the following configuration in ``~/.qbraid/qbraidrc``:
32
-
33
-
34
- .. code-block:: bash
35
-
36
- [default]
37
- url = https://api.qbraid.com/api
38
- email = contact@qbraid.com
39
- api-key = 1234567890
40
-
41
-
42
- .. image:: ../_static/api-key.png
43
- :align: right
44
- :width: 300px
45
- :alt: Access key
46
- :target: javascript:void(0);
47
-
48
- Get API key
49
- ---------------
50
-
51
- To use certain qBraid CLI and `qBraid-SDK <https://docs.qbraid.com/en/latest/sdk/overview.html>`_ features locally (outside of `qBraid Lab <https://docs.qbraid.com/projects/lab/en/latest/lab/overview.html>`_), you must add your account credentials.
52
- Use the following steps to retrieve your API key:
53
-
54
- 1. Create a qBraid account or log in to your existing account by visiting `account.qbraid.com <https://account.qbraid.com>`_.
55
-
56
- 2. Copy your API Key token from the left side of your `account page <https://account.qbraid.com>`_.
57
-
58
- .. seealso::
59
-
60
- - `qBraid User Guide: Account <https://docs.qbraid.com/projects/lab/en/latest/lab/account.html>`_