rats-apps 0.3.0.dev20241001092342__py3-none-any.whl → 0.3.0.dev20241015061531__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.
rats/cli/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  from ._annotations import CommandId, command, get_class_commands, get_class_groups, group
4
4
  from ._app import ClickApp
5
- from ._container import CommandContainer
5
+ from ._container import CompositeContainer, Container
6
6
  from ._plugin import PluginContainer, PluginServices, attach, create_group
7
7
 
8
8
  __all__ = [
@@ -16,5 +16,6 @@ __all__ = [
16
16
  "ClickApp",
17
17
  "PluginServices",
18
18
  "CommandId",
19
- "CommandContainer",
19
+ "Container",
20
+ "CompositeContainer",
20
21
  ]
rats/cli/__main__.py CHANGED
@@ -9,7 +9,7 @@ from rats import apps, cli
9
9
  logger = logging.getLogger(__name__)
10
10
 
11
11
 
12
- class ExampleCommands(cli.CommandContainer):
12
+ class ExampleCommands(cli.Container):
13
13
  """An example collection of cli commands."""
14
14
 
15
15
  @cli.command()
rats/cli/_app.py CHANGED
@@ -4,7 +4,7 @@ import click
4
4
 
5
5
  from rats import apps
6
6
 
7
- from ._container import CommandContainer
7
+ from ._container import Container
8
8
 
9
9
 
10
10
  @final
@@ -12,12 +12,12 @@ class ClickApp(apps.Executable):
12
12
  """..."""
13
13
 
14
14
  _group: click.Group
15
- _commands: CommandContainer
15
+ _commands: Container
16
16
 
17
17
  def __init__(
18
18
  self,
19
19
  group: click.Group,
20
- commands: CommandContainer,
20
+ commands: Container,
21
21
  ) -> None:
22
22
  """Not sure this is the right interface."""
23
23
  self._group = group
rats/cli/_container.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
  from collections.abc import Callable
3
3
  from functools import partial
4
- from typing import Any, Protocol
4
+ from typing import Any, Protocol, final
5
5
 
6
6
  import click
7
7
 
@@ -10,7 +10,7 @@ from ._annotations import get_class_commands
10
10
  logger = logging.getLogger(__name__)
11
11
 
12
12
 
13
- class CommandContainer(Protocol):
13
+ class Container(Protocol):
14
14
  """A container that can attach click commands to a click group."""
15
15
 
16
16
  def attach(self, group: click.Group) -> None:
@@ -46,3 +46,15 @@ class CommandContainer(Protocol):
46
46
  params=params,
47
47
  )
48
48
  )
49
+
50
+
51
+ @final
52
+ class CompositeContainer(Container):
53
+ _containers: tuple[Container, ...]
54
+
55
+ def __init__(self, *containers: Container) -> None:
56
+ self._containers = containers
57
+
58
+ def attach(self, group: click.Group) -> None:
59
+ for container in self._containers:
60
+ container.attach(group)
rats/cli/_plugin.py CHANGED
@@ -4,10 +4,10 @@ import click
4
4
 
5
5
  from rats import apps
6
6
 
7
- from ._container import CommandContainer
7
+ from ._container import Container
8
8
 
9
9
 
10
- def create_group(group: click.Group, container: CommandContainer) -> click.Group:
10
+ def create_group(group: click.Group, container: Container) -> click.Group:
11
11
  container.attach(group)
12
12
  return group
13
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rats-apps
3
- Version: 0.3.0.dev20241001092342
3
+ Version: 0.3.0.dev20241015061531
4
4
  Summary: research analysis tools for building applications
5
5
  Home-page: https://github.com/microsoft/rats/
6
6
  License: MIT
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
14
15
  Requires-Dist: click
15
16
  Requires-Dist: colorlog
16
17
  Requires-Dist: typing_extensions
@@ -17,17 +17,17 @@ rats/apps/_scoping.py,sha256=6C2-ID22cCPR9Cbexf3CvCF3o9F_7ieURbwqkf6DI68,1360
17
17
  rats/apps/_simple_apps.py,sha256=n-3zeHY3iintZ9LN597c7zDHv3DiIdl7c8NTk0gUk1Y,5477
18
18
  rats/apps/_static_container.py,sha256=5lzLh1CUoQVwhxfDhK6ZOQaBrPpudbRHWJkaDppphZo,881
19
19
  rats/apps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- rats/cli/__init__.py,sha256=bBYDOs697TLCf86maID-JZkHeB7rvBfiwk97qDUmMCk,548
21
- rats/cli/__main__.py,sha256=3JZ7mrTTrrODQHutefm2zJp1-cQQB7I5-1xhYw7SMBU,1656
20
+ rats/cli/__init__.py,sha256=GR_pZr0OtqkH2js73OPZlK4Pgj0C30bhSKPGfU32Zxk,580
21
+ rats/cli/__main__.py,sha256=5OidbkRA4aglOAcvV6xQY9k7Ls9vd_EwNvI2aOrcPIQ,1649
22
22
  rats/cli/_annotations.py,sha256=5voM1pNm7iybZpgQTSVpaq3rMIMz33jr4eUyoEmxWJ4,1359
23
- rats/cli/_app.py,sha256=NjJfXKZYBdd1CZuLbrXyUFB_wRJQah1Rvtxe_zj4y_M,641
24
- rats/cli/_container.py,sha256=PsvUIqQgQVXRTUh7BXhpzm42gxXU100-0EaYGwcmAAg,1833
25
- rats/cli/_plugin.py,sha256=gOLTR0qZ4TAYJ9ORoeOeFiiiN9JBTakEACtPORlYSTE,1100
23
+ rats/cli/_app.py,sha256=EmLIJe1LTLob5u5gP8gpgxk3kFlALTvrpYlwxlILu0k,620
24
+ rats/cli/_container.py,sha256=q3L6On6RS3PfUFZ67t6eUvKUQIK4Qxomz5ob86aNcR4,2143
25
+ rats/cli/_plugin.py,sha256=jkpqSCW0ELnMjK8fz-BVE50qgBIxbd5j4hILOnlla6U,1086
26
26
  rats/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  rats/logs/__init__.py,sha256=fCn4pfpYiAcTtt5CsnUZX68CjOB3KJHxMSiYxsma4qE,183
28
28
  rats/logs/_plugin.py,sha256=OQ5fXToBm60YJRrMUVJ9_HVytUs3c69vaHY57jpivb0,2221
29
29
  rats/logs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- rats_apps-0.3.0.dev20241001092342.dist-info/METADATA,sha256=_hr4P32onK68GdbiEjuIR3AmMAOLIaR5t3bKtcy1_6A,774
31
- rats_apps-0.3.0.dev20241001092342.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- rats_apps-0.3.0.dev20241001092342.dist-info/entry_points.txt,sha256=9oOvf2loQr5ACWQgvuu9Q3KZIVIxKE5Aa-rLuUII5WQ,91
33
- rats_apps-0.3.0.dev20241001092342.dist-info/RECORD,,
30
+ rats_apps-0.3.0.dev20241015061531.dist-info/METADATA,sha256=2D-FjWSAqL8gcq-6MSh8pV5DgjLum5pqJkLUKwQPekQ,825
31
+ rats_apps-0.3.0.dev20241015061531.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
32
+ rats_apps-0.3.0.dev20241015061531.dist-info/entry_points.txt,sha256=9oOvf2loQr5ACWQgvuu9Q3KZIVIxKE5Aa-rLuUII5WQ,91
33
+ rats_apps-0.3.0.dev20241015061531.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any