diracx-cli 0.0.1a23__tar.gz → 0.0.1a25__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.
Files changed (29) hide show
  1. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/PKG-INFO +3 -3
  2. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/pyproject.toml +1 -1
  3. diracx_cli-0.0.1a25/src/diracx/cli/__init__.py +31 -0
  4. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/__main__.py +2 -0
  5. diracx_cli-0.0.1a23/src/diracx/cli/__init__.py → diracx_cli-0.0.1a25/src/diracx/cli/auth.py +4 -26
  6. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/config.py +1 -0
  7. diracx_cli-0.0.1a25/src/diracx/cli/internal/__init__.py +8 -0
  8. diracx_cli-0.0.1a23/src/diracx/cli/internal/__init__.py → diracx_cli-0.0.1a25/src/diracx/cli/internal/config.py +2 -2
  9. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/internal/legacy.py +2 -11
  10. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/jobs.py +1 -0
  11. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/PKG-INFO +3 -3
  12. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/SOURCES.txt +2 -0
  13. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/requires.txt +1 -1
  14. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/cs_sync/test_cssync.py +2 -0
  15. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/test_legacy.py +2 -0
  16. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/test_login.py +2 -2
  17. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/README.md +0 -0
  18. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/setup.cfg +0 -0
  19. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/py.typed +0 -0
  20. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx/cli/utils.py +0 -0
  21. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/dependency_links.txt +0 -0
  22. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/entry_points.txt +0 -0
  23. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/src/diracx_cli.egg-info/top_level.txt +0 -0
  24. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/cs_sync/integration_test.cfg +0 -0
  25. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/cs_sync/integration_test.yaml +0 -0
  26. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/cs_sync/integration_test_buggy.cfg +0 -0
  27. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/legacy/cs_sync/integration_test_secret.cfg +0 -0
  28. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/test_internal.py +0 -0
  29. {diracx_cli-0.0.1a23 → diracx_cli-0.0.1a25}/tests/test_jobs.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: diracx-cli
3
- Version: 0.0.1a23
3
+ Version: 0.0.1a25
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -17,7 +17,7 @@ Requires-Dist: diracx-core
17
17
  Requires-Dist: gitpython
18
18
  Requires-Dist: pydantic>=2.10
19
19
  Requires-Dist: rich
20
- Requires-Dist: typer
20
+ Requires-Dist: typer>=0.12.4
21
21
  Requires-Dist: pyyaml
22
22
  Provides-Extra: testing
23
23
  Requires-Dist: diracx-testing; extra == "testing"
@@ -20,7 +20,7 @@ dependencies = [
20
20
  "gitpython",
21
21
  "pydantic>=2.10",
22
22
  "rich",
23
- "typer",
23
+ "typer>=0.12.4",
24
24
  "pyyaml",
25
25
  ]
26
26
  dynamic = ["version"]
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ from diracx.core.extensions import select_from_extension
4
+
5
+ from .auth import app
6
+
7
+ __all__ = ("app",)
8
+
9
+
10
+ # Load all the sub commands
11
+ cli_names = set(
12
+ [entry_point.name for entry_point in select_from_extension(group="diracx.cli")]
13
+ )
14
+ for cli_name in cli_names:
15
+ entry_point = select_from_extension(group="diracx.cli", name=cli_name)[0]
16
+ app.add_typer(entry_point.load(), name=entry_point.name)
17
+
18
+
19
+ cli_hidden_names = set(
20
+ [
21
+ entry_point.name
22
+ for entry_point in select_from_extension(group="diracx.cli.hidden")
23
+ ]
24
+ )
25
+ for cli_name in cli_hidden_names:
26
+ entry_point = select_from_extension(group="diracx.cli.hidden", name=cli_name)[0]
27
+ app.add_typer(entry_point.load(), name=entry_point.name, hidden=True)
28
+
29
+
30
+ if __name__ == "__main__":
31
+ app()
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from . import app
2
4
 
3
5
  if __name__ == "__main__":
@@ -1,3 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ __all__ = ("app",)
4
+
1
5
  import asyncio
2
6
  import json
3
7
  import os
@@ -8,7 +12,6 @@ import typer
8
12
 
9
13
  from diracx.client.aio import DiracClient
10
14
  from diracx.client.models import DeviceFlowErrorResponse
11
- from diracx.core.extensions import select_from_extension
12
15
  from diracx.core.preferences import get_diracx_preferences
13
16
  from diracx.core.utils import read_credentials, write_credentials
14
17
 
@@ -135,28 +138,3 @@ async def logout():
135
138
  def callback(output_format: Optional[str] = None):
136
139
  if output_format is not None:
137
140
  os.environ["DIRACX_OUTPUT_FORMAT"] = output_format
