qbraid-cli 0.8.5__tar.gz → 0.8.5a0__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.5 → qbraid_cli-0.8.5a0}/PKG-INFO +2 -2
  2. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/pyproject.toml +5 -3
  3. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/_version.py +2 -2
  4. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/admin/app.py +7 -3
  5. qbraid_cli-0.8.5a0/qbraid_cli/admin/buildlogs.py +114 -0
  6. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/admin/headers.py +3 -3
  7. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/admin/validation.py +2 -1
  8. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/configure/actions.py +2 -2
  9. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/devices/app.py +3 -3
  10. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/envs/app.py +4 -4
  11. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/handlers.py +5 -5
  12. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/jobs/app.py +8 -10
  13. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/jobs/toggle_braket.py +24 -13
  14. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/jobs/validation.py +5 -5
  15. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/pip/hooks.py +1 -1
  16. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/PKG-INFO +2 -2
  17. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/SOURCES.txt +1 -0
  18. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/requires.txt +1 -1
  19. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_toggle_braket_confirm.py +1 -1
  20. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_toggle_braket_enable.py +11 -0
  21. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tools/create_dev_build.sh +2 -2
  22. qbraid_cli-0.8.5a0/tools/stamp_pre_release.py +18 -0
  23. qbraid_cli-0.8.5/tools/stamp_pre_release.py +0 -36
  24. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.env.example +0 -0
  25. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  26. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  27. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  28. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/bump-version.yml +0 -0
  29. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/docs.yml +0 -0
  30. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/format.yml +0 -0
  31. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/main.yml +0 -0
  32. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/pre-release.yml +0 -0
  33. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/publish.yml +0 -0
  34. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.github/workflows/tag-on-merge.yml +0 -0
  35. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.gitignore +0 -0
  36. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/.readthedocs.yml +0 -0
  37. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/CONTRIBUTING.md +0 -0
  38. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/LICENSE +0 -0
  39. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/MANIFEST.IN +0 -0
  40. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/Makefile +0 -0
  41. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/README.md +0 -0
  42. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/Makefile +0 -0
  43. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/api-key.png +0 -0
  44. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/cards/jupyter.png +0 -0
  45. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/cards/python.png +0 -0
  46. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/cards/terminal.png +0 -0
  47. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/favicon.ico +0 -0
  48. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/logo.png +0 -0
  49. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/style/custom.css +0 -0
  50. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/_static/style/s4defs-roles.css +0 -0
  51. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/configure.rst +0 -0
  52. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/credits.rst +0 -0
  53. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/devices-list.rst +0 -0
  54. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/devices.rst +0 -0
  55. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/envs-activate.rst +0 -0
  56. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/envs-list.rst +0 -0
  57. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/envs-uninstall.rst +0 -0
  58. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/envs.rst +0 -0
  59. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/jobs-add.rst +0 -0
  60. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/jobs-disable.rst +0 -0
  61. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/jobs-enable.rst +0 -0
  62. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/jobs-list.rst +0 -0
  63. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/jobs.rst +0 -0
  64. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/kernels.rst +0 -0
  65. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/cli/qbraid.rst +0 -0
  66. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/conf.py +0 -0
  67. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/guide/overview.rst +0 -0
  68. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/index.rst +0 -0
  69. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/make.bat +0 -0
  70. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/docs/requirements.txt +0 -0
  71. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/__init__.py +0 -0
  72. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/admin/__init__.py +0 -0
  73. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/configure/__init__.py +0 -0
  74. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/configure/app.py +0 -0
  75. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/credits/__init__.py +0 -0
  76. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/credits/app.py +0 -0
  77. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/devices/__init__.py +0 -0
  78. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/devices/validation.py +0 -0
  79. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/envs/__init__.py +0 -0
  80. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/envs/activate.py +0 -0
  81. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/envs/create.py +0 -0
  82. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/envs/data_handling.py +0 -0
  83. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/exceptions.py +0 -0
  84. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/jobs/__init__.py +0 -0
  85. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/kernels/__init__.py +0 -0
  86. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/kernels/app.py +0 -0
  87. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/main.py +0 -0
  88. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/pip/__init__.py +0 -0
  89. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/pip/app.py +0 -0
  90. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli/py.typed +0 -0
  91. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  92. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/entry_points.txt +0 -0
  93. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/qbraid_cli.egg-info/top_level.txt +0 -0
  94. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/ruff.toml +0 -0
  95. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/setup.cfg +0 -0
  96. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/__init__.py +0 -0
  97. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/configure/__init__.py +0 -0
  98. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/configure/test_configure_prompt_for_config.py +0 -0
  99. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/configure/test_configure_set.py +0 -0
  100. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/configure/test_configure_validate_input.py +0 -0
  101. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/credits/__init__.py +0 -0
  102. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/credits/test_credits_value.py +0 -0
  103. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/devices/__init__.py +0 -0
  104. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/devices/test_devices_list.py +0 -0
  105. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/devices/test_devices_validations.py +0 -0
  106. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/__init__.py +0 -0
  107. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_activate.py +0 -0
  108. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_activate_find_shell_rc.py +0 -0
  109. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_activate_print_command.py +0 -0
  110. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_activate_pyenv.py +0 -0
  111. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_list.py +0 -0
  112. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/envs/test_envs_remove.py +0 -0
  113. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/__init__.py +0 -0
  114. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_disable.py +0 -0
  115. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_enable.py +0 -0
  116. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_list.py +0 -0
  117. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_state.py +0 -0
  118. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_toggle_braket_disable.py +0 -0
  119. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_toggle_braket_get_data.py +0 -0
  120. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_validate_get_state.py +0 -0
  121. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_validate_handle_state.py +0 -0
  122. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/jobs/test_jobs_validate_library.py +0 -0
  123. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/kernels/__init__.py +0 -0
  124. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tests/kernels/test_kernels_list.py +0 -0
  125. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tools/bump_version.py +0 -0
  126. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tools/install_wheel_extras.sh +0 -0
  127. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tools/split_md.py +0 -0
  128. {qbraid_cli-0.8.5 → qbraid_cli-0.8.5a0}/tools/split_rst.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.5
