forked from lnbits/lnbits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
218 lines (200 loc) · 4.72 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
[tool.poetry]
name = "lnbits"
version = "1.0.0-rc5"
description = "LNbits, free and open-source Lightning wallet and accounts system."
authors = ["Alan Bits <[email protected]>"]
readme = "README.md"
repository = "https://github.com/lnbits/lnbits"
homepage = "https://lnbits.com"
packages = [
{include = "lnbits"},
{include = "lnbits/py.typed"},
]
[tool.poetry.dependencies]
python = "^3.12 | ^3.11 | ^3.10 | ^3.9"
bech32 = "1.2.0"
click = "8.1.7"
ecdsa = "0.19.0"
fastapi = "0.115.2"
httpx = "0.27.0"
jinja2 = "3.1.4"
lnurl = "0.5.3"
pydantic = "1.10.18"
pyqrcode = "1.2.1"
shortuuid = "1.0.13"
sse-starlette = "1.8.2"
typing-extensions = "4.12.2"
uvicorn = "0.30.6"
sqlalchemy = "1.4.54"
aiosqlite = "0.20.0"
asyncpg = "0.29.0"
uvloop = "0.19.0"
websockets = "11.0.3"
loguru = "0.7.2"
grpcio = "1.66.1"
protobuf = "5.28.0"
pyln-client = "24.8.1"
pywebpush = "1.14.1"
slowapi = "0.1.9"
websocket-client = "1.8.0"
pycryptodomex = "3.20.0"
packaging = "24.0"
bolt11 = "2.1.0"
# needed for new login methods: username-password, google-auth, github-auth
bcrypt = "4.2.0"
pyjwt = "2.9.0"
passlib = "1.7.4"
itsdangerous = "2.2.0"
fastapi-sso = "0.15.0"
# needed for boltz, lnurldevice, watchonly extensions
embit = "0.8.0"
# needed for cashu, lnurlp, nostrclient, nostrmarket, nostrrelay extensions
secp256k1 = "0.14.0"
# keep for backwards compatibility with lnurlp and cashu
environs = "9.5.0"
# needed for scheduler extension
python-crontab = "3.2.0"
# needed for liquid support boltz
wallycore = {version = "1.3.0", optional = true}
# needed for breez funding source
breez-sdk = {version = "0.5.2", optional = true}
[tool.poetry.extras]
breez = ["breez-sdk"]
liquid = ["wallycore"]
[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
# we are stuck with pytest-asyncio 0.21.x because of https://github.com/pytest-dev/pytest-asyncio/issues/706
pytest-asyncio = "^0.21.2"
pytest = "^8.3.2"
pytest-cov = "^4.1.0"
mypy = "^1.11.2"
types-protobuf = "^5.27.0.20240626"
pre-commit = "^3.8.0"
openapi-spec-validator = "^0.7.1"
ruff = "^0.6.4"
types-passlib = "^1.7.7.20240327"
openai = "^1.39.0"
json5 = "^0.9.25"
asgi-lifespan = "^2.1.0"
pytest-md = "^0.2.0"
pytest-httpserver = "^1.1.0"
pytest-mock = "^3.14.0"
types-mock = "^5.1.0.20240425"
mock = "^5.1.0"
grpcio-tools = "^1.66.1"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
lnbits = "lnbits.server:main"
lnbits-cli = "lnbits.commands:main"
[tool.pyright]
include = [
"lnbits",
"tests",
"tools",
]
exclude = [
"lnbits/wallets/boltz_grpc_files",
"lnbits/wallets/lnd_grpc_files",
"lnbits/extensions",
"lnbits/upgrades",
]
[tool.mypy]
files = [
"lnbits",
"tests",
"tools",
]
exclude = [
"^lnbits/wallets/boltz_grpc_files",
"^lnbits/wallets/lnd_grpc_files",
"^lnbits/extensions",
"^lnbits/upgrades",
]
[[tool.mypy.overrides]]
module = [
"embit.*",
"secp256k1.*",
"uvicorn.*",
"sqlalchemy.*",
"websocket.*",
"websockets.*",
"pyqrcode.*",
"shortuuid.*",
"grpc.*",
"lnurl.*",
"bolt11.*",
"bitstring.*",
"ecdsa.*",
"pyngrok.*",
"pyln.client.*",
"py_vapid.*",
"pywebpush.*",
"fastapi_sso.sso.*",
"json5.*",
]
ignore_missing_imports = "True"
[tool.pytest.ini_options]
log_cli = false
addopts = "--durations=1 -s --cov=lnbits --cov-report=xml"
testpaths = [
"tests"
]
[tool.black]
line-length = 88
# use upcoming new features
# preview = true
extend-exclude = """(
lnbits/static
| lnbits/extensions
| lnbits/upgrades
| lnbits/wallets/lnd_grpc_files
| lnbits/wallets/boltz_grpc_files
)"""
[tool.ruff]
# Same as Black. + 10% rule of black
line-length = 88
# Exclude generated files.
extend-exclude = [
"lnbits/wallets/lnd_grpc_files",
"lnbits/wallets/boltz_grpc_files"
]
[tool.ruff.lint]
# Enable:
# F - pyflakes
# E - pycodestyle errors
# W - pycodestyle warnings
# I - isort
# A - flake8-builtins
# C - mccabe
# N - naming
# UP - pyupgrade
# RUF - ruff specific rules
# B - bugbear
select = ["F", "E", "W", "I", "A", "C", "N", "UP", "RUF", "B"]
# UP007: pyupgrade: use X | Y instead of Optional. (python3.10)
# RUF012: mutable-class-default
ignore = ["UP007", "RUF012"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# needed for pydantic
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"root_validator",
"validator",
]
[tool.ruff.lint.mccabe]
# TODO: Decrease this to 10.
max-complexity = 16
[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
extend-immutable-calls = [
"fastapi.Depends",
"fastapi.Query",
"fastapi.Body",
"lnbits.decorators.parse_filters"
]