This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
197 lines (176 loc) · 4.29 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
# --- build-system -----------------------------------------------------------
# ref: https://packaging.python.org/en/latest/tutorials/packaging-projects/
# these should match the "setup-requires" packages in `setup.cfg`
[build-system]
requires = [
"artifacts-keyring",
"build",
"keyring",
"setuptools>=42",
"twine",
]
build-backend = "setuptools.build_meta"
# --- black ------------------------------------------------------------------
# ref: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
[tool.black]
line-length = 100
# target-version = ['py39']
include = '\.pyi?$|\.ipynb$'
extend-exclude = '''
# # A regex preceded with ^/ will apply only to files and directories
# # in the root of the project.
# ^/foo.py # exclude a file named foo.py in the root of the project (in addition to the defaults)
\.ipynb_checkpoints$|^/\.env|^/\.git|^/\.nox|^/\.pytest_cache|^/\.tox
'''
# --- ruff -------------------------------------------------------------------
[tool.ruff]
select = [
'A', # flake8 builtins
'B', # flake8 bugbear
'C4', # flake8 comprehensions
'C90', # mccabe
'D', # pydocstyle
'E', # pycodestyle
'F', # pyflakes
'I', # isort
'N', # pep8-naming
# 'PTH', # flake8-use-pathlib
'Q', # flake8-quotes
'S', # bandit
'SIM', # flake8-simplify
'TRY', # tryceratops
'W', # pycodestyle
# 'T20', # flake8 print
]
# Avoid trying to fix extension types:
unfixable = ["B"]
ignore = [
"B905", # zip strict=True; remove once python <3.10 support is dropped.
# "E203", # not in ruff
# "E265", # not in ruff
# "E266", # not in ruff
"E501", # line too long
"F401", # unused import
"F403", # import *
"F405", # defined from import *
# "F541", # f-string missing placeholders
"S101", # assert
"SIM105", # allow except: pass
"TRY003", # Avoid specifying messages outside exception class; overly strict, especially for ValueError
"TRY201", # Allow raise without exception name (align with Sonarlint)
# "W503", # not in ruff
]
[per-file-ignores]
# # Ignore `E402` (import violations) in all `__init__.py` files,
# # and in `path/to/file.py`.
# "__init__.py" = ["E402"]
# "path/to/file.py" = ["E402"]
"notebooks/*" = ["D"]
exclude = [
"*.egg-info",
".direnv",
".eggs",
".env",
".envrc",
".git",
".ipynb_checkpoints",
".nox",
".pytest_cache",
".ruff_cache",
".tox",
".venv",
"__pypackages__",
"_build",
"ci/templates",
"build",
"dist",
"docs/conf.py",
"venv",
]
# Default autofix behavior
fix = true
# Max line length
line-length = 119
# Directories with source code
src = ["notebooks", "src", "tests"]
# Assumed Python version
target-version = "py39"
# --- ruff plugins --------------------
[tool.ruff.flake8-bugbear]
extend-immutable-calls = [
"chr",
"typer.Argument",
"typer.Option",
]
[tool.ruff.isort]
combine-as-imports = true
force-sort-within-sections = true
force-wrap-aliases = true
# extra-standard-library = ["path"]
known-first-party = ["ds_utils","src",]
[tool.ruff.mccabe]
max-complexity = 18
[tool.ruff.pep8-naming]
ignore-names = []
[tool.ruff.pydocstyle]
convention = "numpy"
# --- pytest -----------------------------------------------------------------
# ref: https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
addopts = '''
-ra
--strict-markers
--ignore=docs/conf.py
--ignore=setup.py
--ignore=ci
--ignore=.eggs
--tb=short
'''
# --doctest-modules
# --doctest-glob=\*.rst
norecursedirs = [
".env",
".git",
".nox",
".pytest_cache",
".tox",
"__pycache__",
"dist",
"docs",
"build",
"migrations",
"notebooks",
"writeup",
]
python_files = [
"test_*.py",
"*_test.py",
"tests.py",
]
testpaths = [
"tests",
]
# log_cli = true
# --- coverage ---------------------------------------------------------------
[tool.coverage.paths]
source = ["src", "*/site-packages"]
[tool.coverage.run]
branch = true
source = ["src"]
[tool.coverage.report]
show_missing = true
# --- check-manifest ---------------------------------------------------------
# ref: https://github.com/mgedmin/check-manifest
[tool.check-manifest]
ignore = [
".ci/",
"data/",
"docker/",
"functions/",
"notebooks/",
"queries/",
"writeup/",
"noxfile.py",
"*.md",
".*",
]