138
-
139
-
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)
159
-
160
-
161
- if __name__ == "__main__":
162
- app()
@@ -1,5 +1,6 @@
1
1
  # Can't using PEP-604 with typer: https://github.com/tiangolo/typer/issues/348
2
2
  # from __future__ import annotations
3
+ from __future__ import annotations
3
4
 
4
5
  __all__ = ("dump",)
5
6
 
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ from . import legacy
4
+ from .config import app
5
+
6
+ __all__ = ("app",)
7
+
8
+ app.add_typer(legacy.app, name="legacy")
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from pathlib import Path
2
4
  from typing import Annotated, Optional
3
5
 
@@ -18,10 +20,8 @@ from diracx.core.config.schema import (
18
20
  )
19
21
 
20
22
  from ..utils import AsyncTyper
21
- from . import legacy
22
23
 
23
24
  app = AsyncTyper()
24
- app.add_typer(legacy.app, name="legacy")
25
25
 
26
26
 
27
27
  @app.command()
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import base64
2
4
  import hashlib
3
5
  import json
@@ -40,17 +42,6 @@ class ConversionConfig(BaseModel):
40
42
  VOs: dict[str, VOConfig]
41
43
 
42
44
 
43
- # def parse_args():
44
- # parser = argparse.ArgumentParser("Convert the legacy DIRAC CS to the new format")
45
- # parser.add_argument("old_file", type=Path)
46
- # parser.add_argument("conversion_config", type=Path)
47
- # parser.add_argument("repo", type=Path)
48
- # args = parser.parse_args()
49
-
50
-
51
- # main(args.old_file, args.conversion_config, args.repo / DEFAULT_CONFIG_FILE)
52
-
53
-
54
45
  @app.command()
55
46
  def cs_sync(old_file: Path, new_file: Path):
56
47
  """Load the old CS and convert it to the new YAML format."""
@@ -1,5 +1,6 @@
1
1
  # Can't using PEP-604 with typer: https://github.com/tiangolo/typer/issues/348
2
2
  # from __future__ import annotations
3
+ from __future__ import annotations
3
4
 
4
5
  __all__ = ("app",)
5
6
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: diracx-cli
3
- Version: 0.0.1a23
3
+ Version: 0.0.1a25
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -17,7 +17,7 @@ Requires-Dist: diracx-core
17
17
  Requires-Dist: gitpython
18
18
  Requires-Dist: pydantic>=2.10
19
19
  Requires-Dist: rich
20
- Requires-Dist: typer
20
+ Requires-Dist: typer>=0.12.4
21
21
  Requires-Dist: pyyaml
22
22
  Provides-Extra: testing
23
23
  Requires-Dist: diracx-testing; extra == "testing"
@@ -2,11 +2,13 @@ README.md
2
2
  pyproject.toml
3
3
  src/diracx/cli/__init__.py
4
4
  src/diracx/cli/__main__.py
5
+ src/diracx/cli/auth.py
5
6
  src/diracx/cli/config.py
6
7
  src/diracx/cli/jobs.py
7
8
  src/diracx/cli/py.typed
8
9
  src/diracx/cli/utils.py
9
10
  src/diracx/cli/internal/__init__.py
11
+ src/diracx/cli/internal/config.py
10
12
  src/diracx/cli/internal/legacy.py
11
13
  src/diracx_cli.egg-info/PKG-INFO
12
14
  src/diracx_cli.egg-info/SOURCES.txt
@@ -5,7 +5,7 @@ diracx-core
5
5
  gitpython
6
6
  pydantic>=2.10
7
7
  rich
8
- typer
8
+ typer>=0.12.4
9
9
  pyyaml
10
10
 
11
11
  [testing]
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from pathlib import Path
2
4
 
3
5
  import yaml
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from pathlib import Path
2
4
 
3
5
  import yaml
@@ -19,7 +19,7 @@ async def test_logout(monkeypatch, capfd, cli_env, with_cli_login):
19
19
  assert expected_credentials_path.exists()
20
20
 
21
21
  # Run the logout command
22
- await cli.logout()
22
+ await cli.auth.logout()
23
23
  captured = capfd.readouterr()
24
24
  assert "Removed credentials from" in captured.out
25
25
  assert "Logout successful!" in captured.out
@@ -29,7 +29,7 @@ async def test_logout(monkeypatch, capfd, cli_env, with_cli_login):
29
29
  assert not expected_credentials_path.exists()
30
30
 
31
31
  # Rerun the logout command, it should not fail
32
- await cli.logout()
32
+ await cli.auth.logout()
33
33
  captured = capfd.readouterr()
34
34
  assert "Removed credentials from" not in captured.out
35
35
  assert "Logout successful!" in captured.out
File without changes
File without changes