-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
287 lines (250 loc) · 7.1 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
# -*- coding: utf-8 -*-
#
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# All rights reserved.
# https://github.com/btschwertfeger
#
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "kraken-infinity-grid"
dynamic = ["version"]
authors = [
{ name = "Benjamin Thomas Schwertfeger", email = "contact@b-schwertfeger.de" },
]
description = "Infinity grid trading algorithm for the Kraken cryptocurrency exchange."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
dependencies = [
"asyncio~=3.4",
"click~=8.1",
"cloup~=3.0",
"python-kraken-sdk>=3.1.6,<3.2",
"requests~=2.32",
"psycopg2-binary~=2.9",
"sqlalchemy~=2.0",
]
keywords = ["crypto", "trading", "kraken", "exchange", "api"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: AsyncIO",
"Framework :: Pytest",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Unix",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Office/Business :: Financial :: Investment",
"Topic :: Office/Business :: Financial",
"Typing :: Typed",
]
[project.optional-dependencies]
dev = ["mypy", "black", "ruff"]
test = ["pytest", "pytest-cov", "pytest-asyncio"]
[project.scripts]
kraken-infinity-grid = "kraken_infinity_grid.cli:cli"
[tool.setuptools]
include-package-data = false
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
include = ["kraken_infinity_grid*"]
exclude = [".env", "tests", ".venv", "tools", ".github", ".cache"]
[tool.setuptools_scm]
write_to = "src/kraken_infinity_grid/_version.py"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
# ========= T E S T I N G ======================================================
#
[tool.pytest]
junit_family = "xunit2"
testpaths = ["tests"]
[tool.pytest.ini_options]
cache_dir = ".cache/pytest"
markers = [
"asyncio: used for async tests.",
"integration: used for integration tests.",
"wip: used for wip tests.",
]
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
"ignore:The .*async_close.* function is deprecated:DeprecationWarning:",
"ignore:The .*stop.* function is deprecated:DeprecationWarning:",
]
[tool.coverage.run]
source = ["."]
omit = ["*tests*", "_version.py"]
[tool.coverage.report]
exclude_lines = ["coverage: disable", "if TYPE_CHECKING:"]
skip_empty = true
[tool.codespell]
check-filenames = true
# ========= T Y P I N G ========================================================
#
[tool.mypy]
python_version = "3.11"
# junit_xml = "mypy.xml"
files = ["src/kraken_infinity_grid/*.py"]
exclude = ["tests/*"]
cache_dir = ".cache/mypy"
sqlite_cache = true
cache_fine_grained = true
# Disallow dynamic typing
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
disallow_subclassing_any = false
# Untyped definitions and calls
check_untyped_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = false
# None and Optional handling
implicit_optional = true
strict_optional = false
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# Suppressing errors
ignore_errors = false
# Configuring error messages
show_error_context = true
show_column_numbers = true
hide_error_codes = false
pretty = true
color_output = true
show_absolute_path = true
ignore_missing_imports = true
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
# disable_error_code = xxx,xxx
implicit_reexport = true
strict_concatenate = false
strict_equality = true
strict = true
# ========= L I N T I N G ======================================================
#
[tool.ruff]
cache-dir = ".cache/ruff"
respect-gitignore = true
exclude = []
line-length = 130
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"AIR", # Airflow
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"ASYNC1", # flake8-trio
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C", # pylint convention
"C4", # flake8-comprehensions
"COM", # flake8-commas
"CPY", # flake8-copyright
"E", # pylint error
"F", # pyflakes
"FA", # flake8-future-annotations
# "FBT", # flake8-boolean-trap
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"ISC", # flake8-implicit-string-concat
"LOG", # flake8-logging
"N", # PEP8 naming
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # PyLint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"R", # pylint refactor
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
# "W", # pylint warning
# "D", # pydocstyle | sphinx format not supported
# "ERA", # eradicate - commented-out code
# "FIX", # flake8-fixme
# "TD", # flake8-todos
# "TRY", # tryceratops # specify exception messages in class; not important
]
fixable = ["ALL"]
ignore = [
"PLR2004", # magic value in comparison
"PLR6301", # Method `…` could be a function or static method # false positive for no-self-use
]
task-tags = ["todo", "TODO", "fixme", "FIXME"]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"E501", # line to long
"F841", # unused variable
"N802", # PEP8 naming
"S101", # assert use
"S106", # hardcoded password
"S110", # try-except-pass without logging
"S311", # pseudo-random-generator
"SLF001", # private member access
"TID252", # ban relative imports
"N999", # Invalid module name
]
"tools/*.py" = [
"T201", # `print` found
"E501", # Line too long
]
"tools/generate_ws_messages.py" = [
"S311", # pseudo-random-generator
]
"tools/backtesting/Backtesting.ipynb" = [
"CPY001", # Copyright
]
[tool.ruff.lint.flake8-copyright]
author = "Benjamin Thomas Schwertfeger"
notice-rgx = "(?i)Copyright \\(C\\) \\d{4}"
min-file-size = 1024
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
[tool.ruff.lint.flake8-type-checking]
strict = true
[tool.ruff.lint.pep8-naming]
ignore-names = ["i", "j", "k", "_"]
[tool.ruff.lint.pylint]
max-args = 8
max-branches = 15
max-returns = 6
max-statements = 50
allow-magic-value-types = ["int"]