diracx-cli 0.0.1a18__tar.gz → 0.0.1a20__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.
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/PKG-INFO +1 -1
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/pyproject.toml +10 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/__init__.py +45 -7
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx_cli.egg-info/PKG-INFO +1 -1
- diracx_cli-0.0.1a20/src/diracx_cli.egg-info/entry_points.txt +9 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/integration_test.cfg +0 -2
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/integration_test.yaml +0 -2
- diracx_cli-0.0.1a18/src/diracx_cli.egg-info/entry_points.txt +0 -2
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/README.md +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/setup.cfg +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/__main__.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/config.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/internal/__init__.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/internal/legacy.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/jobs.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/py.typed +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx/cli/utils.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx_cli.egg-info/SOURCES.txt +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx_cli.egg-info/dependency_links.txt +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx_cli.egg-info/requires.txt +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/src/diracx_cli.egg-info/top_level.txt +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/integration_test_buggy.cfg +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/integration_test_secret.cfg +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/test_cssync.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/test_legacy.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/test_internal.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/test_jobs.py +0 -0
- {diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/test_login.py +0 -0
|
@@ -36,6 +36,15 @@ types = [
|
|
|
36
36
|
[project.scripts]
|
|
37
37
|
dirac = "diracx.cli:app"
|
|
38
38
|
|
|
39
|
+
[project.entry-points."diracx.cli"]
|
|
40
|
+
jobs = "diracx.cli.jobs:app"
|
|
41
|
+
config = "diracx.cli.config:app"
|
|
42
|
+
|
|
43
|
+
[project.entry-points."diracx.cli.hidden"]
|
|
44
|
+
internal = "diracx.cli.internal:app"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
39
48
|
[tool.setuptools.packages.find]
|
|
40
49
|
where = ["src"]
|
|
41
50
|
|
|
@@ -58,3 +67,4 @@ asyncio_mode = "auto"
|
|
|
58
67
|
markers = [
|
|
59
68
|
"enabled_dependencies: List of dependencies which should be available to the FastAPI test client",
|
|
60
69
|
]
|
|
70
|
+
asyncio_default_fixture_loop_scope = "session"
|
|
@@ -8,10 +8,10 @@ import typer
|
|
|
8
8
|
|
|
9
9
|
from diracx.client.aio import DiracClient
|
|
10
10
|
from diracx.client.models import DeviceFlowErrorResponse
|
|
11
|
+
from diracx.core.extensions import select_from_extension
|
|
11
12
|
from diracx.core.preferences import get_diracx_preferences
|
|
12
13
|
from diracx.core.utils import write_credentials
|
|
13
14
|
|
|
14
|
-
from . import config, internal, jobs
|
|
15
15
|
from .utils import AsyncTyper
|
|
16
16
|
|
|
17
17
|
app = AsyncTyper()
|
|
@@ -38,12 +38,34 @@ def vo_callback(vo: str | None) -> str:
|
|
|
38
38
|
|
|
39
39
|
@app.async_command()
|
|
40
40
|
async def login(
|
|
41
|
-
vo: Annotated[
|
|
42
|
-
|
|
41
|
+
vo: Annotated[
|
|
42
|
+
Optional[str],
|
|
43
|
+
typer.Argument(callback=vo_callback, help="Virtual Organization name"),
|
|
44
|
+
] = None,
|
|
45
|
+
group: Optional[str] = typer.Option(
|
|
46
|
+
None,
|
|
47
|
+
help="Group name within the VO. If not provided, the default group for the VO will be used.",
|
|
48
|
+
),
|
|
43
49
|
property: Optional[list[str]] = typer.Option(
|
|
44
|
-
None,
|
|
50
|
+
None,
|
|
51
|
+
help=(
|
|
52
|
+
"List of properties to add to the default properties of the group. "
|
|
53
|
+
"If not provided, default properties of the group will be used."
|
|
54
|
+
),
|
|
45
55
|
),
|
|
46
56
|
):
|
|
57
|
+
"""Login to the DIRAC system using the device flow.
|
|
58
|
+
|
|
59
|
+
- If only VO is provided: Uses the default group and its properties for the VO.
|
|
60
|
+
|
|
61
|
+
- If VO and group are provided: Uses the specified group and its properties for the VO.
|
|
62
|
+
|
|
63
|
+
- If VO and properties are provided: Uses the default group and combines its properties with the
|
|
64
|
+
provided properties.
|
|
65
|
+
|
|
66
|
+
- If VO, group, and properties are provided: Uses the specified group and combines its properties with the
|
|
67
|
+
provided properties.
|
|
68
|
+
"""
|
|
47
69
|
scopes = [f"vo:{vo}"]
|
|
48
70
|
if group:
|
|
49
71
|
scopes.append(f"group:{group}")
|
|
@@ -115,9 +137,25 @@ def callback(output_format: Optional[str] = None):
|
|
|
115
137
|
os.environ["DIRACX_OUTPUT_FORMAT"] = output_format
|
|
116
138
|
|
|
117
139
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
140
|
+
# Load all the sub commands
|
|
141
|
+
|
|
142
|
+
cli_names = set(
|
|
143
|
+
[entry_point.name for entry_point in select_from_extension(group="diracx.cli")]
|
|
144
|
+
)
|
|
145
|
+
for cli_name in cli_names:
|
|
146
|
+
entry_point = select_from_extension(group="diracx.cli", name=cli_name)[0]
|
|
147
|
+
app.add_typer(entry_point.load(), name=entry_point.name)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
cli_hidden_names = set(
|
|
151
|
+
[
|
|
152
|
+
entry_point.name
|
|
153
|
+
for entry_point in select_from_extension(group="diracx.cli.hidden")
|
|
154
|
+
]
|
|
155
|
+
)
|
|
156
|
+
for cli_name in cli_hidden_names:
|
|
157
|
+
entry_point = select_from_extension(group="diracx.cli.hidden", name=cli_name)[0]
|
|
158
|
+
app.add_typer(entry_point.load(), name=entry_point.name, hidden=True)
|
|
121
159
|
|
|
122
160
|
|
|
123
161
|
if __name__ == "__main__":
|
|
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
|
{diracx_cli-0.0.1a18 → diracx_cli-0.0.1a20}/tests/legacy/cs_sync/integration_test_secret.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|