moving deal dependencies to tests only

This commit is contained in:
Jörg Thalheim
2023-11-10 12:33:14 +01:00
parent aa15bebb0c
commit 2e939bedd6
3 changed files with 21 additions and 4 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()