qbraid-cli 0.8.5a2__tar.gz → 0.8.7__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 (128) hide show
  1. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/main.yml +1 -1
  2. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/PKG-INFO +3 -2
  3. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/pyproject.toml +4 -5
  4. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/_version.py +2 -2
  5. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/admin/app.py +13 -3
  6. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/admin/headers.py +29 -5
  7. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/envs/app.py +3 -1
  8. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/jobs/app.py +3 -2
  9. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/jobs/toggle_braket.py +1 -0
  10. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/jobs/validation.py +1 -0
  11. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/kernels/app.py +3 -2
  12. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/pip/app.py +1 -0
  13. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/pip/hooks.py +1 -0
  14. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/PKG-INFO +3 -2
  15. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/SOURCES.txt +1 -1
  16. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/requires.txt +1 -1
  17. qbraid_cli-0.8.7/tests/admin/test_headers.py +158 -0
  18. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/devices/test_devices_list.py +0 -1
  19. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_list.py +0 -2
  20. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_validate_handle_state.py +0 -4
  21. qbraid_cli-0.8.5a2/qbraid_cli/admin/buildlogs.py +0 -114
  22. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.env.example +0 -0
  23. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  24. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  25. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  26. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/bump-version.yml +0 -0
  27. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/docs.yml +0 -0
  28. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/format.yml +0 -0
  29. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/pre-release.yml +0 -0
  30. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/publish.yml +0 -0
  31. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.github/workflows/tag-on-merge.yml +0 -0
  32. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.gitignore +0 -0
  33. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/.readthedocs.yml +0 -0
  34. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/CONTRIBUTING.md +0 -0
  35. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/LICENSE +0 -0
  36. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/MANIFEST.IN +0 -0
  37. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/Makefile +0 -0
  38. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/README.md +0 -0
  39. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/Makefile +0 -0
  40. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/api-key.png +0 -0
  41. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/cards/jupyter.png +0 -0
  42. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/cards/python.png +0 -0
  43. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/cards/terminal.png +0 -0
  44. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/favicon.ico +0 -0
  45. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/logo.png +0 -0
  46. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/style/custom.css +0 -0
  47. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/_static/style/s4defs-roles.css +0 -0
  48. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/configure.rst +0 -0
  49. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/credits.rst +0 -0
  50. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/devices-list.rst +0 -0
  51. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/devices.rst +0 -0
  52. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/envs-activate.rst +0 -0
  53. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/envs-list.rst +0 -0
  54. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/envs-uninstall.rst +0 -0
  55. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/envs.rst +0 -0
  56. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/jobs-add.rst +0 -0
  57. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/jobs-disable.rst +0 -0
  58. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/jobs-enable.rst +0 -0
  59. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/jobs-list.rst +0 -0
  60. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/jobs.rst +0 -0
  61. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/kernels.rst +0 -0
  62. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/cli/qbraid.rst +0 -0
  63. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/conf.py +0 -0
  64. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/guide/overview.rst +0 -0
  65. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/index.rst +0 -0
  66. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/make.bat +0 -0
  67. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/docs/requirements.txt +0 -0
  68. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/__init__.py +0 -0
  69. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/admin/__init__.py +0 -0
  70. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/admin/validation.py +0 -0
  71. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/configure/__init__.py +0 -0
  72. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/configure/actions.py +0 -0
  73. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/configure/app.py +0 -0
  74. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/credits/__init__.py +0 -0
  75. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/credits/app.py +0 -0
  76. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/devices/__init__.py +0 -0
  77. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/devices/app.py +0 -0
  78. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/devices/validation.py +0 -0
  79. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/envs/__init__.py +0 -0
  80. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/envs/activate.py +0 -0
  81. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/envs/create.py +0 -0
  82. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/envs/data_handling.py +0 -0
  83. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/exceptions.py +0 -0
  84. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/handlers.py +0 -0
  85. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/jobs/__init__.py +0 -0
  86. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/kernels/__init__.py +0 -0
  87. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/main.py +0 -0
  88. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/pip/__init__.py +0 -0
  89. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli/py.typed +0 -0
  90. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  91. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/entry_points.txt +0 -0
  92. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/qbraid_cli.egg-info/top_level.txt +0 -0
  93. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/ruff.toml +0 -0
  94. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/setup.cfg +0 -0
  95. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/__init__.py +0 -0
  96. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/configure/__init__.py +0 -0
  97. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/configure/test_configure_prompt_for_config.py +0 -0
  98. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/configure/test_configure_set.py +0 -0
  99. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/configure/test_configure_validate_input.py +0 -0
  100. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/credits/__init__.py +0 -0
  101. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/credits/test_credits_value.py +1 -1
  102. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/devices/__init__.py +0 -0
  103. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/devices/test_devices_validations.py +0 -0
  104. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/__init__.py +0 -0
  105. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_activate.py +0 -0
  106. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
  107. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_activate_print_command.py +0 -0
  108. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_activate_pyenv.py +0 -0
  109. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_list.py +0 -0
  110. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/envs/test_envs_remove.py +0 -0
  111. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/__init__.py +0 -0
  112. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_disable.py +0 -0
  113. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_enable.py +0 -0
  114. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_state.py +0 -0
  115. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_toggle_braket_confirm.py +0 -0
  116. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
  117. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_toggle_braket_enable.py +0 -0
  118. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
  119. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_validate_get_state.py +0 -0
  120. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/jobs/test_jobs_validate_library.py +0 -0
  121. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/kernels/__init__.py +0 -0
  122. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tests/kernels/test_kernels_list.py +0 -0
  123. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/bump_version.py +1 -1
  124. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/create_dev_build.sh +0 -0
  125. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/install_wheel_extras.sh +0 -0
  126. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/split_md.py +0 -0
  127. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/split_rst.py +0 -0
  128. {qbraid_cli-0.8.5a2 → qbraid_cli-0.8.7}/tools/stamp_pre_release.py +1 -1
