-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
304 lines (297 loc) · 11.2 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
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
[build-system]
requires = ["flit_core==3.9.0"]
build-backend = "flit_core.buildapi"
[project]
name = "boilerdaq"
version = "2024.1.2"
description = "Data acquisition for a nucleate pool boiling experimental apparatus"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.11"
classifiers = [
"License :: OSI Approved :: MIT License",
# ? Also in CI (https://github.com/actions/python-versions/releases)
# "Programming Language :: Python :: 3.7", # ? EOL (https://devguide.python.org/versions/)
# "Programming Language :: Python :: 3.8", # ? EOL soon (https://devguide.python.org/versions/)
# "Programming Language :: Python :: 3.9", # ? `sphinx-autobuild` broken even when pointing to fix (https://github.com/sphinx-doc/sphinx-autobuild/issues/166)
# "Programming Language :: Python :: 3.10", # ? `boilercore` uses some 3.11-specific features
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# "Programming Language :: Python :: 3.13", # ? (via myst-nb) https://github.com/crate-py/rpds/issues/72
# "Programming Language :: Python :: 3.14", # ? Unreleased (https://peps.python.org/pep-0745)
]
dependencies = [
"boilercore>=2024.1.3",
"libusb>=1.0.27",
"mcculw>=1.0.0",
"pandas[hdf5,performance]>=2.2.0",
"pydantic>=2.6.1",
"pyqtgraph>=0.13.3",
"pyvisa>=1.14.1",
"pyusb>=1.2.1",
"pyvisa-py>=0.7.2",
"simple-pid>=2.0.0",
"pyvisa-sim>=0.6.0",
"uldaq>=1.2.3",
"zeroconf>=0.132.2",
]
[project.urls]
Changes = "https://softboiler.github.io/boilerdaq/changelog.html"
Docs = "https://softboiler.github.io/boilerdaq"
Home = "https://github.com/softboiler/boilerdaq"
Tracker = "https://github.com/softboiler/boilerdaq/issues"
[[project.authors]]
name = "Blake Naccarato"
email = "[email protected]"
[tool.coverage.run]
branch = true
source = ["boilerdaq", "boilerdaq_docs", "boilerdaq_tests", "boilerdaq_tools"]
[tool.fawltydeps]
deps = ["pyproject.toml"]
code = ["src"]
ignore_undeclared = ["PySide6"]
ignore_unused = ["libusb", "pyusb", "pyvisa-py", "pyvisa-sim", "zeroconf"]
[tool.fawltydeps.custom_mapping]
boilercore = ["boilercore"]
[tool.pytest.ini_options]
# ! https://github.com/pytest-dev/pytest-cov/issues/479#issuecomment-1247444988
addopts = '''
--strict-config
--strict-markers
--suppress-no-test-exit-code
--color=yes
-p no:legacypaths
-r a
--cov
--cov-config=pyproject.toml
--cov-report=xml
'''
cache_dir = ".cache/.pytest_cache"
markers = "slow"
testpaths = "tests"
xfail_strict = true
[tool.towncrier]
directory = "changelog"
filename = "CHANGELOG.md"
template = "changelog/towncrier_template.md.jinja"
title_format = ""
issue_format = "[#{issue}](https://github.com/softboiler/boilerdaq/issues/{issue})"
underlines = ["", "", ""]
[[tool.towncrier.section]]
path = ""
[[tool.towncrier.type]]
directory = "breaking"
name = "Backwards-incompatible changes"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true
[tool.pyright]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/.*",
"**/.*/**",
"**/.venv",
"**/.vscode/extensions",
"**/AppData",
"bin",
"submodules/template",
"submodules/**/docs",
"submodules/**/scripts",
"submodules/**/tests",
]
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"
reportInvalidTypeForm = "warning"
reportUndefinedVariable = "warning"
reportAssertAlwaysTrue = "warning"
reportInvalidStringEscapeSequence = "warning"
reportInvalidTypeVarUse = "warning"
reportMissingTypeStubs = "none" # Overeager
reportSelfClsParameterName = "warning"
reportUnsupportedDunderAll = "warning"
reportUnusedExpression = "none" # Handled by Ruff
reportWildcardImportFromLibrary = "warning"
reportAbstractUsage = "warning"
reportArgumentType = "warning"
reportAssertTypeFailure = "warning"
reportAssignmentType = "warning"
reportAttributeAccessIssue = "warning"
reportCallIssue = "warning"
reportGeneralTypeIssues = "warning"
reportInconsistentOverload = "warning"
reportIndexIssue = "warning"
reportInvalidTypeArguments = "warning"
reportNoOverloadImplementation = "warning"
reportOperatorIssue = "warning"
reportOptionalSubscript = "warning"
reportOptionalMemberAccess = "warning"
reportOptionalCall = "warning"
reportOptionalIterable = "warning"
reportOptionalContextManager = "warning"
reportOptionalOperand = "warning"
reportRedeclaration = "warning"
reportReturnType = "warning"
reportTypedDictNotRequiredAccess = "warning"
reportPrivateImportUsage = "none" # Flaky regarding "not exported"
reportUnboundVariable = "warning"
reportUnusedCoroutine = "none" # Handled by Ruff
reportUnusedExcept = "warning"
reportFunctionMemberAccess = "warning"
reportIncompatibleMethodOverride = "warning"
reportIncompatibleVariableOverride = "warning"
reportOverlappingOverload = "warning"
reportPossiblyUnboundVariable = "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 = ["bin", "examples", "submodules"]
extend-include = ["*.ipynb"]
src = ["src", "docs", "scripts", "tests"]
output-format = "grouped"
fix = true
preview = true
show-fixes = true
[tool.ruff.lint]
fixable = ["ALL"]
select = [
"ALL", # Select all rules
"D417", # Explicitly enable parameter check even when using Numpy docstrings
]
unfixable = [
"PIE790", # Don't remove `pass`/`...`, overridden in pre-commit
]
extend-safe-fixes = [
"F401", # Allow autofix for unused imports even in `__init__.py`
]
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
"D105", # Allow missing docstring for magic methods
"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
"FURB118", # Incorrectly applies `itemgetter`
"FURB140", # Don't replace comprehensions with starmap
"G0", # Allow f-strings, etc. in Loguru logging
"ICN", # Don't require these ad-hoc "conventional" import names
"INP001", # False positives. Checks for packages missing `__init__.py`
"ISC", # False positives. Implicit string concatenation is fine.
"PD009", # Allow `df.iat`.
"PD011", # Allow use of `.values`. False positives.
"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{**...}
"PLC0105", # Dont enforce Hungarian notation for `TypeVar` variance
"PLC2701", # Allow private name imports
"PLR0913", # Allow more than five function arguments
"PLR0914", # Allow lots of local variables
"PLR0917", # Allow more than five positional arguments
"PLR1704", # Allow redefining arguments, often for sanitization
"PLR2004", # Allow magic values. This check is too sensitive
"PLR6201", # Don't require set literal for membership checks
"PLR6301", # Allow methods that don't reference self, may be overridden
"PLW0108", # Don't warn about unnecessary lambda. Often needed in pandas chains
"PLW0642", # Allow reassignment to `cls` and `self`
"PLW2901", # For loop variable
"RET", # Return checks are flaky, Sourcery does fine analysing these paths
"S301", # Don't warn about pickling.
"S403", # Don't warn about pickle-like modules.
"S404", # Don't warn about subprocess.
"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.lint.isort]
split-on-trailing-comma = false
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.extend-per-file-ignores]
"**/*.ipynb" = [
"B018", # Allow "useless" expressions, which do suppress outputs in notebooks
"E703", # Allow semicolons to 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
]