qbraid-cli 0.16.20__tar.gz → 0.16.21__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.
- {qbraid_cli-0.16.20/qbraid_cli.egg-info → qbraid_cli-0.16.21}/PKG-INFO +5 -5
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/pyproject.toml +5 -5
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/main.py +10 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21/qbraid_cli.egg-info}/PKG-INFO +5 -5
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli.egg-info/SOURCES.txt +1 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli.egg-info/requires.txt +4 -4
- qbraid_cli-0.16.21/tests/test_register_client.py +62 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/LICENSE +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/README.md +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/_build_info.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/_version.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/keep_alive.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/permission_response.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/provider_children.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/queue.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/agents/work.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/ai/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/ai/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/ai/token.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/artifacts/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/artifacts/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/comms/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/comms/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/instances.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/profiles.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/server.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/compute/ssh.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/groups.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/publish.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/registry.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/envs/share.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/jobs/groups.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/lab/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/lab/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/projects/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/projects/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/skills/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/skills/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/troubleshoot/__init__.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli/troubleshoot/app.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/setup.cfg +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/tests/test_cli_e2e.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/tests/test_status_colors.py +0 -0
- {qbraid_cli-0.16.20 → qbraid_cli-0.16.21}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.21
|
|
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-Expression: LicenseRef-Proprietary
|
|
@@ -28,13 +28,13 @@ 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: click<=8.5.
|
|
31
|
+
Requires-Dist: click<=8.5.1
|
|
32
32
|
Requires-Dist: questionary>=2.0.0
|
|
33
|
-
Requires-Dist: qbraid-core>=0.6.
|
|
33
|
+
Requires-Dist: qbraid-core>=0.6.52
|
|
34
34
|
Provides-Extra: compute
|
|
35
|
-
Requires-Dist: qbraid-core[compute]>=0.6.
|
|
35
|
+
Requires-Dist: qbraid-core[compute]>=0.6.52; extra == "compute"
|
|
36
36
|
Provides-Extra: envs
|
|
37
|
-
Requires-Dist: qbraid-core[environments]>=0.6.
|
|
37
|
+
Requires-Dist: qbraid-core[environments]>=0.6.52; extra == "envs"
|
|
38
38
|
Provides-Extra: dev
|
|
39
39
|
Requires-Dist: isort; extra == "dev"
|
|
40
40
|
Requires-Dist: black; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.16.
|
|
7
|
+
version = "0.16.21"
|
|
8
8
|
description = "Command Line Interface for interacting with all parts of the qBraid platform."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
|
|
@@ -30,9 +30,9 @@ classifiers = [
|
|
|
30
30
|
dependencies = [
|
|
31
31
|
"typer>=0.12.1",
|
|
32
32
|
"rich>=10.11.0",
|
|
33
|
-
"click<=8.5.
|
|
33
|
+
"click<=8.5.1",
|
|
34
34
|
"questionary>=2.0.0",
|
|
35
|
-
"qbraid-core>=0.6.
|
|
35
|
+
"qbraid-core>=0.6.52",
|
|
36
36
|
]
|
|
37
37
|
requires-python = ">= 3.10"
|
|
38
38
|
|
|
@@ -43,8 +43,8 @@ Documentation = "https://docs.qbraid.com/v2/cli/api-reference/qbraid"
|
|
|
43
43
|
Discord = "https://discord.gg/KugF6Cnncm"
|
|
44
44
|
|
|
45
45
|
[project.optional-dependencies]
|
|
46
|
-
compute = ["qbraid-core[compute]>=0.6.
|
|
47
|
-
envs = ["qbraid-core[environments]>=0.6.
|
|
46
|
+
compute = ["qbraid-core[compute]>=0.6.52"]
|
|
47
|
+
envs = ["qbraid-core[environments]>=0.6.52"]
|
|
48
48
|
dev = ["isort", "black", "pytest", "pytest-cov", "pytest-asyncio"]
|
|
49
49
|
|
|
50
50
|
[project.scripts]
|
|
@@ -111,6 +111,16 @@ def main(
|
|
|
111
111
|
),
|
|
112
112
|
):
|
|
113
113
|
"""The qBraid CLI."""
|
|
114
|
+
# pylint: disable-next=import-error
|
|
115
|
+
from ._version import __version__ # type: ignore
|
|
116
|
+
|
|
117
|
+
try:
|
|
118
|
+
from qbraid_core import register_client
|
|
119
|
+
except ImportError: # qbraid-core older than 0.6.51, e.g. in a hand-built image
|
|
120
|
+
pass
|
|
121
|
+
else:
|
|
122
|
+
# Tells the qBraid API that this command's requests come from the CLI.
|
|
123
|
+
register_client("qbraid-cli", __version__)
|
|
114
124
|
if ctx.invoked_subcommand is None and not version:
|
|
115
125
|
show_banner()
|
|
116
126
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.21
|
|
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-Expression: LicenseRef-Proprietary
|
|
@@ -28,13 +28,13 @@ 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: click<=8.5.
|
|
31
|
+
Requires-Dist: click<=8.5.1
|
|
32
32
|
Requires-Dist: questionary>=2.0.0
|
|
33
|
-
Requires-Dist: qbraid-core>=0.6.
|
|
33
|
+
Requires-Dist: qbraid-core>=0.6.52
|
|
34
34
|
Provides-Extra: compute
|
|
35
|
-
Requires-Dist: qbraid-core[compute]>=0.6.
|
|
35
|
+
Requires-Dist: qbraid-core[compute]>=0.6.52; extra == "compute"
|
|
36
36
|
Provides-Extra: envs
|
|
37
|
-
Requires-Dist: qbraid-core[environments]>=0.6.
|
|
37
|
+
Requires-Dist: qbraid-core[environments]>=0.6.52; extra == "envs"
|
|
38
38
|
Provides-Extra: dev
|
|
39
39
|
Requires-Dist: isort; extra == "dev"
|
|
40
40
|
Requires-Dist: black; extra == "dev"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
typer>=0.12.1
|
|
2
2
|
rich>=10.11.0
|
|
3
|
-
click<=8.5.
|
|
3
|
+
click<=8.5.1
|
|
4
4
|
questionary>=2.0.0
|
|
5
|
-
qbraid-core>=0.6.
|
|
5
|
+
qbraid-core>=0.6.52
|
|
6
6
|
|
|
7
7
|
[compute]
|
|
8
|
-
qbraid-core[compute]>=0.6.
|
|
8
|
+
qbraid-core[compute]>=0.6.52
|
|
9
9
|
|
|
10
10
|
[dev]
|
|
11
11
|
isort
|
|
@@ -15,4 +15,4 @@ pytest-cov
|
|
|
15
15
|
pytest-asyncio
|
|
16
16
|
|
|
17
17
|
[envs]
|
|
18
|
-
qbraid-core[environments]>=0.6.
|
|
18
|
+
qbraid-core[environments]>=0.6.52
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Tests that CLI commands name the CLI in the qBraid API User-Agent.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import importlib
|
|
9
|
+
import sys
|
|
10
|
+
from unittest.mock import patch
|
|
11
|
+
|
|
12
|
+
import pytest
|
|
13
|
+
from qbraid_core import sessions as core_sessions
|
|
14
|
+
from qbraid_core.sessions import QbraidSessionV1
|
|
15
|
+
from requests.structures import CaseInsensitiveDict
|
|
16
|
+
from typer.testing import CliRunner
|
|
17
|
+
|
|
18
|
+
from qbraid_cli._version import __version__
|
|
19
|
+
from qbraid_cli.main import app
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _api_user_agent() -> str:
|
|
23
|
+
"""The User-Agent a qBraid API request from this process goes out with."""
|
|
24
|
+
session = QbraidSessionV1(api_key="test-key", base_url="https://api.example.com/api/v1")
|
|
25
|
+
with patch("requests.Session.request") as send:
|
|
26
|
+
send.return_value.status_code = 200
|
|
27
|
+
session.request("GET", "/jobs")
|
|
28
|
+
headers = CaseInsensitiveDict(session.headers)
|
|
29
|
+
headers.update(send.call_args.kwargs.get("headers") or {})
|
|
30
|
+
return headers["User-Agent"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@pytest.fixture(autouse=True)
|
|
34
|
+
def _no_registered_clients(monkeypatch, tmp_path):
|
|
35
|
+
"""Each test starts with no client registered and no saved qbraidrc."""
|
|
36
|
+
monkeypatch.setattr(core_sessions, "_CLIENT_TOKENS", [])
|
|
37
|
+
monkeypatch.setenv("HOME", str(tmp_path))
|
|
38
|
+
monkeypatch.setenv("USERPROFILE", str(tmp_path))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_running_a_command_names_the_cli_in_api_requests():
|
|
42
|
+
"""Any invocation adds ``qbraid-cli/<version>`` to the User-Agent of API requests."""
|
|
43
|
+
result = CliRunner().invoke(app, [])
|
|
44
|
+
assert result.exit_code == 0
|
|
45
|
+
assert _api_user_agent().endswith(f"qbraid-cli/{__version__}")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def test_importing_the_cli_does_not_register_it(monkeypatch):
|
|
49
|
+
"""Library use of qbraid_cli modules leaves the User-Agent alone."""
|
|
50
|
+
# Drop the cached module so the import below runs main.py's top level again.
|
|
51
|
+
monkeypatch.delitem(sys.modules, "qbraid_cli.main")
|
|
52
|
+
importlib.import_module("qbraid_cli.main")
|
|
53
|
+
|
|
54
|
+
assert "qbraid-cli/" not in _api_user_agent()
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def test_an_older_core_without_register_client_does_not_break_commands(monkeypatch):
|
|
58
|
+
"""With qbraid-core before 0.6.51, commands still run, just without the token."""
|
|
59
|
+
monkeypatch.delattr("qbraid_core.register_client")
|
|
60
|
+
result = CliRunner().invoke(app, [])
|
|
61
|
+
assert result.exit_code == 0
|
|
62
|
+
assert "qbraid-cli/" not in _api_user_agent()
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|