@@ -72,7 +72,7 @@ jobs:
72
72
  QBRAID_API_KEY: ${{ secrets.QBRAID_API_KEY }}
73
73
  - name: Upload coverage to Codecov
74
74
  if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
75
- uses: codecov/codecov-action@v4.0.1
75
+ uses: codecov/codecov-action@v4.4.1
76
76
  with:
77
77
  token: ${{ secrets.CODECOV_TOKEN }}
78
78
  fail_ci_if_error: false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.5a2
3
+ Version: 0.8.7
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
@@ -23,12 +23,13 @@ Classifier: Programming Language :: Python :: 3.9
23
23
  Classifier: Programming Language :: Python :: 3.10
24
24
  Classifier: Programming Language :: Python :: 3.11
25
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
26
27
  Requires-Python: >=3.9
27
28
  Description-Content-Type: text/markdown
28
29
  License-File: LICENSE
29
30
  Requires-Dist: typer>=0.12.1
30
31
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: qbraid-core[environments]>=0.1.17
32
+ Requires-Dist: qbraid-core[environments]>=0.1.23
32
33
  Provides-Extra: jobs
33
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
34
35
  Provides-Extra: dev
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qbraid-cli"
7
- version = "0.8.5a2"
7
+ version = "0.8.7"
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" }]
@@ -25,11 +25,12 @@ classifiers = [
25
25
  "Programming Language :: Python :: 3.10",
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
28
29
  ]
29
30
  dependencies = [
30
31
  "typer>=0.12.1",
31
32
  "rich>=10.11.0",
32
- "qbraid-core[environments]>=0.1.17",
33
+ "qbraid-core[environments]>=0.1.23",
33
34
  ]
34
35
  requires-python = ">= 3.9"
35
36
 
@@ -77,9 +78,7 @@ testpaths = ["tests"]
77
78
  [tool.coverage.run]
78
79
  parallel = true
79
80
  source = ["qbraid_cli"]
80
- omit = [
81
- "**/qbraid_cli/admin/buildlogs.py"
82
- ]
81
+ omit = []
83
82
 
84
83
  [tool.coverage.report]
85
84
  show_missing = true
