forked from ansatzcapital/dilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
120 lines (109 loc) · 3.01 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
[build-system]
requires = ["setuptools >= 42", "setuptools_scm[toml] >= 3.4", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "dilib/version.py"
# Using default version scheme
[tool.mypy]
# Adapted from https://careers.wolt.com/en/blog/tech/professional-grade-mypy-configuration
# and https://justincaustin.com/blog/mypy-tips-and-tricks/
disallow_untyped_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
show_error_codes = true
warn_unused_ignores = true
#disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
follow_imports = "normal"
ignore_missing_imports = true
# Many third-party libraries don't explicitly export public API
#no_implicit_reexport = true
#show_error_context = true
strict_equality = true
strict_optional = true
warn_redundant_casts = true
# See https://mypy-lang.blogspot.com/2023/08/mypy-15-released.html
enable_error_code = ["explicit-override"]
[tool.pyright]
include = ["**/*.py"]
exclude = ["**/__pycache__", "**/.*"]
# To enable strict mode:
#strict = ["**/*.py"]
# Many third-party libraries don't explicitly export public API
reportPrivateImportUsage = "none"
[tool.ruff]
target-version = "py38"
line-length = 79
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
[tool.ruff.format]
# https://docs.astral.sh/ruff/formatter/
quote-style = "double"
indent-style = "space"
[tool.ruff.lint]
select = [
# https://beta.ruff.rs/docs/rules/#pyflakes-f
"F",
# https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
"E",
"W",
# https://beta.ruff.rs/docs/rules/#mccabe-c90
"C90",
# https://beta.ruff.rs/docs/rules/#isort-i
"I",
# https://beta.ruff.rs/docs/rules/#pep8-naming-n
"N",
# https://beta.ruff.rs/docs/rules/#pydocstyle-d
"D",
# https://beta.ruff.rs/docs/rules/#pyupgrade-up
"UP",
# https://beta.ruff.rs/docs/rules/#flake8-annotations-ann
"ANN",
# https://beta.ruff.rs/docs/rules/#flake8-blind-except-ble
"BLE",
# https://beta.ruff.rs/docs/rules/#flake8-bugbear-b
"B",
# https://beta.ruff.rs/docs/rules/#flake8-builtins-a
"A",
]
ignore = [
"D100", "D101", "D102", "D103", "D104", "D105", "D107", "D417",
"ANN101", "ANN102", "ANN401",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.isort]
force-sort-within-sections = true
section-order = [
"future", "standard-library", "third-party", "first-party", "local-folder"
]
single-line-exclusions = ["collections.abc", "typing", "typing_extensions"]
[tool.ruff.lint.pydocstyle]
convention = "google"