3
+ Version: 0.8.5a0
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
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
29
  Requires-Dist: typer>=0.12.1
30
30
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: qbraid-core[environments]>=0.1.23
31
+ Requires-Dist: qbraid-core[environments]>=0.1.17
32
32
  Provides-Extra: jobs
33
33
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
34
34
  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.5"
7
+ version = "0.8.5-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,7 +29,7 @@ classifiers = [
29
29
  dependencies = [
30
30
  "typer>=0.12.1",
31
31
  "rich>=10.11.0",
32
- "qbraid-core[environments]>=0.1.23",
32
+ "qbraid-core[environments]>=0.1.17",
33
33
  ]
34
34
  requires-python = ">= 3.9"
35
35
 
@@ -77,7 +77,9 @@ testpaths = ["tests"]
77
77
  [tool.coverage.run]
78
78
  parallel = true
79
79
  source = ["qbraid_cli"]
80
- omit = []
80
+ omit = [
81
+ "**/qbraid_cli/admin/buildlogs.py"
82
+ ]
81
83
 
82
84
  [tool.coverage.report]
83
85
  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+gaaf2fca'
16
- __version_tuple__ = version_tuple = (0, 1, 'dev1', 'gaaf2fca')
15
+ __version__ = version = '0.1.dev1+gbba28a4'
16
+ __version_tuple__ = version_tuple = (0, 1, 'dev1', 'gbba28a4')
@@ -3,21 +3,25 @@
3
3
 
4
4
  """
5
5
  Module defining commands in the 'qbraid admin' namespace.
6
-
7
6
  """
7
+
8
+ from typing import List
9
+
8
10
  import typer
9
11
 
12
+ from qbraid_cli.admin.buildlogs import buildlogs_app
10
13
  from qbraid_cli.admin.headers import check_and_fix_headers
11
14
  from qbraid_cli.admin.validation import validate_header_type, validate_paths_exist
12
15
 
13
16
  admin_app = typer.Typer(
14
17
  help="CI/CD commands for qBraid maintainers.", pretty_exceptions_show_locals=False
15
18
  )
19
+ admin_app.add_typer(buildlogs_app, name="buildlogs")
16
20
 
17
21
 
18
22
  @admin_app.command(name="headers")
