-
Notifications
You must be signed in to change notification settings - Fork 16
/
pyproject.toml
154 lines (146 loc) · 4.49 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
[build-system]
requires = [
"setuptools",
"wheel",
]
[tool.ruff]
target-version = "py39"
line-length = 120
format.preview = true
lint.select = [
"D", # see: https://pypi.org/project/pydocstyle
"E",
"F", # see: https://pypi.org/project/pyflakes
"I", #see: https://pypi.org/project/isort/
"N", # see: https://pypi.org/project/pep8-naming
"RUF100", # see: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"S", # see: https://pypi.org/project/flake8-bandit
"UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # see: https://pypi.org/project/pycodestyle
]
lint.extend-select = [
"A", # see: https://pypi.org/project/flake8-builtins
"ANN", # see: https://pypi.org/project/flake8-annotations
"B", # see: https://pypi.org/project/flake8-bugbear
"C4", # see: https://pypi.org/project/flake8-comprehensions
"EXE", # see: https://pypi.org/project/flake8-executable
"ISC", # see: https://pypi.org/project/flake8-implicit-str-concat
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PT", # see: https://pypi.org/project/flake8-pytest-style
"Q", # see: https://pypi.org/project/flake8-quotes
"RET", # see: https://pypi.org/project/flake8-return
"RUF", # Ruff-specific rules
"SIM", # see: https://pypi.org/project/flake8-simplify
"T10", # see: https://pypi.org/project/flake8-debugger
"TID", # see: https://pypi.org/project/flake8-tidy-imports/
"YTT", # see: https://pypi.org/project/flake8-2020
]
lint.ignore = [
"E731",
]
lint.per-file-ignores."__about__.py" = [
"D100",
]
lint.per-file-ignores."__init__.py" = [
"D100",
]
lint.per-file-ignores."docs/source/conf.py" = [
"A001",
"ANN001",
"ANN201",
"D100",
"D103",
]
lint.per-file-ignores."setup.py" = [
"ANN202",
"D100",
"SIM115",
]
lint.per-file-ignores."src/**" = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any)
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D107", # Missing docstring in `__init__`
]
lint.per-file-ignores."tests/**" = [
"ANN001", # Missing type annotation for function argument
"ANN101", # Missing type annotation for `self` in method
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method
"ANN401", # Dynamically typed expressions (typing.Any)
"B028", # No explicit `stacklevel` keyword argument found
"B905", # `zip()` without an explicit `strict=` parameter
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"S101", # Use of `assert` detected
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]
lint.mccabe.max-complexity = 10
# Use Google-style docstrings.
lint.pydocstyle.convention = "google"
lint.ignore-init-module-imports = true
[tool.codespell]
#skip = '*.py'
quiet-level = 3
# comma separated list of words; waiting for:
# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603
# also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
#ignore-words-list = ""
[tool.docformatter]
recursive = true
# this need to be shorter as some docstings are r"""...
wrap-summaries = 119
wrap-descriptions = 120
blank = true
[tool.check-manifest]
ignore = [
"*.yml",
".github",
".github/*",
]
[tool.pytest.ini_options]
norecursedirs = [
".git",
".github",
"dist",
"build",
"docs",
]
addopts = [
"--strict-markers",
"--doctest-modules",
"--durations=25",
"--color=yes",
"--disable-pytest-warnings",
]
markers = [
"online: run tests that require internet connection",
]
filterwarnings = [
"error::FutureWarning",
] # todo: "error::DeprecationWarning"
xfail_strict = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pass",
]
[tool.coverage.run]
parallel = true
concurrency = "thread"
relative_files = true
[tool.mypy]
files = [
"src/lightning_utilities",
]
disallow_untyped_defs = true