forked from bitvavo/python-bitvavo-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
407 lines (362 loc) · 12.5 KB
/
pyproject.toml
File metadata and controls
407 lines (362 loc) · 12.5 KB
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# https://docs.astral.sh/uv/concepts/projects/layout/
[build-system]
requires = ["uv_build>=0.8.7,<0.9.0"]
build-backend = "uv_build"
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[project]
name = "bitvavo-api-upgraded"
version = "4.4.1"
description = "A unit-tested fork of the Bitvavo API"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "ISC License" }
authors = [
{ name = "Bitvavo BV (original code)" },
{ name = "NostraDavid", email = "55331731+NostraDavid@users.noreply.github.com" },
]
maintainers = [
{ name = "NostraDavid", email = "55331731+NostraDavid@users.noreply.github.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: Pytest",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"License :: OSI Approved :: ISC License (ISCL)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python",
"Typing :: Typed",
]
dependencies = [
"httpx>=0.28.1", # for making http requests
"pydantic-settings >=2.6", # to handle settings
"requests >=2.26", # to make http requests
"returns>=0.23.0", # for functional programming
"structlog>=21.5", # for logging
"websocket-client >=1.2", # something something websocket
]
[tool.uv.build-backend]
module-name = ["bitvavo_api_upgraded", "bitvavo_client"]
[[tool.uv.index]]
# Optional name for the index.
name = "nvidia"
# Required URL for the index.
url = "https://pypi.nvidia.com"
[tool.uv.sources]
cudf-cu12 = { index = "nvidia" }
# versions based on https://github.com/narwhals-dev/narwhals/blob/main/pyproject.toml#L37-L47
[project.optional-dependencies]
cudf = ["cudf-cu12>=24.0.0", "narwhals>=2.0.0"]
dask = ["narwhals[dask]>=2.0.0"]
duckdb = ["narwhals[duckdb]>=2.0.0"]
ibis = ["narwhals[ibis]>=2.0.0"]
modin = ["narwhals[modin]>=2.0.0"]
pandas = ["narwhals[pandas]>=2.0.0"]
polars = ["narwhals[polars]>=2.0.0"]
polars-gpu = ["cudf-polars-cu12>=24.0.0", "polars", "narwhals>=2.0.0"]
# this may work as well - test later
# polars-gpu = ["polars[gpu]", "narwhals>=2.0.0"]
pyarrow = ["narwhals[pyarrow]>=2.0.0"]
pyspark = ["narwhals[pyspark]>=2.0.0"]
pyspark-connect = ["narwhals[pyspark-connect]>=2.0.0"]
sqlframe = ["narwhals[sqlframe]>=2.0.0"]
[project.urls]
homepage = "https://github.com/Thaumatorium/bitvavo-api-upgraded"
repository = "https://github.com/Thaumatorium/bitvavo-api-upgraded"
changelog = "https://github.com/Thaumatorium/bitvavo-api-upgraded/blob/master/CHANGELOG.md"
# https://docs.astral.sh/uv/
[tool.uv]
dev-dependencies = [
"bump-my-version>=0.28.1", # for version management of the lib
"coverage[toml]>=7.6.9", # for checking coverage; use this in tox vs pytest-cov, since pytest-cov does NOT play well with vscode
"duckdb>=1.0.0", # DuckDB for testing (lightweight)
"eval-type-backport>=0.2.2", # eval type for mypy
"mdformat>=0.7.11", # for formatting markdown (.md) documents
"mkdocs>=1.2.3", # for markdown documentation
"mypy>=1.13", # amazing linter
"narwhals[dask,duckdb,pandas,polars,pyarrow]>=2.0.0", # unified dataframe API with all integrations for testing
"pandas-stubs>=2.2.2.0", # pandas typing for mypy
"pandas>=2.0.0", # pandas support for testing
"polars>=1.0.0", # polars support for testing
"pre-commit>=2.15.0", # for running hooks before committing code
"pyarrow>=7.0.0", # Arrow tables for testing
"pytest-cov>=1", # though this was the initial choice over coverage.py, turns out it fucks with vscode debugging, so now it only exists so we can still run tests with coverage within vscode
"pytest-dotenv>=0.5.2", # for loading environment variables from .env files in tests
"pytest-integration>=0.2.2", # for @mark additions
"pytest-mock>=3.6.1", # for the `mocker` MockerFixture fixture
"pytest>=6.2.4", # you can run `pytest` to run the unit tests; will also be run by `tox` :)
"ruff>=0.7.3", # replaces auotflake, black, flake8, isort, pyupgrade
"tox-uv>=1.16.0", # to ensure tox can use uv
"tox>=3.24.4", # run `tox` to test everything
"types-requests>=2.26.2", # typing for mypy
"uv>=0.8.0", # project manager (building, version bump, etc.)
]
[tool.bumpversion]
current_version = "4.4.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "[VERSIONBUMP][{now:%Y-%m-%d}]: {current_version} -> {new_version}"
allow_dirty = false
commit = true
message = "[VERSIONBUMP][{now:%Y-%m-%d}]: {current_version} -> {new_version}"
commit_args = "--no-verify"
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "$UNRELEASED"
replace = "v{new_version} - {now:%Y-%m-%d}"
[tool.coverage.run]
branch = true
source = ["bitvavo_api_upgraded", "bitvavo_client"]
parallel = true
relative_files = true
omit = ["docs/*", "scripts/*", "tests/*"]
[tool.coverage.paths]
omit = [
"*/__init__.py", # Optionally omit __init__ files
]
[tool.coverage.report]
fail_under = 30
precision = 0
show_missing = true
skip_covered = true
skip_empty = true
sort = "Cover"
exclude_lines = [
"pragma: no cover", # Common usage for excluding lines from coverage
"if __name__ == .__main__.:", # Skip lines commonly used in scripts
]
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
# created for mypy 1.13
# Import discovery
mypy_path = ".venv/bin/mypy"
files = ["^src/**/*.py"]
# mypy doesn't use .gitignore, so we have to sort of sync folders...
exclude = [
"^build/.*",
"^coverage_html_report/.*",
"^dist/.*",
"^docs/.*",
"^notebooks/.*",
"^result/.*",
"^settings/.*",
"^tests/.*",
]
explicit_package_bases = false
ignore_missing_imports = true
follow_imports = "normal"
follow_imports_for_stubs = true
python_executable = ".venv/bin/python"
no_site_packages = false
no_silence_site_packages = false
# Platform configuration
python_version = "3.9"
platform = "linux"
# Disallow dynamic typing
disallow_any_unimported = true
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = true
disallow_subclassing_any = true
# Untyped definitions and calls
disallow_untyped_calls = true
# untyped_calls_exclude = []
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
# None and Optional handling
implicit_optional = false
strict_optional = true
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# Suppressing errors
ignore_errors = false
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
# disable_error_code = []
# enable_error_code = ["ignore-without-code"]
implicit_reexport = true
strict_concatenate = false
strict_equality = true
strict = false
# Configuring error messages
show_error_context = false
show_column_numbers = true
show_error_code_links = true
hide_error_codes = false
pretty = false
color_output = true
error_summary = true
show_absolute_path = false
force_uppercase_builtins = false
force_union_syntax = false
# Incremental mode
incremental = true
cache_dir = ".mypy_cache"
sqlite_cache = false
cache_fine_grained = true
skip_version_check = false
skip_cache_mtime_checks = false
# Advanced options
plugins = ["pydantic.mypy"]
pdb = false
show_traceback = false
raise_exceptions = false
# custom_typing_module = ""
# custom_typeshed_dir = ""
warn_incomplete_stub = false
# Report generation
# !!!
# Generating reports disables incremental mode and can significantly slow down
# your workflow. It is recommended to enable reporting only for specific runs
# (e.g. in CI).
# any_exprs_report = ""
# cobertura_xml_report = ""
# html_report = ""
# linecount_report = ""
# linecoverage_report = ""
# lineprecision_report = ""
# txt_report = ""
# xml_report = ""
# Miscellaneous
# junit_xml = ""
scripts_are_modules = false
warn_unused_configs = true
verbosity = 0
# [[tool.mypy.overrides]]
# module = [
# "setuptools",
# "structlog",
# "requests",
# "websocket",
# "dotenv.main",
# "pytest",
# "structlog.stdlib",
# ]
# ignore_missing_imports = true
[tool.black]
line-length = 120
include = "(src|tests)/.*.py"
[tool.isort]
line_length = 120
profile = "black"
src_paths = ["src", "tests"]
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"--durations-min=1",
"--verbosity=2",
"--no-header",
"--show-capture=all",
]
testpaths = ["tests/"]
pythonpath = ["src"]
markers = ["no_cover: some pytest-integration default mark that's not known?."]
python_classes = "Test*"
python_files = "test_*.py"
python_functions = "test_*"
# https://docs.astral.sh/ruff/configuration/
[tool.ruff]
# By default, Ruff will also skip any files that are omitted via .ignore,
# .gitignore, .git/info/exclude, and global gitignore files
respect-gitignore = true
# The default serialization format is "full" [env: RUFF_OUTPUT_FORMAT=]
# [possible values: concise, full, json, json-lines, junit, grouped, github,
# gitlab, pylint, rdjson, azure, sarif]
output-format = "concise"
line-length = 120
indent-width = 4
# Assume Python 3.10
target-version = "py310"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D", # pydocstyle
"S101", # (assert)
"TRY400", # (error-instead-of-exception)
"PD901", # (pandas-df-variable-name
"RET504", # (unnecessary-assign) - true, but handy when I need to debug and inspect.
"FIX001", # (line-contains-fixme)
"FIX002", # (line-contains-todo)
"TD003", # (missing-todo-link) - I'm not linking every time TODO to an issue...
"COM812", # (missing-trailing-comma)
"ISC001", # (single-line-implicit-string-concatenation)
"ANN401", # (any-type)
# above this, is based on some other project
"N802", # (invalid-function-name) - this is due to how Bitvavo defined their functions
"N803", # invalid-argument-name
"N806", # (non-lowercase-variable-in-function)
"FBT003", # (boolean-positional-value-in-call) - same as N802
"T201", # (print)
"PLR0913", # (too-many-arguments) Bitvavo API simply has a lot of arguments.
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = [
"T201", # print found; don't fix, but don't ignore either!
]
# Allow unused variables when underscore-prefixed.
# dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
[tool.ruff.lint.extend-per-file-ignores]
# These are the rules we can ignore for tests
"tests/**/*.py" = [
"S101", # (assert)
"S105", # (hardcoded-password-string) - test secrets are not real secrets
"ARG", # (flake8-unused-arguments)
"FBT", # (flake8-boolean-trap)
"PLR2004", # (magic-value-comparison)
"S311", # (suspicious-non-cryptographic-random-usage)
"TRY301", # (raise-within-try)
]