-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpyproject.toml
338 lines (308 loc) · 9.23 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
[build-system]
build-backend = "hatchling.build"
requires = [ "hatch-vcs", "hatchling" ]
[project]
name = "pyaleph"
description = "Reference implementation of Aleph.im next generation network of decentralized big data applications."
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [
{ name = "Moshe Malawach", email = "[email protected]" },
]
requires-python = ">=3.12,<3.13"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
]
dynamic = [ "version" ]
dependencies = [
"aio-pika==9.5",
"aiocache==0.12.2",
"aiofiles==23.2.1",
"aiohttp==3.11.11",
"aiohttp-cors==0.7",
"aiohttp-jinja2==1.5",
"aioipfs~=0.7.1",
"alembic==1.12.1",
"aleph-message==0.6",
"aleph-nuls2==0.1",
"aleph-p2p-client @ git+https://github.com/aleph-im/p2p-service-client-python@cbfebb871db94b2ca580e66104a67cd730c5020c",
"aleph-pytezos==3.13.4",
"asyncpg==0.30",
"base58>=1.0.3",
"coincurve==20",
"configmanager==1.35.1",
"configparser==6",
"cosmospy==6",
"dataclasses-json==0.5.6",
"eth-account==0.10",
"eth-typing~=4.0",
"gunicorn==21.2",
"hexbytes==0.2.2",
"msgpack==1.0.3", # required by aiocache
"multiaddr==0.0.9", # for libp2p-stubs
"orjson>=3.7.7", # Minimum version for Python 3.11
"psycopg2-binary==2.9.5", # Note: psycopg3 is not yet supported by SQLAlchemy
"pycryptodome==3.17", # for libp2p-stubs
"pymultihash==0.8.2", # for libp2p-stubs
"pynacl==1.5",
"python-dateutil==2.8.2",
"pytz==2023.3",
"pyyaml==6.0.1",
"redis[hiredis]==5.0.1",
"requests==2.32.3",
"sentry-sdk==1.34",
"setproctitle==1.3.3",
"setuptools>=70.3",
"sqlalchemy[mypy]==1.4.52",
"sqlalchemy-utils==0.38.3",
"substrate-interface==1.7.4",
"types-aiofiles==23.2.0.20240403",
"ujson==5.4", # required by aiocache
"urllib3==2.3",
"uvloop==0.21",
"web3==6.11.2",
]
optional-dependencies.cosmos = [
"cosmospy",
]
optional-dependencies.docs = [
"sphinxcontrib-plantuml",
]
optional-dependencies.nuls2 = [
"aleph-nuls2==0.1",
"py-ed25519-bindings==1.0.2; python_version>='3.11'",
]
optional-dependencies.polkadot = [
"substrate-interface>=0.9.27",
]
urls.Documentation = "https://aleph.im/"
urls.Homepage = "https://github.com/aleph-im/pyaleph"
scripts.pyaleph = "aleph.commands:run"
dependency_links = [
"https://github.com/aleph-im/py-libp2p/tarball/0.1.4-1-use-set#egg=libp2p",
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = [
"alembic.ini",
"src/aleph",
"pyproject.toml",
"AUTHORS.rst",
"CHANGELOG.rst",
"README.md",
"LICENSE.txt",
"code-of-conduct.md",
]
[tool.hatch.build.targets.sdist]
include = [
"alembic.ini",
"src/aleph",
"pyproject.toml",
"AUTHORS.rst",
"CHANGELOG.rst",
"README.md",
"LICENSE.txt",
"code-of-conduct.md",
]
[tool.hatch.envs.testing]
features = [
"cosmos",
"nuls2",
"polkadot",
]
dependencies = [
"ipfshttpclient==0.8.0a2", # eth/web3 test dependency, for some reason"
"more-itertools==8.14.0",
"pytest==8.0.1",
"pytest-cov==4.1.0",
"pytest-mock==3.12.0",
"pytest-asyncio==0.23.5",
"pytest-aiohttp==1.0.5",
]
# XXX see https://github.com/aleph-im/pyaleph/blob/main/.github/workflows/pyaleph-ci.yml
[tool.hatch.envs.testing.scripts]
test = "pytest -v {args:.}"
test-cov = "pytest -v --cov {args:.}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
[tool.hatch.envs.linting]
detached = true
dependencies = [
"black==24.2.0",
"mypy==1.2.0",
"mypy-extensions==1.0.0",
"ruff==0.4.8",
"isort==5.13.2",
"check-sdist==0.1.3",
"sqlalchemy[mypy]==1.4.41",
"yamlfix==1.16.1",
# because of aleph messages otherwise yamlfix install a too new version
"pydantic>=1.10.5,<2.0.0",
"pyproject-fmt==2.2.1",
"types-aiofiles",
"types-protobuf",
"types-pytz",
"types-redis",
"types-requests",
"types-setuptools",
]
[tool.hatch.envs.linting.scripts]
typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/"
style = [
"ruff check {args:.}",
"black --check --diff {args:} ./src/ ./tests/",
"isort --check-only --profile black {args:} ./src/ ./tests/",
"yamlfix --check .",
"pyproject-fmt --check pyproject.toml",
]
sdist = "check-sdist --inject-junk"
fmt = [
"black {args:} ./src/ ./tests/",
"ruff check --fix {args:.} ./src/ ./tests/",
"isort --profile black {args:} ./src/ ./tests/",
"yamlfix .",
"pyproject-fmt pyproject.toml",
"style",
]
all = [
"style",
"typing",
"sdist",
]
[tool.isort]
profile = "black"
[tool.check-sdist]
git-only = [
"tests",
"docs",
"deployment",
".coveragerc",
".dockerignore",
"shell.nix",
]
default-ignore = true
[tool.pytest.ini_options]
minversion = "6.0"
pythonpath = [ "src" ]
addopts = "-vv -m \"not ledger_hardware\""
norecursedirs = [ "*.egg", "dist", "build", ".tox", ".venv", "*/site-packages/*" ]
testpaths = [ "tests/unit" ]
markers = { ledger_hardware = "marks tests as requiring ledger hardware" }
[tool.coverage.run]
branch = true
parallel = true
source = [
"src/",
]
omit = [
"*/site-packages/*",
]
[tool.coverage.paths]
source = [
"src/",
]
omit = [
"*/site-packages/*",
]
[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about ineffective code:
"pass",
]
[tool.mypy]
python_version = 3.12
mypy_path = "src"
plugins = [
"sqlalchemy.ext.mypy.plugin",
]
exclude = [
"conftest.py",
]
show_column_numbers = true
# Import discovery
# Install types for third-party library stubs (e.g. from typeshed repository)
install_types = true
non_interactive = true
# Import discovery
# Suppresses error messages about imports that cannot be resolved
ignore_missing_imports = true
# Forces import to reference the original source file
no_implicit_reexport = true
# show error messages from unrelated files
follow_imports = "silent"
follow_imports_for_stubs = false
# Suppressing errors
# Shows errors related to strict None checking, if the global strict_optional
# flag is enabled
strict_optional = true
no_implicit_optional = true
# Disallow dynamic typing
# Disallows usage of types that come from unfollowed imports
disallow_any_unimported = false
# Disallows all expressions in the module that have type Any
disallow_any_expr = false
# Disallows functions that have Any in their signature after decorator transformation.
disallow_any_decorated = false
# Disallows explicit Any in type positions such as type annotations and generic type parameters.
disallow_any_explicit = false
# Disallows usage of generic types that do not specify explicit type parameters.
disallow_any_generics = false
# Disallows subclassing a value of type Any.
disallow_subclassing_any = false
# Untyped definitions and calls
# Disallows calling functions without type annotations from functions with type annotations.
disallow_untyped_calls = false
# Disallows defining functions without type annotations or with incomplete type annotations
disallow_untyped_defs = false
# Disallows defining functions with incomplete type annotations.
check_untyped_defs = false
# Type-checks the interior of functions without type annotations.
disallow_incomplete_defs = false
# Reports an error whenever a function with type annotations is decorated with a decorator without annotations.
disallow_untyped_decorators = false
# Prohibit comparisons of non-overlapping types (ex: 42 == "no")
strict_equality = true
# Configuring warnings
# Warns about unneeded # type: ignore comments.
warn_unused_ignores = true
# Shows errors for missing return statements on some execution paths.
warn_no_return = true
# Shows a warning when returning a value with type Any from a function declared with a non- Any return type.
warn_return_any = false
# Miscellaneous strictness flags
# Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition.
allow_redefinition = true
# XXX does this thing really works?
# Ignore the imported code from py-libp2p
# [mypy-aleph.toolkit.libp2p_stubs.""]
# ignore_errors = True
[tool.yamlfix]
sequence_style = "keep_style"
preserve_quotes = true
whitelines = 1
section_whitelines = 2