@@ -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+g9c5838a.d20240822'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g9c5838a.d20240822')
15
+ __version__ = version = '0.1.dev1+g49939c4'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1', 'g49939c4')
@@ -5,16 +5,17 @@
5
5
  Module defining commands in the 'qbraid admin' namespace.
6
6
 
7
7
  """
8
+
9
+ from typing import Optional
10
+
8
11
  import typer
9
12
 
10
- from qbraid_cli.admin.buildlogs import buildlogs_app
11
13
  from qbraid_cli.admin.headers import check_and_fix_headers
12
14
  from qbraid_cli.admin.validation import validate_header_type, validate_paths_exist
13
15
 
14
16
  admin_app = typer.Typer(
15
17
  help="CI/CD commands for qBraid maintainers.", pretty_exceptions_show_locals=False
16
18
  )
17
- admin_app.add_typer(buildlogs_app, name="buildlogs")
18
19
 
19
20
 
20
21
  @admin_app.command(name="headers")
@@ -35,12 +36,21 @@ def admin_headers(
35
36
  fix: bool = typer.Option(
36
37
  False, "--fix", "-f", help="Whether to fix the headers instead of just verifying."
37
38
  ),
39
+ project_name: Optional[str] = typer.Option(
40
+ "the qBraid-SDK", "--project", "-p", help="Name of the project to use in the header."
41
+ ),
38
42
  ):
39
43
  """
40
44
  Verifies and optionally fixes qBraid headers in specified files and directories.
41
45
 
42
46
  """
43
- check_and_fix_headers(src_paths, header_type=header_type, skip_files=skip_files, fix=fix)
47
+ check_and_fix_headers(
48
+ src_paths,
49
+ header_type=header_type,
50
+ skip_files=skip_files,
51
+ fix=fix,
52
+ project_name=project_name,
53
+ )
44
54
 
45
55
 
46
56
  if __name__ == "__main__":
@@ -5,6 +5,7 @@
5
5
  Script to verify qBraid copyright file headers
6
6
 
7
7
  """
8
+
8
9
  import os
9
10
  from typing import Optional
10
11
 
@@ -21,13 +22,13 @@ DEFAULT_HEADER = """# Copyright (c) 2024, qBraid Development Team
21
22
 
22
23
  DEFAULT_HEADER_GPL = """# Copyright (C) 2024 qBraid
23
24
  #
24
- # This file is part of the qBraid-SDK
25
+ # This file is part of {project_name}
25
26
  #
26
- # The qBraid-SDK is free software released under the GNU General Public License v3
27
+ # {project_name_start} is free software released under the GNU General Public License v3
27
28
  # or later. You can redistribute and/or modify it under the terms of the GPL v3.
28
29
  # See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>.
29
30
  #
30
- # THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3.
31
+ # THERE IS NO WARRANTY for {project_name}, as per Section 15 of the GPL v3.
31
32
  """
32
33
 
33
34
  HEADER_TYPES = {
@@ -36,15 +37,35 @@ HEADER_TYPES = {
36
37
  }
37
38
 
38
39
 
40
+ def get_formatted_header(header_type: str, project_name: str) -> str:
41
+ """Get the formatted header based on the header type
42
+
43
+ Args:
44
+ header_type (str): The type of header to use.
45
+ project_name (str): The name of the project to use in the header.
46
+
47
+ Returns:
48
+ str: The formatted header
49
+ """
50
+
51
+ header = HEADER_TYPES[header_type]
52
+ if header_type == "gpl":
53
+ return header.format(
54
+ project_name=project_name, project_name_start=project_name[0].upper() + project_name[1:]
55
+ )
56
+ return header
57
+
58
+
39
59
  def check_and_fix_headers(
40
60
  src_paths: list[str],
41
61
  header_type: str = "default",
42
62
  skip_files: Optional[list[str]] = None,
43
63
  fix: bool = False,
64
+ project_name: Optional[str] = None,
44
65
  ) -> None:
45
66
  """Script to add or verify qBraid copyright file headers"""
46
67
  try:
47
- header = HEADER_TYPES[header_type]
68
+ header = get_formatted_header(header_type, project_name)
48
69
  except KeyError:
49
70
  handle_error(
50
71
  error_type="ValueError",
@@ -139,7 +160,10 @@ def check_and_fix_headers(
139
160
  replace_or_add_header(item, fix)
140
161
  checked += 1
141
162
  else:
142
- handle_error(error_type="FileNotFoundError", message=f"Path '{item}' does not exist.")
163
+ if not os.path.isfile(item):
164
+ handle_error(
165
+ error_type="FileNotFoundError", message=f"Path '{item}' does not exist."
166
+ )
143
167
 
144
168
  if checked == 0:
145
169
  console.print("[bold]No Python files present. Nothing to do[/bold] 😴")
@@ -241,7 +241,9 @@ def envs_list():
241
241
 
242
242
  @envs_app.command(name="activate")
243
243
  def envs_activate(
244
- name: str = typer.Argument(..., help="Name of the environment. Values from 'qbraid envs list'.")
244
+ name: str = typer.Argument(
245
+ ..., help="Name of the environment. Values from 'qbraid envs list'."
246
+ ),
245
247
  ):
246
248
  """Activate qBraid environment.
