From 13b685f7afd5700f884d54fd187b217286a08c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Nov 2023 12:33:14 +0100 Subject: [PATCH] moving deal dependencies to tests only --- pkgs/clan-cli/clan_cli/deal.py | 18 ++++++++++++++++++ pkgs/clan-cli/clan_cli/task_manager.py | 3 +-- pkgs/clan-cli/default.nix | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 pkgs/clan-cli/clan_cli/deal.py diff --git a/pkgs/clan-cli/clan_cli/deal.py b/pkgs/clan-cli/clan_cli/deal.py new file mode 100644 index 00000000..ee57edd1 --- /dev/null +++ b/pkgs/clan-cli/clan_cli/deal.py @@ -0,0 +1,18 @@ +from types import ModuleType +from typing import Callable + + +class FakeDeal: + def __getattr__(self, _name: str) -> "FakeDeal": + return FakeDeal() + + def __call__(self, func: Callable) -> Callable: + return func + + +try: + import deal as real_deal + + deal: ModuleType | FakeDeal = real_deal +except ImportError: + deal = FakeDeal() diff --git a/pkgs/clan-cli/clan_cli/task_manager.py b/pkgs/clan-cli/clan_cli/task_manager.py index 3fedcffa..8ddb30d7 100644 --- a/pkgs/clan-cli/clan_cli/task_manager.py +++ b/pkgs/clan-cli/clan_cli/task_manager.py @@ -12,9 +12,8 @@ from pathlib import Path from typing import Any, Iterator, Optional, Type, TypeVar from uuid import UUID, uuid4 -import deal - from .custom_logger import ThreadFormatter, get_caller +from .deal import deal from .errors import ClanError diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 3cbed599..a639f70b 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -45,8 +45,6 @@ let argcomplete # optional dependency: if not enabled, shell completion will not work fastapi uvicorn # optional dependencies: if not enabled, webui subcommand will not work - deal - schemathesis ]; pytestDependencies = runtimeDependencies ++ dependencies ++ [ @@ -55,6 +53,8 @@ let pytest-subprocess pytest-xdist pytest-timeout + deal + schemathesis remote-pdb ipdb openssh