diracx-cli 0.0.1a32__py3-none-any.whl → 0.0.1a34__py3-none-any.whl
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.
- diracx/cli/auth.py +6 -6
- diracx/cli/config.py +2 -2
- diracx/cli/jobs.py +3 -3
- {diracx_cli-0.0.1a32.dist-info → diracx_cli-0.0.1a34.dist-info}/METADATA +1 -1
- {diracx_cli-0.0.1a32.dist-info → diracx_cli-0.0.1a34.dist-info}/RECORD +8 -8
- {diracx_cli-0.0.1a32.dist-info → diracx_cli-0.0.1a34.dist-info}/WHEEL +0 -0
- {diracx_cli-0.0.1a32.dist-info → diracx_cli-0.0.1a34.dist-info}/entry_points.txt +0 -0
- {diracx_cli-0.0.1a32.dist-info → diracx_cli-0.0.1a34.dist-info}/top_level.txt +0 -0
diracx/cli/auth.py
CHANGED
|
@@ -11,7 +11,7 @@ from typing import Annotated, Optional
|
|
|
11
11
|
|
|
12
12
|
import typer
|
|
13
13
|
|
|
14
|
-
from diracx.client.aio import
|
|
14
|
+
from diracx.client.aio import AsyncDiracClient
|
|
15
15
|
from diracx.client.models import DeviceFlowErrorResponse
|
|
16
16
|
from diracx.core.preferences import get_diracx_preferences
|
|
17
17
|
from diracx.core.utils import read_credentials, write_credentials
|
|
@@ -22,8 +22,8 @@ app = AsyncTyper()
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
async def installation_metadata():
|
|
25
|
-
async with
|
|
26
|
-
return await api.well_known.
|
|
25
|
+
async with AsyncDiracClient() as api:
|
|
26
|
+
return await api.well_known.get_installation_metadata()
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def vo_callback(vo: str | None) -> str:
|
|
@@ -77,7 +77,7 @@ async def login(
|
|
|
77
77
|
scopes += [f"property:{p}" for p in property]
|
|
78
78
|
|
|
79
79
|
print(f"Logging in with scopes: {scopes}")
|
|
80
|
-
async with
|
|
80
|
+
async with AsyncDiracClient() as api:
|
|
81
81
|
data = await api.auth.initiate_device_flow(
|
|
82
82
|
client_id=api.client_id,
|
|
83
83
|
scope=" ".join(scopes),
|
|
@@ -109,7 +109,7 @@ async def login(
|
|
|
109
109
|
|
|
110
110
|
@app.async_command()
|
|
111
111
|
async def whoami():
|
|
112
|
-
async with
|
|
112
|
+
async with AsyncDiracClient() as api:
|
|
113
113
|
user_info = await api.auth.userinfo()
|
|
114
114
|
# TODO: Add a RICH output format
|
|
115
115
|
print(json.dumps(user_info.as_dict(), indent=2))
|
|
@@ -117,7 +117,7 @@ async def whoami():
|
|
|
117
117
|
|
|
118
118
|
@app.async_command()
|
|
119
119
|
async def logout():
|
|
120
|
-
async with
|
|
120
|
+
async with AsyncDiracClient() as api:
|
|
121
121
|
credentials_path = get_diracx_preferences().credentials_path
|
|
122
122
|
if credentials_path.exists():
|
|
123
123
|
credentials = read_credentials(credentials_path)
|
diracx/cli/config.py
CHANGED
|
@@ -8,7 +8,7 @@ import json
|
|
|
8
8
|
|
|
9
9
|
from rich import print_json
|
|
10
10
|
|
|
11
|
-
from diracx.client.aio import
|
|
11
|
+
from diracx.client.aio import AsyncDiracClient
|
|
12
12
|
from diracx.core.preferences import OutputFormats, get_diracx_preferences
|
|
13
13
|
|
|
14
14
|
from .utils import AsyncTyper
|
|
@@ -18,7 +18,7 @@ app = AsyncTyper()
|
|
|
18
18
|
|
|
19
19
|
@app.async_command()
|
|
20
20
|
async def dump():
|
|
21
|
-
async with
|
|
21
|
+
async with AsyncDiracClient() as api:
|
|
22
22
|
config = await api.config.serve_config()
|
|
23
23
|
display(config)
|
|
24
24
|
|
diracx/cli/jobs.py
CHANGED
|
@@ -12,7 +12,7 @@ from rich.console import Console
|
|
|
12
12
|
from rich.table import Table
|
|
13
13
|
from typer import FileText, Option
|
|
14
14
|
|
|
15
|
-
from diracx.client.aio import
|
|
15
|
+
from diracx.client.aio import AsyncDiracClient
|
|
16
16
|
from diracx.core.models import ScalarSearchOperator, SearchSpec, VectorSearchOperator
|
|
17
17
|
from diracx.core.preferences import OutputFormats, get_diracx_preferences
|
|
18
18
|
|
|
@@ -66,7 +66,7 @@ async def search(
|
|
|
66
66
|
per_page: int = 10,
|
|
67
67
|
):
|
|
68
68
|
search_specs = [parse_condition(cond) for cond in condition]
|
|
69
|
-
async with
|
|
69
|
+
async with AsyncDiracClient() as api:
|
|
70
70
|
jobs, content_range = await api.jobs.search(
|
|
71
71
|
parameters=None if all else parameter,
|
|
72
72
|
search=search_specs if search_specs else None,
|
|
@@ -151,7 +151,7 @@ def display_rich(data, content_range: ContentRange) -> None:
|
|
|
151
151
|
|
|
152
152
|
@app.async_command()
|
|
153
153
|
async def submit(jdl: list[FileText]):
|
|
154
|
-
async with
|
|
154
|
+
async with AsyncDiracClient() as api:
|
|
155
155
|
jobs = await api.jobs.submit_jdl_jobs([x.read() for x in jdl])
|
|
156
156
|
print(
|
|
157
157
|
f"Inserted {len(jobs)} jobs with ids: {','.join(map(str, (job.job_id for job in jobs)))}"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
diracx/cli/__init__.py,sha256=HB9Umd1DXskg8lrRY0ZnSaOBVYPD5Pl4PYRWts-ZR0E,808
|
|
2
2
|
diracx/cli/__main__.py,sha256=yGjYWjRcrrp5mJ0xD0v3rc7VIA9bzDib5D7LPAdH4OI,92
|
|
3
|
-
diracx/cli/auth.py,sha256=
|
|
4
|
-
diracx/cli/config.py,sha256
|
|
5
|
-
diracx/cli/jobs.py,sha256=
|
|
3
|
+
diracx/cli/auth.py,sha256=FXpZQATi0P_xZCLCqQJ_h-hszqShd-4SD1zQ03-PXPU,4789
|
|
4
|
+
diracx/cli/config.py,sha256=LDoFT4x0VF0QAU2_y-fkZWQwD7yMYmyiM7VJFLK79GQ,863
|
|
5
|
+
diracx/cli/jobs.py,sha256=ev3Zm6WH9g5MVT5EXbfSwHamiQUcatT4bYUrxx4c8BE,4729
|
|
6
6
|
diracx/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
diracx/cli/utils.py,sha256=NwhMMHwveKOdW2aoSqpnLnfOKhPnjmPPLpX69naPAzc,855
|
|
8
8
|
diracx/cli/internal/__init__.py,sha256=KZrzVcKu3YhNev2XF2KA2nttAa9ONU3CVUgatVMonJ4,143
|
|
9
9
|
diracx/cli/internal/config.py,sha256=xPT7lnJ3QPqJgaNJuMoUpV6CIIxZY_d7HKFb4uINb_8,6552
|
|
10
10
|
diracx/cli/internal/legacy.py,sha256=Wzfdgjbt9xxUK6MkCrEGNXdMOJzkvUGJh2MnD2j_2QE,13547
|
|
11
|
-
diracx_cli-0.0.
|
|
12
|
-
diracx_cli-0.0.
|
|
13
|
-
diracx_cli-0.0.
|
|
14
|
-
diracx_cli-0.0.
|
|
15
|
-
diracx_cli-0.0.
|
|
11
|
+
diracx_cli-0.0.1a34.dist-info/METADATA,sha256=C3vNUL3FeYWSdKO7OoaIJ2jw0TxpqQhwWvecdgXz4Io,803
|
|
12
|
+
diracx_cli-0.0.1a34.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
13
|
+
diracx_cli-0.0.1a34.dist-info/entry_points.txt,sha256=b1909GHVOkFUiHVglNlpwia4Ug-7Ncrg-8D5xtYVAlw,169
|
|
14
|
+
diracx_cli-0.0.1a34.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
|
15
|
+
diracx_cli-0.0.1a34.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|