247
249
 
@@ -5,6 +5,7 @@
5
5
  Module defining commands in the 'qbraid jobs' namespace.
6
6
 
7
7
  """
8
+
8
9
  from typing import Any, Callable
9
10
 
10
11
  import typer
@@ -63,7 +64,7 @@ def jobs_state(
63
64
  default=None,
64
65
  help="Optional: Specify a software library with quantum jobs support to check its status.",
65
66
  callback=validate_library,
66
- )
67
+ ),
67
68
  ) -> None:
68
69
  """Display the state of qBraid Quantum Jobs for the current environment."""
69
70
  result: tuple[str, dict[str, tuple[bool, bool]]] = run_progress_get_state(library)
@@ -93,7 +94,7 @@ def jobs_state(
93
94
  def jobs_list(
94
95
  limit: int = typer.Option(
95
96
  10, "--limit", "-l", help="Limit the maximum number of results returned"
96
- )
97
+ ),
97
98
  ) -> None:
98
99
  """List qBraid Quantum Jobs."""
99
100
 
@@ -5,6 +5,7 @@
5
5
  Module supporting 'qbraid jobs enable/disable braket' and commands.
6
6
 
7
7
  """
8
+
8
9
  import logging
9
10
  import os
10
11
  import re
@@ -5,6 +5,7 @@
5
5
  Module for validating command arguments for qBraid Quantum Jobs.
6
6
 
7
7
  """
8
+
8
9
  import sys
9
10
  from typing import Any, Callable, Optional
10
11
 
@@ -5,6 +5,7 @@
5
5
  Module defining commands in the 'qbraid kernels' namespace.
6
6
 
7
7
  """
8
+
8
9
  import typer
9
10
  from rich.console import Console
10
11
 
@@ -55,7 +56,7 @@ def kernels_list():
55
56
  def kernels_add(
56
57
  environment: str = typer.Argument(
57
58
  ..., help="Name of environment for which to add ipykernel. Values from 'qbraid envs list'."
58
- )
59
+ ),
59
60
  ):
60
61
  """Add a kernel."""
61
62
  from qbraid_core.services.environments.kernels import add_kernels
@@ -77,7 +78,7 @@ def kernels_remove(
77
78
  environment: str = typer.Argument(
78
79
  ...,
79
80
  help=("Name of environment for which to remove ipykernel. Values from 'qbraid envs list'."),
80
- )
81
+ ),
81
82
  ):
82
83
  """Remove a kernel."""
83
84
  from qbraid_core.services.environments.kernels import remove_kernels
@@ -5,6 +5,7 @@
5
5
  Module defining commands in the 'qbraid pip' namespace.
6
6
 
7
7
  """
8
+
8
9
  import subprocess
9
10
  import sys
10
11
 
@@ -5,6 +5,7 @@
5
5
  Module defining pre- and post-command hooks for the 'qbraid pip' namespace.
6
6
 
7
7
  """
