From 74d4ddd3129123e7e817af936ee975f7eefae6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Thu, 8 Aug 2024 07:29:21 +0200 Subject: [PATCH] feat: use __all__ to export deps from `__init__.py` (#2630) * feat: export wallets * remove linting exception --- lnbits/core/__init__.py | 3 +++ lnbits/wallets/__init__.py | 23 +++++++++++++++++++++++ lnbits/wallets/macaroon/__init__.py | 2 ++ pyproject.toml | 4 ---- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/lnbits/core/__init__.py b/lnbits/core/__init__.py index a35c07a95..96fa65958 100644 --- a/lnbits/core/__init__.py +++ b/lnbits/core/__init__.py @@ -38,3 +38,6 @@ def init_core_routers(app: FastAPI): app.include_router(tinyurl_router) app.include_router(webpush_router) app.include_router(users_router) + + +__all__ = ["core_app", "core_app_extra", "db"] diff --git a/lnbits/wallets/__init__.py b/lnbits/wallets/__init__.py index 2a0269550..707c825c3 100644 --- a/lnbits/wallets/__init__.py +++ b/lnbits/wallets/__init__.py @@ -50,3 +50,26 @@ fake_wallet = FakeWallet() # initialize as fake wallet funding_source: Wallet = fake_wallet + + +__all__ = [ + "AlbyWallet", + "BlinkWallet", + "BreezSdkWallet", + "ClicheWallet", + "CoreLightningWallet", + "CLightningWallet", + "CoreLightningRestWallet", + "EclairWallet", + "FakeWallet", + "LNbitsWallet", + "LndWallet", + "LndRestWallet", + "LNPayWallet", + "LnTipsWallet", + "OpenNodeWallet", + "PhoenixdWallet", + "SparkWallet", + "VoidWallet", + "ZBDWallet", +] diff --git a/lnbits/wallets/macaroon/__init__.py b/lnbits/wallets/macaroon/__init__.py index 44efcf4fe..151a279b2 100644 --- a/lnbits/wallets/macaroon/__init__.py +++ b/lnbits/wallets/macaroon/__init__.py @@ -1 +1,3 @@ from .macaroon import load_macaroon + +__all__ = ["load_macaroon"] diff --git a/pyproject.toml b/pyproject.toml index 462293a2d..eb9396006 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -202,10 +202,6 @@ classmethod-decorators = [ "root_validator", ] -# Ignore unused imports in __init__.py files. -[tool.ruff.lint.extend-per-file-ignores] -"__init__.py" = ["F401", "F403"] - [tool.ruff.lint.mccabe] # TODO: Decrease this to 10. max-complexity = 16