pysae-cli-tools 0.1.2__tar.gz → 0.1.4__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.
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/PKG-INFO +1 -1
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/pyproject.toml +1 -1
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/pysae_cli_tools/k8s/runner.py +32 -17
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/README.md +0 -0
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/pysae_cli_tools/__init__.py +0 -0
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/pysae_cli_tools/k8s/__init__.py +0 -0
- {pysae_cli_tools-0.1.2 → pysae_cli_tools-0.1.4}/pysae_cli_tools/k8s/config.py +0 -0
|
@@ -776,7 +776,37 @@ def k8s_support(
|
|
|
776
776
|
return decorator
|
|
777
777
|
|
|
778
778
|
|
|
779
|
-
|
|
779
|
+
class K8sSupportFactory:
|
|
780
|
+
"""Callable returned by :func:`build_k8s_support`.
|
|
781
|
+
|
|
782
|
+
Implemented as a class with a typed ``__call__`` (rather than an inner
|
|
783
|
+
function or :class:`Protocol`) so mypy resolves the ``F`` TypeVar at
|
|
784
|
+
every call site. A plain ``Callable[..., Callable[[F], F]]`` return
|
|
785
|
+
type would erase the decorated function's signature and trip
|
|
786
|
+
``untyped-decorator`` in strict-mode consumers.
|
|
787
|
+
"""
|
|
788
|
+
|
|
789
|
+
def __init__(self, config: K8sConfig) -> None:
|
|
790
|
+
self._config = config
|
|
791
|
+
|
|
792
|
+
def __call__(
|
|
793
|
+
self,
|
|
794
|
+
*,
|
|
795
|
+
cli_module: str | None = None,
|
|
796
|
+
cli_subcommand: Any = _AUTO_SUBCOMMAND,
|
|
797
|
+
pod_name_prefix: str | None = None,
|
|
798
|
+
tty: bool | None = None,
|
|
799
|
+
) -> Callable[[F], F]:
|
|
800
|
+
return k8s_support(
|
|
801
|
+
config=self._config,
|
|
802
|
+
cli_module=cli_module,
|
|
803
|
+
cli_subcommand=cli_subcommand,
|
|
804
|
+
pod_name_prefix=pod_name_prefix,
|
|
805
|
+
tty=tty,
|
|
806
|
+
)
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
def build_k8s_support(config: K8sConfig) -> K8sSupportFactory:
|
|
780
810
|
"""Return a :func:`k8s_support` decorator pre-bound to ``config``.
|
|
781
811
|
|
|
782
812
|
Typical setup at the top of a project's ``cli.py``::
|
|
@@ -802,19 +832,4 @@ def build_k8s_support(config: K8sConfig) -> Callable[..., Callable[[F], F]]:
|
|
|
802
832
|
def my_other_command(...): ...
|
|
803
833
|
"""
|
|
804
834
|
|
|
805
|
-
|
|
806
|
-
*,
|
|
807
|
-
cli_module: str | None = None,
|
|
808
|
-
cli_subcommand: Any = _AUTO_SUBCOMMAND,
|
|
809
|
-
pod_name_prefix: str | None = None,
|
|
810
|
-
tty: bool | None = None,
|
|
811
|
-
) -> Callable[[F], F]:
|
|
812
|
-
return k8s_support(
|
|
813
|
-
config=config,
|
|
814
|
-
cli_module=cli_module,
|
|
815
|
-
cli_subcommand=cli_subcommand,
|
|
816
|
-
pod_name_prefix=pod_name_prefix,
|
|
817
|
-
tty=tty,
|
|
818
|
-
)
|
|
819
|
-
|
|
820
|
-
return k8s_support_bound
|
|
835
|
+
return K8sSupportFactory(config)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|