8
+
8
9
  import sys
9
10
  from pathlib import Path
10
11
  from typing import Optional, Union
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.5a2
3
+ Version: 0.8.7
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
@@ -23,12 +23,13 @@ Classifier: Programming Language :: Python :: 3.9
23
23
  Classifier: Programming Language :: Python :: 3.10
24
24
  Classifier: Programming Language :: Python :: 3.11
25
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
26
27
  Requires-Python: >=3.9
27
28
  Description-Content-Type: text/markdown
28
29
  License-File: LICENSE
29
30
  Requires-Dist: typer>=0.12.1
30
31
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: qbraid-core[environments]>=0.1.17
32
+ Requires-Dist: qbraid-core[environments]>=0.1.23
32
33
  Provides-Extra: jobs
33
34
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
34
35
  Provides-Extra: dev
@@ -61,7 +61,6 @@ qbraid_cli.egg-info/requires.txt
61
61
  qbraid_cli.egg-info/top_level.txt
62
62
  qbraid_cli/admin/__init__.py
63
63
  qbraid_cli/admin/app.py
64
- qbraid_cli/admin/buildlogs.py
65
64
  qbraid_cli/admin/headers.py
66
65
  qbraid_cli/admin/validation.py
67
66
  qbraid_cli/configure/__init__.py
@@ -87,6 +86,7 @@ qbraid_cli/pip/__init__.py
87
86
  qbraid_cli/pip/app.py
88
87
  qbraid_cli/pip/hooks.py
89
88
  tests/__init__.py
89
+ tests/admin/test_headers.py
90
90
  tests/configure/__init__.py
91
91
  tests/configure/test_configure_prompt_for_config.py
92
92
  tests/configure/test_configure_set.py
@@ -1,6 +1,6 @@
1
1
  typer>=0.12.1
2
2
  rich>=10.11.0
3
- qbraid-core[environments]>=0.1.17
3
+ qbraid-core[environments]>=0.1.23
4
4
 
5
5
  [dev]
6
6
  ruff
