-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
178 lines (161 loc) · 4.52 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
[build-system]
requires = [
'setuptools',
# toml is in standard library in 3.11+
'toml>=0.10.1;python_version<"3.11"',
]
build-backend = "setuptools.build_meta"
[project]
dynamic = ["version"]
name = "matic"
authors = [{name = "sterliakov", email = "[email protected]"}]
readme = "README.md"
description = "Python port of matic.js - library to interact with Polygon blockchain"
license = { file = "LICENSE.md" }
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Typing :: Typed",
]
keywords = ["blockchain", "sdk", "ethereum"]
dependencies = [
"eth-utils ~= 1.10.0",
"eth-abi ~= 2.1.1",
"eth-typing ~= 2.3",
"hexbytes ~= 0.3.0",
"pysha3 ~= 1.0.2",
"requests ~= 2.28",
"rlp ~= 2.0.1",
"web3 ~= 5.30.0",
"ethers ~= 0.1.1",
"merkle-patricia-trie ~= 0.3.1",
"typing_extensions ~= 4.3.0",
"python-dotenv",
]
requires-python = ">=3.8"
[tool.setuptools.dynamic]
version = {attr = "matic.__version__"}
[project.optional-dependencies]
test = [
'pytest>=6.4.0',
"pytest-cov",
"pytest-mock",
"pytest-subtests",
"pre-commit",
]
docs = [
'docutils>=0.14,<0.18', # Sphinx haven't upgraded yet
"sphinx>=4.5.0,<5.0.0",
"sphinx-rtd-theme",
"autodocsumm>=0.2.8,<0.3.0",
]
[project.urls]
Home = "https://github.com/sterliakov/pymatic"
Source = "https://github.com/sterliakov/pymatic"
Issues = "https://github.com/sterliakov/pymatic/issues"
Documentation = "https://readthedocs.org/projects/pymatic/badge/?version=latest"
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
markers = [
'can_timeout', # takes forever to finish
'online', # write + return_transaction
'offline', # write (interacts with the chain)
'read', # read only (query)
]
addopts = """
--tb=short
--cov=matic
--no-cov-on-fail
--cov-report=term-missing
--cov-branch
--doctest-modules
--doctest-continue-on-failure
--ignore=docs
--color=yes
"""
[tool.coverage.run]
omit = [
"tests/*",
]
[tool.coverage.report]
exclude_lines = [
# Explicitly ignored
"pragma: no cover",
# Often used in abstract classes
"raise NotImplementedError",
# Debug code
'if self\.debug:',
"def __repr__",
# Scripts entrypoints
"if __name__ == .__main__.:",
# Should never run
'@(abc\.)?abstractmethod',
# Typing artifact, that has no implementation
"@overload",
# Typing artifact, False at runtime
'if (typing\.)?TYPE_CHECKING:'
]
[tool.mypy]
# This applies to all files (not very strict, used for scripts, etc.)
allow_redefinition = true
check_untyped_defs = true
ignore_missing_imports = true
incremental = true
strict_optional = true
no_implicit_optional = true
show_traceback = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
# Enforce stricter validation for library code
[[tool.mypy.overrides]]
module = "matic.*"
# disallow_untyped_defs = true
# disallow_incomplete_defs = true
disallow_any_generics = true
warn_no_return = true
[tool.flake8]
exclude = """
.git,
.github,
__pycache__,
.pytest_cache,
.env,
env,
.pyenv,
pyenv,
*.egg_info,
"""
max_line_length = 88
extend_ignore = [
"SIM905", # Allow statement "hello world".split() instead of list literal
# "N806", # Allow non-"lower_underscore" variables (it's too stupid rule)
"PIE798", # Allow class with only static methods for namespacing
"D105", # Magic methods may remain unannotated
"D401", # Imperative mood of first docstring line is not always encouraged
"RST306", # Plugin can't resolve links defined in other docstrings.
"RST304", # No builtin roles, so too much to do manually.
"RST301", "RST201", # Incompatible with google doc style
"E203", # Invalid. Expressions like `[len(x) :]` conform with PEP8, but raise this.
"D100", # Modules may remain unannotated
"D104", # Packages may remain unannotated
"D107", # __init__ may remain unannotated
]
# Ignore
per-file-ignores = [
"tests/*:D,RST", # We don't care about docstrings in tests.
"matic/json_types.py:A003",
]
max-complexity = 10
# Docstring validation
docstring-convention = "google"
[tool.isort]
profile = "black"