pysae-cli-tools 0.1.2__tar.gz → 0.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysae-cli-tools
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Reusable utilities for Pysae Python CLIs (k8s pod dispatch, …).
5
5
  License: MIT
6
6
  Author: Rémi Alvergnat
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pysae-cli-tools"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Reusable utilities for Pysae Python CLIs (k8s pod dispatch, …)."
5
5
  authors = ["Rémi Alvergnat <remi.alvergnat@pysae.com>"]
6
6
  readme = "README.md"
@@ -30,7 +30,7 @@ import tempfile
30
30
  import uuid
31
31
  from collections.abc import Callable
32
32
  from pathlib import Path
33
- from typing import Annotated, Any, NoReturn, TypeVar
33
+ from typing import Annotated, Any, NoReturn, Protocol, TypeVar
34
34
 
35
35
  from typer import Option
36
36
 
@@ -776,7 +776,25 @@ def k8s_support(
776
776
  return decorator
777
777
 
778
778
 
779
- def build_k8s_support(config: K8sConfig) -> Callable[..., Callable[[F], F]]:
779
+ class K8sSupportDecorator(Protocol):
780
+ """Callable shape returned by :func:`build_k8s_support`.
781
+
782
+ Lets mypy preserve the decorated function's signature in callers —
783
+ a plain ``Callable[..., Callable[[F], F]]`` would erase it and trip
784
+ ``untyped-decorator`` in strict mode.
785
+ """
786
+
787
+ def __call__(
788
+ self,
789
+ *,
790
+ cli_module: str | None = None,
791
+ cli_subcommand: Any = ...,
792
+ pod_name_prefix: str | None = None,
793
+ tty: bool | None = None,
794
+ ) -> Callable[[F], F]: ...
795
+
796
+
797
+ def build_k8s_support(config: K8sConfig) -> K8sSupportDecorator:
780
798
  """Return a :func:`k8s_support` decorator pre-bound to ``config``.
781
799
 
782
800
  Typical setup at the top of a project's ``cli.py``::