-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
247 lines (235 loc) · 8.89 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
[build-system]
requires = ["flit_core==3.9.0"]
build-backend = "flit_core.buildapi"
[project]
name = "boilercore"
version = "0.0.4"
description = "Common functionality of boiler repositories."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
classifiers = ["License :: OSI Approved :: MIT License"]
dependencies = [
"dill>=0.3.7",
"dulwich>=0.21.5",
"gmpy2>=2.1.5",
"ipykernel>=6.29.0",
"loguru>=0.7.0",
"matplotlib>=3.7.2",
"nbformat>=5.9.2",
"nbconvert>=7.7.3",
"numpy>=1.24.4",
"pandas[hdf5,performance]>=2.0.2",
"ploomber-engine>=0.0.30",
"pydantic>=2",
"pytest>=7.4.0",
"ruamel.yaml>=0.17.32",
"scipy>=1.11.1",
"sympy>=1.12",
"uncertainties>=3.1.7",
]
[[project.authors]]
name = "Blake Naccarato, Kwang Jin Kim"
email = "[email protected]"
[project.urls]
Changes = "https://blakeNaccarato.github.io/boilercore/changelog.html"
Docs = "https://blakeNaccarato.github.io/boilercore"
Home = "https://github.com/blakeNaccarato/boilercore"
Tracker = "https://github.com/blakeNaccarato/boilercore/issues"
[tool.fawltydeps]
output_format = "human_detailed"
code = ["src"]
deps = ["pyproject.toml"]
# * ---------------------------------------------------------------------------------- *
ignore_undeclared = [
"cachier", # Can't specify my fork here for now. Used only in tests
"dvc", # Optional dependency for `boilercore.notebooks.report`
]
ignore_unused = [
"gmpy2", # for faster sympy computations
"nbconvert", # boilercv.pre_repro.export_notebook
"pyarrow", # boilercv.init: pd.set_option("mode.string_storage", "pyarrow")
]
[tool.fawltydeps.custom_mapping]
ipykernel = ["IPython"]
# * ---------------------------------------------------------------------------------- *
[tool.pytest.ini_options]
addopts = '''
--strict-config
--strict-markers
--color yes
-p no:legacypaths
-r a
'''
cache_dir = ".cache/.pytest_cache"
markers = "slow"
testpaths = "tests"
xfail_strict = true
[tool.coverage.run]
branch = true
source = ["boilercore"]
[tool.coverage.report]
ignore_errors = true
[tool.pyright]
exclude = ["**/node_modules", "**/__pycache__", "**/.*", "submodules"]
stubPath = "submodules/typings"
typeCheckingMode = "strict"
# Default "true" in strict
analyzeUnannotatedFunctions = true
strictParameterNoneValue = true
enableTypeIgnoreComments = true
disableBytesTypePromotions = true
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
# Default "false" in strict
deprecateTypingAliases = false
enableExperimentalFeatures = false
# Default "warning" in strict
reportMissingModuleSource = "warning"
# Default "error" in strict
reportMissingImports = "warning"
reportUndefinedVariable = "warning"
reportAssertAlwaysTrue = "warning"
reportInvalidStringEscapeSequence = "warning"
reportInvalidTypeVarUse = "warning"
reportMissingTypeStubs = "none" # Overeager
reportSelfClsParameterName = "warning"
reportUnsupportedDunderAll = "warning"
reportUnusedExpression = "none" # Handled by Ruff
reportWildcardImportFromLibrary = "warning"
reportGeneralTypeIssues = "warning"
reportOptionalSubscript = "warning"
reportOptionalMemberAccess = "warning"
reportOptionalCall = "warning"
reportOptionalIterable = "warning"
reportOptionalContextManager = "warning"
reportOptionalOperand = "warning"
reportTypedDictNotRequiredAccess = "warning"
reportPrivateImportUsage = "none" # Flaky regarding "not exported"
reportUnboundVariable = "warning"
reportUnusedCoroutine = "none" # Handled by Ruff
reportFunctionMemberAccess = "warning"
reportIncompatibleMethodOverride = "warning"
reportIncompatibleVariableOverride = "warning"
reportOverlappingOverload = "warning"
reportConstantRedefinition = "none"
reportDeprecated = "warning"
reportDuplicateImport = "warning"
reportIncompleteStub = "warning"
reportInconsistentConstructor = "warning"
reportInvalidStubStatement = "warning"
reportMatchNotExhaustive = "warning"
reportMissingParameterType = "none"
reportMissingTypeArgument = "warning"
reportPrivateUsage = "none" # Ruff checks this well enough
reportTypeCommentUsage = "warning"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"
reportUnnecessaryCast = "warning"
reportUnnecessaryComparison = "warning"
reportUnnecessaryContains = "warning"
reportUnnecessaryIsInstance = "warning"
reportUnusedClass = "none" # Handled by Ruff
reportUnusedImport = "none" # Handled by Ruff
reportUnusedFunction = "none" # Handled by Ruff
reportUnusedVariable = "none" # Handled by Ruff
reportUntypedBaseClass = "none"
reportUntypedClassDecorator = "warning"
reportUntypedFunctionDecorator = "none" # Often out of our control
reportUntypedNamedTuple = "warning"
# Default "none" in strict
reportCallInDefaultInitializer = "none"
reportImplicitOverride = "none"
reportImplicitStringConcatenation = "none"
reportImportCycles = "none"
reportMissingSuperCall = "none"
reportPropertyTypeMismatch = "none"
reportShadowedImports = "none"
reportUninitializedInstanceVariable = "warning" # Ensure we define instance vars
reportUnnecessaryTypeIgnoreComment = "none"
reportUnusedCallResult = "none"
[tool.ruff]
cache-dir = ".cache/.ruff_cache"
extend-exclude = ["submodules"]
extend-include = ["*.ipynb"]
fix = true
force-exclude = true
show-fixes = true
output-format = "grouped"
preview = true
unsafe-fixes = false
[tool.ruff.lint]
fixable = ["ALL"]
select = ["ALL"]
extend-ignore = [
"ANN", # Don't require type annotations
"ARG005", # Allow unused lambda argument. For consistency across df pipelines.
"C408", # Allow dict calls
"COM", # Allow magic commas and magic missing commas
"CPY001", # Don't check for copyright
"D10", # Missing docstrings
"D20", # Don't reformat docstrings in these ways
"D213", # Multi-line docstring summary should start at the second line
"D402", # False positives for parens in first line
"D412", # Allow blanks below headers in Google-style docstrings
"DTZ", # Timezones are important, but only contextually necessary.
"E501", # Don't check line length. Black handles this.
"EM", # Don't check for exception message issues
"ERA", # False positives. Don't get rid of commented out code.
"FBT", # Allow boolean "traps"
"FIX002", # Allow TODOs
"FLY002", # Allow different string representations
"FURB140", # Don't replace comprehensions with starmap
"G0", # Allow f-strings, etc. in Loguru logging
"INP001", # False positives. Checks for packages missing `__init__.py`
"ISC", # False positives. Implicit string concatenation is fine.
"PD013", # Allow `stack` instead of `melt`. They're not a direct swap.
"PD101", # Allow use of nunique(). False positives
"PD901", # Allow `df` variable name. We are all consenting adults here.
"PD011", # Allow use of `.values`. False positives.
"PLR6201", # Don't require set literal for membership checks
"PGH003", # Until black stops wrapping special ignores, let's allow bare
"PIE804", # Allow dict unpack even if unnecessary, consisent for df.assign{**...}
"PLR0913", # Allow more than five function arguments
"PLR2004", # Allow magic values. This check is too sensitive
"PLW2901", # For loop variable
"RET", # Return checks are flaky, Sourcery does fine analysing these paths
"S301", # Don't warn about pickling. Allow me to shoot myself in the foot.
"TCH", # Type checking linter doesn't play nicely with pydantic
"TD", # Disable to-do validation. Too pedantic for now.
"TRY003", # Allow long exception messages
"W2", # Allow whitespace issues. Fixed automatically by black.
]
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint.isort]
split-on-trailing-comma = false
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.extend-per-file-ignores]
# * ---------------------------------------------------------------------------------- *
"src/*/models/**" = [
"RUF012", # False positives for Pydantic v2 when importing via `pydantic.v1`
]
# * ---------------------------------------------------------------------------------- *
"**/*.ipynb" = [
"B018", # Allow "useless" expressions, which do suppress outputs in notebooks
"F821", # Allow undefined names, such as `display`
"S101", # Allow assert
"T201", # Allow print in notebooks
]
"docs/**" = [
"E402", # Need to allow imports below patches in docs notebooks
]
"tests/**" = [
"ARG001", # Allow unused arguments
"S101", # Allow assert
"SIM300", # Allow constants (expectations) on the RHS
"SLF001", # Allow private member access in tests
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["typer.Argument", "typer.Option"]