Merge pull request 'moving deal dependencies to tests only' (#483) from zerotier into main

This commit is contained in:
clan-bot
2023-11-10 11:43:45 +00:00
4 changed files with 22 additions and 5 deletions

View File

@@ -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()

View File

@@ -51,7 +51,7 @@ def breakpoint_container(
def breakpoint_shell( def breakpoint_shell(
work_dir: Path, work_dir: Path = Path(os.getcwd()),
env: Optional[Dict[str, str]] = None, env: Optional[Dict[str, str]] = None,
cmd: Optional[List[str]] = None, cmd: Optional[List[str]] = None,
) -> None: ) -> None:

View File

@@ -12,9 +12,8 @@ from pathlib import Path
from typing import Any, Iterator, Optional, Type, TypeVar from typing import Any, Iterator, Optional, Type, TypeVar
from uuid import UUID, uuid4 from uuid import UUID, uuid4
import deal
from .custom_logger import ThreadFormatter, get_caller from .custom_logger import ThreadFormatter, get_caller
from .deal import deal
from .errors import ClanError from .errors import ClanError

View File

@@ -45,8 +45,6 @@ let
argcomplete # optional dependency: if not enabled, shell completion will not work argcomplete # optional dependency: if not enabled, shell completion will not work
fastapi fastapi
uvicorn # optional dependencies: if not enabled, webui subcommand will not work uvicorn # optional dependencies: if not enabled, webui subcommand will not work
deal
schemathesis
]; ];
pytestDependencies = runtimeDependencies ++ dependencies ++ [ pytestDependencies = runtimeDependencies ++ dependencies ++ [
@@ -55,6 +53,8 @@ let
pytest-subprocess pytest-subprocess
pytest-xdist pytest-xdist
pytest-timeout pytest-timeout
deal
schemathesis
remote-pdb remote-pdb
ipdb ipdb
openssh openssh