@@ -0,0 +1,158 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Unit tests for the `qbraid_cli.admin.app` module's `headers` command.
6
+
7
+ """
8
+ import os
9
+ import re
10
+
11
+ from typer.testing import CliRunner
12
+
13
+ from qbraid_cli.admin.app import admin_app
14
+ from qbraid_cli.admin.headers import DEFAULT_HEADER, get_formatted_header
15
+
16
+ runner = CliRunner()
17
+
18
+
19
+ def _get_test_file_path(test_type: str) -> str:
20
+ return os.path.join(os.path.dirname(__file__), f"test_{test_type}.py")
21
+
22
+
23
+ def _get_test_file(test_type: str) -> str:
24
+ # construct the file name
25
+ file_path = _get_test_file_path(test_type)
26
+
27
+ if test_type == "no_header":
28
+ with open(file_path, "w") as f:
29
+ f.write("print('hello world')")
30
+ elif test_type == "correct_header":
31
+ with open(file_path, "w") as f:
32
+ f.write(DEFAULT_HEADER + "\n\n" + "print('hello world')")
33
+ elif test_type == "old_header":
34
+ with open(file_path, "w") as f:
35
+ f.write("# This is an old header\n\n" + "print('hello world')")
36
+ else:
37
+ raise ValueError(f"Invalid test type: {test_type}")
38
+
39
+ return file_path
40
+
41
+
42
+ def _remove_test_file(test_type: str) -> None:
43
+ file_path = _get_test_file_path(test_type)
44
+ os.remove(file_path)
45
+
46
+
47
+ def strip_ansi_codes(text):
48
+ ansi_escape = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]")
49
+ return ansi_escape.sub("", text)
50
+
51
+
52
+ def _verify_result(result, expected_exit_code: int, expected_output: str):
53
+ assert expected_output in strip_ansi_codes(result.stdout)
54
+ assert result.exit_code == expected_exit_code
55
+
56
+
57
+ def test_header_fix_for_file_with_correct_header():
58
+ """Test that the header fix function does not change the file with the correct header."""
59
+ file_path = _get_test_file("correct_header")
60
+ original_content = open(file_path, "r").read()
61
+
62
+ result = runner.invoke(admin_app, [file_path, "--fix"])
63
+
64
+ _verify_result(result, 0, "1 file left unchanged")
65
+
66
+ # assert that the file has not been changed
67
+ with open(file_path, "r") as f:
68
+ assert f.read() == original_content
69
+
70
+ _remove_test_file("correct_header")
71
+
72
+
73
+ def test_header_fix_for_file_with_no_header():
74
+ """Test that the header fix function adds the new header to a file with no header."""
75
+ file_path = _get_test_file("no_header")
76
+
77
+ result = runner.invoke(admin_app, [file_path, "--fix"])
78
+
79
+ _verify_result(result, 0, "1 file fixed")
80
+
81
+ # assert that the file has the new header
82
+ with open(file_path, "r") as f:
83
+ assert f.read() == DEFAULT_HEADER + "\n" + "print('hello world')"
84
+
85
+ _remove_test_file("no_header")
86
+
87
+
88
+ def test_header_update_for_file_with_old_header():
89
+ """Test that the header fix function updates the header in a file with an old header."""
90
+ file_path = _get_test_file("old_header")
91
+
92
+ result = runner.invoke(admin_app, [file_path, "--fix", "-t", "gpl", "-p", "test_project"])
93
+
94
+ _verify_result(result, 0, "1 file fixed")
95
+
96
+ # assert that the file has the new header
97
+ with open(file_path, "r") as f:
98
+ assert (
99
+ f.read() == get_formatted_header("gpl", "test_project") + "\n" + "print('hello world')"
100
+ )
101
+
102
+ _remove_test_file("old_header")
103
+
104
+
105
+ def test_files_in_directory():
106
+ """Test that all files in a directory are fixed."""
107
+ test_files = ["no_header", "correct_header", "old_header"]
108
+ _ = [_get_test_file(test_file) for test_file in test_files]
109
+
110
+ result = runner.invoke(admin_app, [os.path.dirname(__file__), "--fix"])
111
+
112
+ _verify_result(result, 0, "2 files fixed")
113
+
114
+ for test_file in test_files:
115
+ _remove_test_file(test_file)
116
+
117
+
118
+ def test_invalid_path():
119
+ """Test that the header fix function returns an error for an invalid path."""
120
+ file_path = "invalid_path"
121
+
122
+ result = runner.invoke(admin_app, [file_path, "--fix"])
123
+
124
+ _verify_result(result, 2, f"Path '{file_path}' does not exist")
125
+
126
+
127
+ def test_invalid_header_types():
128
+ """Test that the header fix function returns an error for invalid header types."""
129
+ file_path = _get_test_file("no_header")
130
+
131
+ result = runner.invoke(admin_app, [file_path, "--fix", "-t", "invalid_header"])
132
+ _verify_result(result, 2, "Invalid value for '--type' / '-t'")
133
+ _remove_test_file("no_header")
134
+
135
+
136
+ def test_correct_identification_of_bad_headers():
137
+ """Test that the header fix function correctly identifies files with bad headers."""
138
+ file_path = _get_test_file("old_header")
139
+
140
+ result = runner.invoke(admin_app, [file_path])
141
+
142
+ _verify_result(result, 1, "would fix")
143
+
144
+ _remove_test_file("old_header")
145
+
146
+
147
+ def test_non_python_files_are_untouched():
148
+ """Test that the header fix function does not change non-Python files."""
149
+ non_python_file_path = os.path.join(os.path.dirname(__file__), "non_python_file.txt")
150
+
151
+ with open(non_python_file_path, "w") as f:
152
+ f.write("test")
153
+
154
+ result = runner.invoke(admin_app, [non_python_file_path, "--fix"])
155
+
156
+ _verify_result(result, 0, "No Python files present. Nothing to do")
157
+
158
+ os.remove(non_python_file_path)
@@ -81,7 +81,6 @@ def test_output_formatting_console():
81
81
  ),
82
82
  patch("rich.console.Console.print") as mock_console_print,
83
83
  ):
84
-
85
84
  devices_list()
86
85
 
87
86
  mock_console_print.assert_called()
@@ -34,7 +34,6 @@ def test_jobs_list_with_limit():
34
34
  patch("qbraid_core.services.quantum.process_job_data", return_value=mock_job_data),
35
35
  patch("rich.console.Console.print") as mock_console_print,
36
36
  ):
37
-
38
37
  jobs_list(limit=limit)
39
38
 
40
39
  assert mock_console_print.call_count >= len(
@@ -55,7 +54,6 @@ def test_jobs_list_output_formatting_console():
55
54
  patch("qbraid_core.services.quantum.process_job_data", return_value=mock_job_data),
56
55
  patch("rich.console.Console.print") as mock_console_print,
57
56
  ):
58
-
59
57
  jobs_list(limit=1)
60
58
 
61
59
  # Assuming here that if `Console.print` is called, formatting has been attempted
@@ -20,11 +20,9 @@ def test_handle_jobs_state_not_installed():
20
20
  "qbraid_cli.jobs.validation.run_progress_get_state",
21
21
  return_value=("/usr/local/bin/python", {"braket": (False, False)}),
22
22
  ):
23
-
24
23
  action_callback = MagicMock()
25
24
 
26
25
  with pytest.raises(typer.Exit):
27
-
28
26
  assert "Error" in handle_jobs_state("braket", "enable", action_callback).output
29
27
 
30
28
 
@@ -36,7 +34,6 @@ def test_handle_jobs_state_already_correct_state(mock_console_print):
36
34
  "qbraid_cli.jobs.validation.run_progress_get_state",
37
35
  return_value=("/usr/local/bin/python", {"braket": (True, True)}),
38
36
  ):
39
-
40
37
  action_callback = MagicMock()
41
38
 
42
39
  with pytest.raises(typer.Exit):
@@ -53,7 +50,6 @@ def test_handle_jobs_state_action_needed():
53
50
  "qbraid_cli.jobs.validation.run_progress_get_state",
54
51
  return_value=("/usr/local/bin/python", {"braket": (True, False)}),
55
52
  ):
56
-
57
53
  action_callback = MagicMock()
58
54
 
59
55
  with patch("rich.console.Console.print") as mock_console_print:
@@ -1,114 +0,0 @@
1
- # Copyright (c) 2024, qBraid Development Team
2
- # All rights reserved.
3
-
4
- """
5
- Module defining commands in the 'qbraid admin buildlogs' namespace.
6
-
7
- This module uses the Typer library to create CLI commands for managing Docker builds and logs
8
- in an administrative context.
9
- """
10
-
11
- import json
12
-
13
- import typer
14
- from qbraid_core.exceptions import RequestsApiError
15
- from qbraid_core.services.admin.client import AdminClient
16
- from rich.console import Console
17
-
18
- from qbraid_cli.handlers import handle_error
19
-
20
- buildlogs_app = typer.Typer(
21
- help="Manage qBraid containerized services logs.", pretty_exceptions_show_locals=False
22
- )
23
- console = Console()
24
-
25
-
26
- @buildlogs_app.command(name="get")
27
- def get_docker_build_logs(
28
- build_id: str = typer.Option(None, "--build_id", "-b", help="Name of the build ID")
29
- ) -> None:
30
- """
31
- Fetches and displays Docker build logs for a specified build ID.
32
-
33
- Args:
34
- build_id (str, optional): The unique identifier for the Docker build.
35
-
36
- This function queries the administrative backend to retrieve and display build logs.
37
- If a build ID is provided, it will retrieve and display logs specific to that build ID.
38
- If build ID not provided, fetches all logs.
39
- """
40
- client = AdminClient()
41
-
42
- build_log = client.get_docker_build_logs(build_id)
43
- if build_id and "buildLogs" in build_log and build_log["buildLogs"]:
44
- log_entry = build_log["buildLogs"][0]
45
- console.print(log_entry)
46
- else:
47
- console.print(build_log)
48
-
49
-
50
- @buildlogs_app.command(name="post")
51
- def post_docker_build_log(
52
- data: str = typer.Option(..., "--data", "-d", help="Data to post to Docker logs")
53
- ) -> None:
54
- """
55
- Posts a new Docker build log entry.
56
-
57
- Args:
58
- data (str): JSON string containing the data to be logged.
59
-
60
- This command converts a JSON string into a dictionary and sends it to the backend service
61
- to create a new Docker build log.
62
- """
63
- client = AdminClient()
64
-
65
- try:
66
- data_dict = json.loads(data)
67
- console.print(client.post_docker_build_logs(data_dict))
68
- except RequestsApiError:
69
- handle_error(message="Couldn't post a build_log.")
70
-
71
-
72
- @buildlogs_app.command(name="put")
73
- def put_docker_build_log(
74
- build_id: str = typer.Option(..., "--build_id", "-b", help="Name of the build ID"),
75
- data: str = typer.Option(..., "--data", "-d", help="Data to post to Docker logs"),
76
- ) -> None:
77
- """
78
- Updates an existing Docker build log entry by a given build ID.
79
-
80
- Args:
81
- build_id (str): The unique identifier of the Docker build to update.
82
- data (str): JSON string containing the updated data for the log.
83
-
84
- This command updates a Docker build log entry, identified by the provided build ID,
85
- with the new data provided in JSON format.
86
- """
87
- client = AdminClient()
88
-
89
- try:
90
- data_dict = json.loads(data)
91
- console.print(client.put_docker_build_logs(build_id, data_dict))
92
- except RequestsApiError:
93
- handle_error(message="Couldn't post a build_log.")
94
-
95
-
96
- @buildlogs_app.command(name="delete")
97
- def delete_docker_build_log(
98
- build_id: str = typer.Option(..., "--build_id", "-b", help="ID of the build log to delete")
99
- ) -> None:
100
- """
101
- Deletes a Docker build log entry by a specified build ID.
102
-
103
- Args:
104
- build_id (str): The unique identifier of the Docker build log to delete.
105
-
106
- This command sends a request to delete a Docker build log identified by the provided build ID.
107
- """
108
- client = AdminClient()
109
-
110
- console.print(client.delete_docker_build_logs(build_id))
111
-
112
-
113
- if __name__ == "__main__":
114
- buildlogs_app()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,6 +5,7 @@
5
5
  Unit tests for the 'qbraid credits value' command.
6
6
 
7
7
  """
