qbraid-cli 0.8.3__tar.gz → 0.8.4a0__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 (129) hide show
  1. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.gitignore +3 -0
  2. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/PKG-INFO +13 -14
  3. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/README.md +7 -6
  4. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/pyproject.toml +6 -8
  5. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/_version.py +2 -2
  6. qbraid_cli-0.8.4a0/qbraid_cli/envs/create.py +33 -0
  7. qbraid_cli-0.8.4a0/qbraid_cli/kernels/app.py +80 -0
  8. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/main.py +1 -1
  9. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/PKG-INFO +13 -14
  10. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/SOURCES.txt +0 -3
  11. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/requires.txt +1 -3
  12. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/kernels/test_kernels_list.py +34 -21
  13. qbraid_cli-0.8.3/qbraid_cli/envs/create.py +0 -61
  14. qbraid_cli-0.8.3/qbraid_cli/kernels/app.py +0 -117
  15. qbraid_cli-0.8.3/tests/envs/test_envs_create.py +0 -67
  16. qbraid_cli-0.8.3/tests/envs/test_envs_create_qbraid_env_assets.py +0 -79
  17. qbraid_cli-0.8.3/tests/envs/test_envs_create_validate_env_name.py +0 -69
  18. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.env.example +0 -0
  19. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  20. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  21. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  22. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/workflows/docs.yml +0 -0
  23. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/workflows/format.yml +0 -0
  24. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/workflows/main.yml +0 -0
  25. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/workflows/pre-release.yml +0 -0
  26. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.github/workflows/publish.yml +0 -0
  27. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/.readthedocs.yml +0 -0
  28. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/CONTRIBUTING.md +0 -0
  29. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/LICENSE +0 -0
  30. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/MANIFEST.IN +0 -0
  31. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/Makefile +0 -0
  32. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/Makefile +0 -0
  33. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/api-key.png +0 -0
  34. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/cards/jupyter.png +0 -0
  35. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/cards/python.png +0 -0
  36. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/cards/terminal.png +0 -0
  37. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/favicon.ico +0 -0
  38. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/logo.png +0 -0
  39. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/style/custom.css +0 -0
  40. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/_static/style/s4defs-roles.css +0 -0
  41. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/configure.rst +0 -0
  42. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/credits.rst +0 -0
  43. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/devices-list.rst +0 -0
  44. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/devices.rst +0 -0
  45. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/envs-activate.rst +0 -0
  46. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/envs-list.rst +0 -0
  47. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/envs-uninstall.rst +0 -0
  48. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/envs.rst +0 -0
  49. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/jobs-add.rst +0 -0
  50. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/jobs-disable.rst +0 -0
  51. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/jobs-enable.rst +0 -0
  52. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/jobs-list.rst +0 -0
  53. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/jobs.rst +0 -0
  54. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/kernels.rst +0 -0
  55. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/cli/qbraid.rst +0 -0
  56. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/conf.py +0 -0
  57. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/guide/overview.rst +0 -0
  58. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/index.rst +0 -0
  59. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/make.bat +0 -0
  60. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/docs/requirements.txt +0 -0
  61. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/__init__.py +0 -0
  62. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/admin/__init__.py +0 -0
  63. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/admin/app.py +0 -0
  64. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/admin/buildlogs.py +0 -0
  65. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/admin/headers.py +0 -0
  66. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/admin/validation.py +0 -0
  67. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/configure/__init__.py +0 -0
  68. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/configure/actions.py +0 -0
  69. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/configure/app.py +0 -0
  70. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/credits/__init__.py +0 -0
  71. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/credits/app.py +0 -0
  72. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/devices/__init__.py +0 -0
  73. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/devices/app.py +0 -0
  74. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/devices/validation.py +0 -0
  75. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/envs/__init__.py +0 -0
  76. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/envs/activate.py +0 -0
  77. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/envs/app.py +0 -0
  78. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/envs/data_handling.py +0 -0
  79. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/exceptions.py +0 -0
  80. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/handlers.py +0 -0
  81. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/jobs/__init__.py +0 -0
  82. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/jobs/app.py +0 -0
  83. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/jobs/toggle_braket.py +0 -0
  84. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/jobs/validation.py +0 -0
  85. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/kernels/__init__.py +0 -0
  86. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/pip/__init__.py +0 -0
  87. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/pip/app.py +0 -0
  88. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/pip/hooks.py +0 -0
  89. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli/py.typed +0 -0
  90. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  91. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/entry_points.txt +0 -0
  92. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/qbraid_cli.egg-info/top_level.txt +0 -0
  93. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/ruff.toml +0 -0
  94. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/setup.cfg +0 -0
  95. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/__init__.py +0 -0
  96. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/configure/__init__.py +0 -0
  97. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/configure/test_configure_prompt_for_config.py +0 -0
  98. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/configure/test_configure_set.py +0 -0
  99. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/configure/test_configure_validate_input.py +0 -0
  100. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/credits/__init__.py +0 -0
  101. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/credits/test_credits_value.py +0 -0
  102. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/devices/__init__.py +0 -0
  103. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/devices/test_devices_list.py +0 -0
  104. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/devices/test_devices_validations.py +0 -0
  105. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/__init__.py +0 -0
  106. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_activate.py +0 -0
  107. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
  108. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_activate_print_command.py +0 -0
  109. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_activate_pyenv.py +0 -0
  110. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_list.py +0 -0
  111. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/envs/test_envs_remove.py +0 -0
  112. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/__init__.py +0 -0
  113. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_disable.py +0 -0
  114. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_enable.py +0 -0
  115. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_list.py +0 -0
  116. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_state.py +0 -0
  117. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
  118. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
  119. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
  120. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
  121. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_validate_get_state.py +0 -0
  122. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
  123. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/jobs/test_jobs_validate_library.py +0 -0
  124. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tests/kernels/__init__.py +0 -0
  125. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tools/create_dev_build.sh +0 -0
  126. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tools/install_wheel_extras.sh +0 -0
  127. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tools/split_md.py +0 -0
  128. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tools/split_rst.py +0 -0
  129. {qbraid_cli-0.8.3 → qbraid_cli-0.8.4a0}/tools/stamp_pre_release.py +0 -0