19
23
  def admin_headers(
20
- src_paths: list[str] = typer.Argument(
24
+ src_paths: List[str] = typer.Argument(
21
25
  ..., help="Source file or directory paths to verify.", callback=validate_paths_exist
22
26
  ),
23
27
  header_type: str = typer.Option(
@@ -27,7 +31,7 @@ def admin_headers(
27
31
  help="Type of header to use ('default' or 'gpl').",
28
32
  callback=validate_header_type,
29
33
  ),
30
- skip_files: list[str] = typer.Option(
34
+ skip_files: List[str] = typer.Option(
31
35
  [], "--skip", "-s", help="Files to skip during verification.", callback=validate_paths_exist
32
36
  ),
33
37
  fix: bool = typer.Option(
@@ -0,0 +1,114 @@
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()
@@ -6,7 +6,7 @@ Script to verify qBraid copyright file headers
6
6
 
7
7
  """
8
8
  import os
9
- from typing import Optional
9
+ from typing import List, Optional
10
10
 
11
11
  import typer
12
12
  from rich.console import Console
@@ -37,9 +37,9 @@ HEADER_TYPES = {
37
37
 
38
38
 
39
39
  def check_and_fix_headers(
40
- src_paths: list[str],
40
+ src_paths: List[str],
41
41
  header_type: str = "default",
42
- skip_files: Optional[list[str]] = None,
42
+ skip_files: Optional[List[str]] = None,
43
43
  fix: bool = False,
44
44
  ) -> None:
45
45
  """Script to add or verify qBraid copyright file headers"""
@@ -7,6 +7,7 @@ Module for validating command arguments for qBraid admin commands.
7
7
  """
8
8
 
9
9
  import os
10
+ from typing import List
10
11
 
11
12
  import typer
12
13
 
@@ -20,7 +21,7 @@ def validate_header_type(value: str) -> str:
20
21
  return validate_item(value, header_types, "Header type")
21
22
 
22
23
 
23
- def validate_paths_exist(paths: list[str]) -> list[str]:
24
+ def validate_paths_exist(paths: List[str]) -> List[str]:
24
25
  """Verifies that each path in the provided list exists."""
25
26
  non_existent_paths = [path for path in paths if not os.path.exists(path)]
26
27
  if non_existent_paths:
@@ -9,7 +9,7 @@ Module defining actions invoked by 'qbraid configure' command(s).
9
9
  import configparser
10
10
  import re
11
11
  from copy import deepcopy
12
- from typing import Optional
12
+ from typing import Dict, Optional
13
13
 
14
14
  import typer
15
15
  from qbraid_core.config import (
@@ -53,7 +53,7 @@ def prompt_for_config(
53
53
  config: configparser.ConfigParser,
54
54
  section: str,
55
55
  key: str,
56
- default_values: Optional[dict[str, str]] = None,
56
+ default_values: Optional[Dict[str, str]] = None,
57
57
  ) -> str:
58
58
  """Prompt the user for a configuration setting, showing the current value as default."""
59
59
  default_values = default_values or {}
@@ -6,7 +6,7 @@ Module defining commands in the 'qbraid devices' namespace.
6
6
 
7
7
  """
8
8
 
9
- from typing import Any, Callable, Optional
9
+ from typing import Any, Callable, Optional, Tuple
10
10
 
11
11
  import typer
12
12
  from rich.console import Console
@@ -42,14 +42,14 @@ def devices_list( # pylint: disable=too-many-branches
42
42
  if provider:
43
43
  filters["provider"] = provider
44
44
 
45
- def import_devices() -> tuple[Any, Callable]:
45
+ def import_devices() -> Tuple[Any, Callable]:
46
46
  from qbraid_core.services.quantum import QuantumClient, process_device_data
47
47
 
48
48
  client = QuantumClient()
49
49
 
50
50
  return client, process_device_data
51
51
 
52
- result: tuple[Callable, Callable] = run_progress_task(import_devices)
52
+ result: Tuple[Callable, Callable] = run_progress_task(import_devices)
53
53
  client, process_device_data = result
54
54
  raw_data = client.search_devices(filters)
55
55
  device_data, msg = process_device_data(raw_data)
@@ -10,7 +10,7 @@ import shutil
10
10
  import subprocess
11
11
  import sys
12
12
  from pathlib import Path
13
- from typing import TYPE_CHECKING, Optional
13
+ from typing import TYPE_CHECKING, Optional, Tuple
14
14
 
15
15
  import typer
16
16
  from rich.console import Console
@@ -41,14 +41,14 @@ def envs_create( # pylint: disable=too-many-statements
41
41
  """Create a new qBraid environment."""
42
42
  env_description = description or ""
43
43
 
44
- def create_environment(*args, **kwargs) -> "tuple[dict, EMC]":
44
+ def create_environment(*args, **kwargs) -> "Tuple[dict, EMC]":
45
45
  """Create a qBraid environment."""
46
46
  from qbraid_core.services.environments.client import EnvironmentManagerClient
47
47
 
48
48
  client = EnvironmentManagerClient()
49
49
  return client.create_environment(*args, **kwargs), client
50
50
 
51
- def gather_local_data() -> tuple[Path, str]:
51
+ def gather_local_data() -> Tuple[Path, str]:
52
52
  """Gather environment data and return the slug."""
53
53
  from qbraid_core.services.environments import get_default_envs_paths
54
54
 
@@ -155,7 +155,7 @@ def envs_remove(
155
155
  emc = EnvironmentManagerClient()
156
156
  emc.delete_environment(slug)
157
157
 
158
- def gather_local_data(env_name: str) -> tuple[Path, str]:
158
+ def gather_local_data(env_name: str) -> Tuple[Path, str]:
159
159
  """Get environment path and slug from name (alias)."""
160
160
  installed, aliases = installed_envs_data()
161
161
  for alias, slug in aliases.items():
@@ -10,7 +10,7 @@ and executing operations with progress tracking within the qBraid CLI.
10
10
  import os
11
11
  import traceback
12
12
  from pathlib import Path
13
- from typing import Any, Callable, Optional, Union
13
+ from typing import Any, Callable, List, Optional, Union
14
14
 
15
15
  import typer
16
16
  from rich.console import Console
@@ -136,13 +136,13 @@ def run_progress_task(
136
136
  return handle_error(message=custom_message)
137
137
 
138
138
 
139
- def _format_list_items(items: list[str]) -> str:
139
+ def _format_list_items(items: List[str]) -> str:
140
140
  """
141
141
  Formats a list of items as a string with values comma-separated and
142
142
  each item surrounded by single quotes
143
143
 
144
144
  Args:
145
- items (list[str]): The list of items to format.
145
+ items (List[str]): The list of items to format.
146
146
 
147
147
  Returns:
148
148
  str: The formatted string.
@@ -151,14 +151,14 @@ def _format_list_items(items: list[str]) -> str:
151
151
 
152
152
 
153
153
  def validate_item(
154
- value: Optional[str], allowed_items: list[str], item_type: str
154
+ value: Optional[str], allowed_items: List[str], item_type: str
155
155
  ) -> Union[str, None]:
156
156
  """
157
157
  Generic item validation function.
158
158
 
159
159
  Args:
160
160
  value (optional, str): The value to validate.
161
- allowed_items (list[str]): A list of allowed items.
161
+ allowed_items (List[str]): A list of allowed items.
162
162
  item_type (str): A description of the item type (e.g., 'provider', 'status', 'type') for
163
163
  error messages.
164
164
 
@@ -5,7 +5,7 @@
5
5
  Module defining commands in the 'qbraid jobs' namespace.
6
6
 
7
7
  """
8
- from typing import Any, Callable
8
+ from typing import Any, Callable, Dict, Tuple
9
9
 
10
10
  import typer
11
11
  from rich.console import Console
@@ -66,7 +66,7 @@ def jobs_state(
66
66
  )
67
67
  ) -> None:
68
68
  """Display the state of qBraid Quantum Jobs for the current environment."""
69
- result: tuple[str, dict[str, tuple[bool, bool]]] = run_progress_get_state(library)
69
+ result: Tuple[str, Dict[str, Tuple[bool, bool]]] = run_progress_get_state(library)
70
70
  python_exe, state_values = result
71
71
  state_values = dict(sorted(state_values.items()))
72
72
 
@@ -75,18 +75,16 @@ def jobs_state(
75
75
  max_lib_length = max((len(lib) for lib in state_values.keys()), default=len(header_1))
76
76
  padding = max_lib_length + 9
77
77
 
78
- output = ""
78
+ console.print(f"Executable: {python_exe}")
79
+ console.print(f"\n{header_1:<{padding}}{header_2}", style="bold")
80
+
79
81
  for lib, (installed, enabled) in state_values.items():
80
82
  state_str = (
81
83
  "[green]enabled"
82
84
  if enabled and installed
83
85
  else "[red]disabled" if installed else "[grey70]unavailable"
84
86
  )
85
- output += f"{lib:<{padding-1}} {state_str}\n"
86
-
87
- console.print(f"Executable: {python_exe}")
88
- console.print(f"\n{header_1:<{padding}}{header_2}", style="bold")
89
- console.print(output)
87
+ console.print(f"{lib:<{padding-1}}", state_str, end="\n")
90
88
 
91
89
 
92
90
  @jobs_app.command(name="list")
@@ -97,14 +95,14 @@ def jobs_list(
97
95
  ) -> None:
98
96
  """List qBraid Quantum Jobs."""
99
97
 
100
- def import_jobs() -> tuple[Any, Callable]:
98
+ def import_jobs() -> Tuple[Any, Callable]:
101
99
  from qbraid_core.services.quantum import QuantumClient, process_job_data
102
100
 
103
101
  client = QuantumClient()
104
102
 
105
103
  return client, process_job_data
106
104
 
107
- result: tuple[Any, Callable] = run_progress_task(import_jobs)
105
+ result: Tuple[Any, Callable] = run_progress_task(import_jobs)
108
106
  client, process_job_data = result
109
107
  # https://github.com/qBraid/api/issues/644
110
108
  # raw_data = client.search_jobs(query={"numResults": limit})
@@ -10,7 +10,7 @@ import os
10
10
  import re
11
11
  import subprocess
12
12
  from pathlib import Path
13
- from typing import Optional
13
+ from typing import Optional, Tuple
14
14
 
15
15
  import requests
16
16
  import typer
@@ -34,14 +34,14 @@ def fetch_botocore_version() -> Optional[str]:
34
34
  return None
35
35
 
36
36
 
37
- def get_package_data(package: str) -> tuple[str, str, str, str]:
37
+ def get_package_data(package: str) -> Tuple[str, str, str, str]:
38
38
  """Retrieve package version and location data.
39
39
 
40
40
  Args:
41
41
  package (str): The name of the package to retrieve data for.
42
42
 
43
43
  Returns:
44
- tuple[str, str, str, str]: The installed and latest versions of the package, and the
44
+ Tuple[str, str, str, str]: The installed and latest versions of the package, and the
45
45
  local site-packages path where it is / would be installed.
46
46
 
47
47
  Raises:
@@ -60,7 +60,7 @@ def get_package_data(package: str) -> tuple[str, str, str, str]:
60
60
  installed_version = get_local_package_version(package, python_path=python_pathlib)
61
61
 
62
62
  latest_version = None
63
- if package in ["botocore", "boto3"]:
63
+ if package == "botocore":
64
64
  latest_version = fetch_botocore_version()
65
65
  latest_version = latest_version or get_latest_package_version(package)
66
66
 
@@ -74,7 +74,7 @@ def confirm_updates(
74
74
  mode: str,
75
75
  site_packages_path: str,
76
76
  installed_version: Optional[str] = None,
77
- target_version: Optional[str] = None,
77
+ latest_version: Optional[str] = None,
78
78
  ) -> None:
79
79
  """
80
80
  Prompts the user to proceed with enabling or disabling qBraid Quantum Jobs.
@@ -84,7 +84,7 @@ def confirm_updates(
84
84
  site_packages_path (str): The location of the site-packages directory where
85
85
  target package(s) will be updated.
86
86
  installed_version (optional, str): The installed version of the target package.
87
- target_version (optional, str): The latest version of the target package available on PyPI.
87
+ latest_version (optional, str): The latest version of the target package available on PyPI.
88
88
 
89
89
  Raises:
90
90
  ValueError: If an invalid mode is provided.
@@ -105,12 +105,12 @@ def confirm_updates(
105
105
  typer.echo(f"\n==> WARNING: {provider}/{core_package} package required <==")
106
106
  if (
107
107
  installed_version is not None
108
- and target_version is not None
109
- and installed_version != target_version
108
+ and latest_version is not None
109
+ and installed_version != latest_version
110
110
  ):
111
- typer.echo(f"==> WARNING: A different version of {versioned_package} is required. <==")
111
+ typer.echo(f"==> WARNING: A newer version of {versioned_package} exists. <==")
112
112
  typer.echo(f" current version: {installed_version}")
113
- typer.echo(f" target version: {target_version}")
113
+ typer.echo(f" latest version: {latest_version}")
114
114
 
115
115
  gerund = mode[:-2].capitalize() + "ing"
116
116
 
@@ -146,18 +146,29 @@ def aws_configure_dummy() -> None:
146
146
 
147
147
  def enable_braket(auto_confirm: bool = False):
148
148
  """Enable qBraid quantum jobs for Amazon Braket."""
149
- installed, target, path, python_exe = run_progress_task(
149
+ installed, latest, path, python_exe = run_progress_task(
150
150
  get_package_data, "boto3", description="Solving environment..."
151
151
  )
152
152
 
153
153
  if not auto_confirm:
154
- confirm_updates("enable", path, installed_version=installed, target_version=target)
154
+ confirm_updates("enable", path, installed_version=installed, latest_version=latest)
155
155
  typer.echo("")
156
156
 
157
157
  aws_configure_dummy() # TODO: possibly add another confirmation for writing aws config files
158
158
 
159
159
  try:
160
- subprocess.check_call([python_exe, "-m", "pip", "install", f"boto3=={target}"])
160
+ subprocess.check_call(
161
+ [
162
+ python_exe,
163
+ "-m",
164
+ "pip",
165
+ "install",
166
+ "amazon-braket-sdk",
167
+ "--upgrade",
168
+ "--upgrade-strategy eager",
169
+ ]
170
+ )
171
+ subprocess.check_call([python_exe, "-m", "pip", "install", f"boto3=={latest}"])
161
172
  subprocess.check_call([python_exe, "-m", "pip", "uninstall", "botocore", "-y", "--quiet"])
162
173
  subprocess.check_call(
163
174
  [python_exe, "-m", "pip", "install", "git+https://github.com/qBraid/botocore.git"]
@@ -6,14 +6,14 @@ Module for validating command arguments for qBraid Quantum Jobs.
6
6
 
7
7
  """
8
8
  import sys
9
- from typing import Any, Callable, Optional
9
+ from typing import Any, Callable, Dict, Optional, Tuple
10
10
 
11
11
  import typer
12
12
  from rich.console import Console
13
13
 
14
14
  from qbraid_cli.handlers import handle_error, run_progress_task, validate_item
15
15
 
16
- LEGACY_ARGS: dict[str, str] = {
16
+ LEGACY_ARGS: Dict[str, str] = {
17
17
  "amazon_braket": "braket",
18
18
  "aws_braket": "braket",
19
19
  }
@@ -39,14 +39,14 @@ def validate_library(value: str) -> str:
39
39
  return validate_item(value, qjobs_libs, "Library")
40
40
 
41
41
 
42
- def get_state(library: Optional[str] = None) -> tuple[str, dict[str, tuple[bool, bool]]]:
42
+ def get_state(library: Optional[str] = None) -> Tuple[str, Dict[str, Tuple[bool, bool]]]:
43
43
  """Get the state of qBraid Quantum Jobs for the specified library."""
44
44
  from qbraid_core.services.quantum import QuantumClient
45
45
 
46
46
  jobs_state = QuantumClient.qbraid_jobs_state(device_lib=library)
47
47
 
48
48
  python_exe: str = jobs_state.get("exe", sys.executable)
49
- libs_state: dict[str, Any] = jobs_state.get("libs", {})
49
+ libs_state: Dict[str, Any] = jobs_state.get("libs", {})
50
50
 
51
51
  state_values = {
52
52
  lib: (state["supported"], state["enabled"]) for lib, state in libs_state.items()
@@ -57,7 +57,7 @@ def get_state(library: Optional[str] = None) -> tuple[str, dict[str, tuple[bool,
57
57
 
58
58
  def run_progress_get_state(
59
59
  library: Optional[str] = None,
60
- ) -> tuple[str, dict[str, tuple[bool, bool]]]:
60
+ ) -> Tuple[str, Dict[str, Tuple[bool, bool]]]:
61
61
  """Run get state function with rich progress UI."""
62
62
  return run_progress_task(
63
63
  get_state,
@@ -36,7 +36,7 @@ def find_matching_prefix(python_executable: Path, path_list: list[Path]) -> Opti
36
36
 
37
37
  Args:
38
38
  python_executable (Path): The path to the Python executable.
39
- path_list (list[Path]): A list of paths to check against the Python executable path.
39
+ path_list (List[Path]): A list of paths to check against the Python executable path.
40
40
 
41
41
  Returns:
42
42
  Optional[Path]: The first matching path that is a prefix of the Python executable path,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qbraid-cli
3
- Version: 0.8.5
3
+ Version: 0.8.5a0
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
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
29
  Requires-Dist: typer>=0.12.1
30
30
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: qbraid-core[environments]>=0.1.23
31
+ Requires-Dist: qbraid-core[environments]>=0.1.17
32
32
  Provides-Extra: jobs
33
33
  Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
34
34
  Provides-Extra: dev
@@ -61,6 +61,7 @@ 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
64
65
  qbraid_cli/admin/headers.py
65
66
  qbraid_cli/admin/validation.py
66
67
  qbraid_cli/configure/__init__.py
@@ -1,6 +1,6 @@
1
1
  typer>=0.12.1
2
2
  rich>=10.11.0
3
- qbraid-core[environments]>=0.1.23
3
+ qbraid-core[environments]>=0.1.17
4
4
 
5
5
  [dev]
6
6
  ruff
@@ -49,4 +49,4 @@ def test_version_warning():
49
49
  latest_version = "1.2.0"
50
50
  with patch("typer.echo") as mock_echo, patch("typer.confirm", return_value=True):
51
51
  confirm_updates("enable", "/fake/site-packages", installed_version, latest_version)
52
- mock_echo.assert_any_call("==> WARNING: A different version of boto3 is required. <==")
52
+ mock_echo.assert_any_call("==> WARNING: A newer version of boto3 exists. <==")
@@ -52,6 +52,17 @@ def test_subprocess_calls():
52
52
 
53
53
  # Expected subprocess calls in order
54
54
  expected_calls = [
55
+ call(
56
+ [
57
+ mock_python_path,
58
+ "-m",
59
+ "pip",
60
+ "install",
61
+ "amazon-braket-sdk",
62
+ "--upgrade",
63
+ "--upgrade-strategy eager",
64
+ ]
65
+ ),
55
66
  call([mock_python_path, "-m", "pip", "install", f"boto3=={version}"]),
56
67
  call([mock_python_path, "-m", "pip", "uninstall", "botocore", "-y", "--quiet"]),
57
68
  call(
@@ -73,7 +73,7 @@ fi
73
73
 
74
74
  # Update the version in the version file
75
75
  echo "Setting version to ${DEV_VERSION}"
76
- toml set --toml-path "$PYPROJECT_TOML_PATH" "project.version" "$DEV_VERSION"
76
+ toml set "$PYPROJECT_TOML_PATH" "project.version" "$DEV_VERSION" > tmp.$$.toml && mv tmp.$$.toml "$PYPROJECT_TOML_PATH"
77
77
 
78
78
  # Check if `build` module is installed
79
79
  if ! python -c "import build" 2>/dev/null; then
@@ -85,4 +85,4 @@ fi
85
85
  echo "Building the project..."
86
86
  python -m build --outdir "${OUT_DIR}"
87
87
 
88
- echo "Done."
88
+ echo "Done."
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2024, qBraid Development Team
2
+ # All rights reserved.
3
+
4
+ """
5
+ Script for getting/bumping the next pre-release version.
6
+
7
+ """
8
+ import pathlib
9
+ import sys
10
+
11
+ from qbraid_core.system.versions import get_prelease_version
12
+
13
+ if __name__ == "__main__":
14
+
15
+ package_name = sys.argv[1]
16
+ root = pathlib.Path(__file__).parent.parent.resolve()
17
+ version = get_prelease_version(root, package_name)
18
+ print(version)
@@ -1,36 +0,0 @@
1
- # Copyright (c) 2024, qBraid Development Team
2
- # All rights reserved.
3
-
4
- """
5
- Script for getting/bumping the next pre-release version.
6
-
7
- """
8
- import pathlib
9
- import re
10
- import sys
11
-
12
- from qbraid_core.system.versions import get_prelease_version
13
-
14
-
15
- def replace_version_format(v: str) -> str:
16
- """
17
- Replace the version format from "x.y.z-abc.def" to "x.y.zabcdef".
18
-
19
- Args:
20
- v (str): The version string to transform.
21
-
22
- Returns:
23
- str: The transformed version string.
24
- """
25
- pattern = r"-(\w+)\.(\d+)"
26
- new_version = re.sub(pattern, r"\1\2", v)
27
- return new_version
28
-
29
-
30
- if __name__ == "__main__":
31
-
32
- package_name = sys.argv[1]
33
- root = pathlib.Path(__file__).parent.parent.resolve()
34
- version = get_prelease_version(root, package_name)
35
- formatted_version = replace_version_format(version)
36
- print(formatted_version)
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