8
+
8
9
  from unittest.mock import patch
9
10
 
10
11
  from typer.testing import CliRunner
@@ -29,7 +30,6 @@ def test_credits_value_success():
29
30
  patch("qbraid_cli.handlers.run_progress_task") as mock_run_progress_task,
30
31
  patch("qbraid_core.QbraidClient") as mock_qbraid_client,
31
32
  ):
32
-
33
33
  mock_response = credits_value
34
34
  mock_qbraid_client.return_value = MockQbraidClient()
35
35
 
@@ -5,6 +5,7 @@
5
5
  Script to bump the major, minor, or patch version in pyproject.toml.
6
6
 
7
7
  """
8
+
8
9
  import pathlib
9
10
  import sys
10
11
 
@@ -15,7 +16,6 @@ from qbraid_core.system.versions import (
15
16
  )
16
17
 
17
18
  if __name__ == "__main__":
18
-
19
19
  package_name = sys.argv[1]
20
20
  bump_type = sys.argv[2]
21
21
 
@@ -5,6 +5,7 @@
5
5
  Script for getting/bumping the next pre-release version.
6
6
 
7
7
  """
8
+
8
9
  import pathlib
9
10
  import re
10
11
  import sys
@@ -28,7 +29,6 @@ def replace_version_format(v: str) -> str:
28
29
 
29
30
 
30
31
  if __name__ == "__main__":
31
-
32
32
  package_name = sys.argv[1]
33
33
  root = pathlib.Path(__file__).parent.parent.resolve()
34
34
  version = get_prelease_version(root, package_name)