@@ -3,6 +3,9 @@ __pycache__/
3
3
  *.py[cod]
4
4
  *$py.class
5
5
 
6
+ .DS_Store
7
+ .vscode
8
+
6
9
  # C extensions
7
10
  *.so
8
11
 
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.3
3
+ Version: 0.8.4a0
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://www.qbraid.com/
8
- Project-URL: Documentation, https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
9
- Project-URL: Bug Tracker, https://github.com/qBraid/qBraid-Lab/issues
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
11
+ Project-URL: Launch on Lab, https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/.git
12
12
  Keywords: qbraid,cli,quantum,cloud
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Developers
@@ -29,9 +29,7 @@ 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: jupyter_client<9.0.0,>=7.0.0
33
- Requires-Dist: ipykernel
34
- Requires-Dist: qbraid-core>=0.1.16
32
+ Requires-Dist: qbraid-core[environments]==0.1.17a0
35
33
  Provides-Extra: jobs
36
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
37
35
  Provides-Extra: dev
@@ -43,15 +41,16 @@ Requires-Dist: pytest-cov; extra == "dev"
43
41
 
44
42
  <img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
45
43
 
46
- [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html)
44
+ [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/cli/user-guide/overview)
47
45
  [![PyPI version](https://img.shields.io/pypi/v/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
48
46
  [![Python verions](https://img.shields.io/pypi/pyversions/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
49
47
  [![Downloads](https://static.pepy.tech/badge/qbraid-cli)](https://pepy.tech/project/qbraid-cli)
50
- [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/qBraid-Lab/issues)
48
+ [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/community/issues)
49
+ [![Stack Overflow](https://img.shields.io/badge/StackOverflow-qbraid-orange?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/qbraid)
51
50
 
52
51
  Command Line Interface for interacting with all parts of the qBraid platform.
53
52
 
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/projects/lab/en/latest/lab/overview.html) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/projects/lab/en/latest/lab/quantum_jobs.html), 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 AWS, all using qBraid credits, with no additional access keys required.
53
+ 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
54
 
56
55
  ## Getting Started
57
56
 
@@ -60,7 +59,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
60
59
  - [Launch qBraid Lab &rarr;](https://lab.qbraid.com/)
61
60
  - [Make an account &rarr;](https://account.qbraid.com/)
62
61
 
63
- For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/projects/lab/en/latest/lab/getting_started.html).
62
+ For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
64
63
 
65
64
  You can also install the qBraid-CLI from PyPI with:
66
65
 
@@ -102,7 +101,7 @@ $ qbraid
102
101
 
103
102
  - Use 'qbraid --version' to see the current version.
104
103
 
105
- Reference Docs: https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
104
+ Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
106
105
  ```
107
106
 
108
107
  A qBraid CLI command has the following structure:
@@ -157,7 +156,7 @@ $ qbraid --version
157
156
 
158
157
  ## Magic Commands
159
158
 
160
- You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/projects/lab/en/latest/lab/notebooks.html) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
159
+ 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
160
 
162
161
  ```bash
163
162
  $ 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
- [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html)
3
+ [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/cli/user-guide/overview)
4
4
  [![PyPI version](https://img.shields.io/pypi/v/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
5
5
  [![Python verions](https://img.shields.io/pypi/pyversions/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
6
6
  [![Downloads](https://static.pepy.tech/badge/qbraid-cli)](https://pepy.tech/project/qbraid-cli)
7
- [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/qBraid-Lab/issues)
7
+ [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/community/issues)
8
+ [![Stack Overflow](https://img.shields.io/badge/StackOverflow-qbraid-orange?logo=stackoverflow)](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/projects/lab/en/latest/lab/overview.html) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/projects/lab/en/latest/lab/quantum_jobs.html), 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 AWS, all using qBraid credits, with no additional access keys required.
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 &rarr;](https://lab.qbraid.com/)
18
19
  - [Make an account &rarr;](https://account.qbraid.com/)
19
20
 
20
- For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/projects/lab/en/latest/lab/getting_started.html).
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/projects/cli/en/stable/guide/overview.html
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/projects/lab/en/latest/lab/notebooks.html) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
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.3"
7
+ version = "0.8.4-alpha"
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,16 @@ classifiers = [
29
29
  dependencies = [
30
30
  "typer>=0.12.1",
31
31
  "rich>=10.11.0",
32
- "jupyter_client>=7.0.0,<9.0.0",
33
- "ipykernel",
34
- "qbraid-core>=0.1.16",
32
+ "qbraid-core[environments]==0.1.17a0",
35
33
  ]
36
34
  requires-python = ">= 3.9"
37
35
 
38
36
  [project.urls]
39
- Homepage = "https://www.qbraid.com/"
40
- Documentation = "https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html"
41
- "Bug Tracker" = "https://github.com/qBraid/qBraid-Lab/issues"
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"
41
+ "Launch on Lab" = "https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/.git"
44
42
 
45
43
  [project.optional-dependencies]
46
44
  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+gd2e0183'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1', 'gd2e0183')
15
+ __version__ = version = '0.1.dev1+g8412556'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g8412556')
@@ -0,0 +1,33 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module supporting 'qbraid envs create' command.
6
+
7
+ """
8
+ import json
9
+ import os
10
+ import shutil
11
+ import sys
12
+
13
+
14
+ def create_venv(*args, **kwargs) -> None:
15
+ """Create a python virtual environment for the qBraid environment."""
16
+ from qbraid_core.services.environments import create_local_venv
17
+
18
+ return create_local_venv(*args, **kwargs)
19
+
20
+
21
+ def update_state_json(*ags, **kwargs) -> None:
22
+ """Update the state.json file for the qBraid environment."""
23
+ from qbraid_core.services.environments.state import update_install_status
24
+
25
+ return update_install_status(*ags, **kwargs)
26
+
27
+
28
+ def create_qbraid_env_assets(slug: str, alias: str, kernel_name: str, slug_path: str) -> None:
29
+ """Create a qBraid environment including python venv, PS1 configs,
30
+ kernel resource files, and qBraid state.json."""
31
+ from qbraid_core.services.environments.create import create_qbraid_env_assets
32
+
33
+ return create_qbraid_env_assets(slug, alias, kernel_name, slug_path)
@@ -0,0 +1,80 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Module defining commands in the 'qbraid jobs' namespace.
6
+
7
+ """
8
+ from pathlib import Path
9
+
10
+ import typer
11
+ from qbraid_core.services.environments.kernels import add_kernels, list_kernels, remove_kernels
12
+ from rich.console import Console
13
+
14
+ from qbraid_cli.handlers import handle_error
15
+
16
+ kernels_app = typer.Typer(help="Manage qBraid kernels.")
17
+
18
+
19
+ @kernels_app.command(name="list")
20
+ def kernels_list():
21
+ """List all available kernels."""
22
+ console = Console()
23
+ # Get the list of kernelspecs
24
+ kernelspecs = list_kernels()
25
+
26
+ if len(kernelspecs) == 0:
27
+ console.print("No qBraid kernels are active.")
28
+ console.print("\nUse 'qbraid kernels add' to add a new kernel.")
29
+ return
30
+
31
+ longest_kernel_name = max(len(kernel_name) for kernel_name in kernelspecs)
32
+ spacing = longest_kernel_name + 10
33
+
34
+ console.print("# qbraid kernels:\n#\n")
35
+
36
+ # Ensure 'python3' kernel is printed first if it exists
37
+ default_kernel_name = "python3"
38
+ python3_kernel_info = kernelspecs.pop(default_kernel_name, None)
39
+ if python3_kernel_info:
40
+ console.print(f"{default_kernel_name.ljust(spacing)}{python3_kernel_info['resource_dir']}")
41
+ # print rest of the kernels
42
+ for kernel_name, kernel_info in sorted(kernelspecs.items()):
43
+ console.print(f"{kernel_name.ljust(spacing)}{kernel_info['resource_dir']}")
44
+
45
+
46
+ @kernels_app.command(name="add")
47
+ def kernels_add(
48
+ environment: str = typer.Argument(
49
+ ..., help="Name of environment for which to add ipykernel. Values from 'qbraid envs list'."
50
+ )
51
+ ):
52
+ """Add a kernel."""
53
+
54
+ try:
55
+ add_kernels(environment)
56
+ except ValueError as e:
57
+ handle_error(
58
+ message=e,
59
+ include_traceback=False,
60
+ )
61
+ return
62
+
63
+
64
+ @kernels_app.command(name="remove")
65
+ def kernels_remove(
66
+ environment: str = typer.Argument(
67
+ ...,
68
+ help=("Name of environment for which to remove ipykernel. Values from 'qbraid envs list'."),
69
+ )
70
+ ):
71
+ """Remove a kernel."""
72
+ try:
73
+ remove_kernels(environment)
74
+ except ValueError:
75
+ handle_error(message=f"Environment '{environment}' not found.", include_traceback=False)
76
+ return
77
+
78
+
79
+ if __name__ == "__main__":
80
+ 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/projects/cli/en/stable/guide/overview.html")
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,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.3
3
+ Version: 0.8.4a0
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://www.qbraid.com/
8
- Project-URL: Documentation, https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
9
- Project-URL: Bug Tracker, https://github.com/qBraid/qBraid-Lab/issues
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
11
+ Project-URL: Launch on Lab, https://account.qbraid.com/?gitHubUrl=https://github.com/qBraid/.git
12
12
  Keywords: qbraid,cli,quantum,cloud
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Developers
@@ -29,9 +29,7 @@ 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: jupyter_client<9.0.0,>=7.0.0
33
- Requires-Dist: ipykernel
34
- Requires-Dist: qbraid-core>=0.1.16
32
+ Requires-Dist: qbraid-core[environments]==0.1.17a0
35
33
  Provides-Extra: jobs
36
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
37
35
  Provides-Extra: dev
@@ -43,15 +41,16 @@ Requires-Dist: pytest-cov; extra == "dev"
43
41
 
44
42
  <img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
45
43
 
46
- [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html)
44
+ [![Documentation](https://img.shields.io/badge/Documentation-DF0982)](https://docs.qbraid.com/cli/user-guide/overview)
47
45
  [![PyPI version](https://img.shields.io/pypi/v/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
48
46
  [![Python verions](https://img.shields.io/pypi/pyversions/qbraid-cli.svg?color=blue)](https://pypi.org/project/qbraid-cli/)
49
47
  [![Downloads](https://static.pepy.tech/badge/qbraid-cli)](https://pepy.tech/project/qbraid-cli)
50
- [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/qBraid-Lab/issues)
48
+ [![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/qBraid/community/issues)
49
+ [![Stack Overflow](https://img.shields.io/badge/StackOverflow-qbraid-orange?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/qbraid)
51
50
 
52
51
  Command Line Interface for interacting with all parts of the qBraid platform.
53
52
 
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/projects/lab/en/latest/lab/overview.html) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/projects/lab/en/latest/lab/quantum_jobs.html), 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 AWS, all using qBraid credits, with no additional access keys required.
53
+ 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
54
 
56
55
  ## Getting Started
57
56
 
@@ -60,7 +59,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
60
59
  - [Launch qBraid Lab &rarr;](https://lab.qbraid.com/)
61
60
  - [Make an account &rarr;](https://account.qbraid.com/)
62
61
 
63
- For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/projects/lab/en/latest/lab/getting_started.html).
62
+ For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
64
63
 
65
64
  You can also install the qBraid-CLI from PyPI with:
66
65
 
@@ -102,7 +101,7 @@ $ qbraid
102
101
 
103
102
  - Use 'qbraid --version' to see the current version.
104
103
 
105
- Reference Docs: https://docs.qbraid.com/projects/cli/en/stable/guide/overview.html
104
+ Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
106
105
  ```
107
106
 
108
107
  A qBraid CLI command has the following structure:
@@ -157,7 +156,7 @@ $ qbraid --version
157
156
 
158
157
  ## Magic Commands
159
158
 
160
- You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/projects/lab/en/latest/lab/notebooks.html) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
159
+ 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
160
 
162
161
  ```bash
163
162
  $ qbraid configure magic
@@ -99,9 +99,6 @@ tests/envs/test_envs_activate.py
99
99
  tests/envs/test_envs_activate_find_shell_rc.py
100
100
  tests/envs/test_envs_activate_print_command.py
101
101
  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
102
  tests/envs/test_envs_list.py
106
103
  tests/envs/test_envs_remove.py
107
104
  tests/jobs/__init__.py
@@ -1,8 +1,6 @@
1
1
  typer>=0.12.1
2
2
  rich>=10.11.0
3
- jupyter_client<9.0.0,>=7.0.0
4
- ipykernel
5
- qbraid-core>=0.1.16
3
+ qbraid-core[environments]==0.1.17a0
6
4
 
7
5
  [dev]
8
6
  ruff
@@ -11,11 +11,15 @@ from unittest.mock import call, patch
11
11
  from qbraid_cli.kernels.app import kernels_list
12
12
 
13
13
 
14
- @patch("qbraid_cli.kernels.app.KernelSpecManager")
14
+ def mock_is_exe(path):
15
+ return path == "/path/to/bin/python3", "-m", "ipykernel_launcher", "-f", "test"
16
+
17
+
18
+ # @patch("jupyter_client.kernelspec.KernelSpecManager")
19
+ @patch("qbraid_cli.kernels.app.list_kernels", return_value={})
15
20
  @patch("qbraid_cli.kernels.app.Console")
16
- def test_kernels_list_no_active_kernels(mock_console, mock_kernel_spec_manager):
21
+ def test_kernels_list_no_active_kernels(mock_console, mock_list_kernels):
17
22
  """Test listing kernels when no kernels are active."""
18
- mock_kernel_spec_manager.return_value.get_all_specs.return_value = {}
19
23
 
20
24
  kernels_list()
21
25
 
@@ -24,43 +28,52 @@ def test_kernels_list_no_active_kernels(mock_console, mock_kernel_spec_manager):
24
28
  call("\nUse 'qbraid kernels add' to add a new kernel."),
25
29
  ]
26
30
  actual_calls = mock_console.return_value.print.call_args_list
31
+ print(actual_calls, "actual_calls")
27
32
  assert actual_calls == expected_calls
28
33
 
29
34
 
30
- @patch("qbraid_cli.kernels.app.KernelSpecManager")
35
+ @patch(
36
+ "qbraid_cli.kernels.app.list_kernels",
37
+ return_value={"python3": {"resource_dir": "/path/to/python3/kernel"}},
38
+ )
31
39
  @patch("qbraid_cli.kernels.app.Console")
32
- def test_kernels_list_default_python3_kernel_present(mock_console, mock_kernel_spec_manager):
40
+ def test_kernels_list_default_python3_kernel_present(mock_console, mock_list_kernels):
33
41
  """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
42
 
38
43
  kernels_list()
39
44
 
40
45
  expected_calls = [
41
- call("# qbraid kernels:\n#\n\n" "python3 /path/to/python3/kernel"),
46
+ call("# qbraid kernels:\n#\n"),
47
+ call("python3 /path/to/python3/kernel"),
42
48
  ]
43
49
  actual_calls = mock_console.return_value.print.call_args_list
44
50
  assert actual_calls == expected_calls
45
51
 
46
52
 
47
- @patch("qbraid_cli.kernels.app.KernelSpecManager")
53
+ @patch(
54
+ "qbraid_cli.kernels.app.list_kernels",
55
+ return_value={
56
+ "python3": {"resource_dir": "/path/to/python3/kernel"},
57
+ "another_kernel": {
58
+ "resource_dir": "/path/to/another/kernel",
59
+ "spec": {
60
+ "display_name": "Another Kernel",
61
+ "argv": ["/path/to/bin/python3", "-m", "ipykernel_launcher", "-f", "test"],
62
+ },
63
+ },
64
+ },
65
+ )
48
66
  @patch("qbraid_cli.kernels.app.Console")
49
- def test_kernels_list_multiple_kernels_available(mock_console, mock_kernel_spec_manager):
67
+ def test_kernels_list_multiple_kernels_available(mock_console, mock_list_kernels):
50
68
  """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
69
 
56
- kernels_list()
70
+ with patch("qbraid_core.services.environments.kernels.is_exe", mock_is_exe):
71
+ kernels_list()
57
72
 
58
73
  expected_calls = [
59
- call(
60
- "# qbraid kernels:\n#\n\n"
61
- "python3 /path/to/python3/kernel\n"
62
- "another_kernel /path/to/another/kernel"
63
- ),
74
+ call("# qbraid kernels:\n#\n"),
75
+ call("python3 /path/to/python3/kernel"),
76
+ call("another_kernel /path/to/another/kernel"),
64
77
  ]
65
78
  actual_calls = mock_console.return_value.print.call_args_list
66
79
  assert actual_calls == expected_calls
@@ -1,61 +0,0 @@
1
- # Copyright (c) 2024, qBraid Development Team
2
- # All rights reserved.
3
-
4
- """
5
- Module supporting 'qbraid envs create' command.
6
-
7
- """
8
- import json
9
- import os
10
- import shutil
11
- import sys
12
-
13
-
14
- def create_venv(*args, **kwargs) -> None:
15
- """Create a python virtual environment for the qBraid environment."""
16
- from qbraid_core.services.environments import create_local_venv
17
-
18
- return create_local_venv(*args, **kwargs)
19
-
20
-
21
- def update_state_json(*ags, **kwargs) -> None:
22
- """Update the state.json file for the qBraid environment."""
23
- from qbraid_core.services.environments.state import update_install_status
24
-
25
- return update_install_status(*ags, **kwargs)
26
-
27
-
28
- def create_qbraid_env_assets(slug: str, alias: str, kernel_name: str, slug_path: str) -> None:
29
- """Create a qBraid environment including python venv, PS1 configs,
30
- kernel resource files, and qBraid state.json."""
31
- from jupyter_client.kernelspec import KernelSpecManager
32
-
33
- local_resource_dir = os.path.join(slug_path, "kernels", f"python3_{slug}")
34
- os.makedirs(local_resource_dir, exist_ok=True)
35
-
36
- # create state.json
37
- update_state_json(slug_path, 0, 0, env_name=alias)
38
-
39
- # create kernel.json
40
- kernel_json_path = os.path.join(local_resource_dir, "kernel.json")
41
- kernel_spec_manager = KernelSpecManager()
42
- kernelspec_dict = kernel_spec_manager.get_all_specs()
43
- kernel_data = kernelspec_dict["python3"]["spec"]
44
- if sys.platform == "win32":
45
- python_exec_path = os.path.join(slug_path, "pyenv", "Scripts", "python.exe")
46
- else:
47
- python_exec_path = os.path.join(slug_path, "pyenv", "bin", "python")
48
- kernel_data["argv"][0] = python_exec_path
49
- kernel_data["display_name"] = kernel_name
50
- with open(kernel_json_path, "w", encoding="utf-8") as file:
51
- json.dump(kernel_data, file, indent=4)
52
-
53
- # copy logo files
54
- sys_resource_dir = kernelspec_dict["python3"]["resource_dir"]
55
- logo_files = ["logo-32x32.png", "logo-64x64.png", "logo-svg.svg"]
56
-
57
- for file in logo_files:
58
- sys_path = os.path.join(sys_resource_dir, file)
59
- loc_path = os.path.join(local_resource_dir, file)
60
- if os.path.isfile(sys_path):
61
- shutil.copy(sys_path, loc_path)