-
Notifications
You must be signed in to change notification settings - Fork 63
/
pyproject.toml
355 lines (313 loc) · 8.19 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "acconeer-exptool"
description = "Acconeer Exploration Tool"
dynamic = ["version"]
readme = "README.md"
license = "BSD-3-Clause-Clear"
requires-python = ">=3.8"
authors = [
{ name = "Acconeer AB", email = "[email protected]" },
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"attrs>=22.1.0",
"cbor2",
"h5py>=3.8,<4",
"numpy>=1.20",
"pandas>=1.3.5",
"packaging",
"platformdirs",
"pyserial>=3.5",
"pyusb>=1.2.1",
"pyyaml",
"requests>=2.0,<3",
"result==0.16.1",
"typing-extensions>=4,<5",
"textual==0.1.18",
"XlsxWriter>=3.1.9",
"exceptiongroup==1.1.1",
"attributes-doc==0.3.0",
]
[project.urls]
Documentation = "https://docs.acconeer.com"
Homepage = "https://github.com/acconeer/acconeer-python-exploration"
Source = "https://github.com/acconeer/acconeer-python-exploration"
Tracker = "https://github.com/acconeer/acconeer-python-exploration/issues"
[project.optional-dependencies]
algo = [
"scipy",
]
app = [
"acconeer-exptool[algo]",
"bs4",
"docutils>=0.17,!=0.18",
"matplotlib>3.5.1",
"psutil",
"pyperclip",
"pyside6!=6.3.0,!=6.3.2,!=6.5.*,<6.8",
"pyqtdarktheme",
"pyqtgraph>=0.12.4",
"qtawesome",
"qtpy>=2.3.0",
]
docs = [
"acconeer-exptool[algo]",
"docutils>=0.17,!=0.18",
"myst-parser>=2.0.0",
"sphinx>=7.2.6",
"sphinx-design",
"sphinxext-rediraffe",
"sphinx-notfound-page>=1.0.0",
"sphinx-book-theme==1.1.2",
"sphinx-tabs",
"sphinxcontrib-youtube",
"sphinxcontrib-spelling",
]
[tool.hatch.build.targets.wheel]
packages = [
"src/acconeer",
]
[tool.hatch.build.targets.sdist]
include = [
"src/acconeer",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/acconeer/exptool/_version.py"
[tool.hatch.envs.hatch-uv]
dependencies = ["uv==0.4.16"]
[tool.hatch.envs.app]
features = ["app"]
[tool.hatch.envs.app.scripts]
launcher = "python -m acconeer.exptool.app {args}"
new = "python -m acconeer.exptool.app.new {args}"
old = "python -m acconeer.exptool.app.old {args}"
[tool.hatch.envs.mypy]
features = ["app"]
dependencies = [
"mypy==1.7.0",
"pytest==7.2",
"pandas==1.3.5",
"pandas-stubs",
"PySide6==6.6.2",
]
[[tool.hatch.envs.mypy.matrix]]
python = ["3.8"]
[tool.hatch.envs.mypy.scripts]
check = "python -m mypy {args}"
[tool.hatch.envs.hatch-test]
# This is the environment for "hatch test"
features = ["app"]
extra-args = ["--doctest-modules"]
extra-dependencies = [
"pandas>=1.3.5",
"dirty-equals==0.5.0",
]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.hatch-test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args}" # default
run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}" # default
cov-combine = "coverage combine" # default
cov-report = "coverage report" # default
[tool.hatch.envs.docs]
features = ["docs"]
dependencies = ["sphinx_autobuild"]
[tool.hatch.envs.docs.scripts]
clean = "rm -rf docs/_build"
autobuild = [
"clean",
"python -m sphinx_autobuild -t internal -b html docs docs/_build --watch src",
]
html = "python -m sphinx -W -b html docs docs/_build"
linkcheck = "python -m sphinx -W -b linkcheck docs docs/_build"
spelling = "python -m sphinx -W -b spelling docs docs/_build"
latexpdf = "python -m sphinx -M latexpdf docs docs/_build"
rediraffe-write = "python -m sphinx -b rediraffewritediff docs docs/_build"
rediraffe-check = "python -m sphinx -b rediraffecheckdiff docs docs/_build"
build = ["clean", "html", "latexpdf", "linkcheck", "spelling", "rediraffe-check"]
[tool.hatch.envs.hatch-static-analysis]
# This is the environment for "hatch fmt"
config-path = "none"
dependencies = [
"ruff==0.4.8",
"packaging",
'tomli; python_version < "3.11"',
]
[tool.hatch.envs.hatch-static-analysis.scripts]
format-check = [
"python -m ruff format --diff .",
]
format-fix = [
"python -m ruff format .",
]
lint-check = [
"python tools/check_permissions.py",
"python tools/check_whitespace.py",
"python tools/check_line_length.py",
"python tools/check_sdk_mentions.py",
"python tools/check_changelog.py",
"python tools/check_copyright.py",
"python docs/generate_example_script_pages.py check",
"python -m ruff check .",
]
lint-fix = [
"python tools/check_copyright.py --update-year",
"python docs/generate_example_script_pages.py fix",
"python -m ruff check --fix .",
"lint-check"
]
[tool.ruff]
include = ["pyproject.toml", "**/*.py"]
line-length = 99
target-version = "py38"
show-fixes = true
output-format = "concise"
src = ["src", "tests"]
namespace-packages = ["src/acconeer"]
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
# "extend" here adds to the ruff defaults, rather than replacing.
# See the full list on https://docs.astral.sh/ruff/rules
#
# Q = flake8-quotes
# TID = flake8-tidy-imports
# I = isort
# FA = flake8-future-annotations
# NPY = Numpy specific rules
# EM = flake8-errmsg
# S11[02] = flake8-bandit, Log exception instead of try-except-(pass|continue)
# LOG = flake8-logging
# SIM = flake8-simplify
extend-select = ["Q", "TID", "I", "FA", "NPY", "EM", "S110", "S112", "LOG", "SIM"]
# E741 = Ambiguous variable names, e.g. I vs l
# SIM108 = Has a tendancy to create ternary one-liners.
# SIM105 = try-except-pass is handled with S110
extend-ignore = ["E741", "SIM108", "SIM105"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "E402"]
"src/acconeer/exptool/_winusbcdc/*" = ["F40", "E501"]
"examples/*" = ["S11", "SIM"]
"src/acconeer/exptool/app/old/*" = ["S11", "SIM"]
"src/acconeer/exptool/a111/*" = ["S11", "SIM"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.lint.isort]
lines-after-imports = 2
known-third-party = [
"numpy",
"scipy",
"serial",
"matplotlib",
"h5py",
"flask",
"yaml",
"attr",
"docutils",
"keras",
"sklearn",
"tensorflow",
"pytest",
"requests",
"packaging",
"attrs",
"typing_extensions",
"qdarktheme",
"qtawesome",
"pyperclip",
"psutil",
]
section-order = [
"future",
"standard-library",
"third-party",
"PySide6",
"pyqtgraph",
"acconeer",
"first-party",
"local-folder",
]
[tool.ruff.lint.isort.sections]
"PySide6" = ["PySide6"]
"pyqtgraph" = ["pyqtgraph"]
"acconeer" = ["acconeer"]
[tool.mypy]
packages = [
"acconeer.exptool._core",
"acconeer.exptool.a121",
"acconeer.exptool.app.new",
"acconeer.exptool.flash._mcumgruart",
"acconeer.exptool.setup",
"acconeer.exptool.opser",
"utils.convert_h5",
"tests.unit.a121",
"tests.app",
]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_unused_ignores = true
incremental = true
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"attributes_doc.*",
"cbor2.*",
"dirty_equals.*",
"h5py.*",
"platformdirs.*",
"psutil.*",
"pyperclip.*",
"pyqtgraph.*",
"pytest.*",
"qdarktheme.*",
"qtawesome.*",
"requests.*",
"scipy.*",
"serial.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "--ignore=src/acconeer/exptool/_winusbcdc --ignore=src/acconeer/exptool/a111 --ignore=tests/gui"
doctest_optionflags = [
"ELLIPSIS",
"NORMALIZE_WHITESPACE",
]
[tool.check_line_length]
line_length = 80
include = [
"LICENSE.md",
"CHANGELOG.md",
"UNRELEASED_CHANGELOG.md",
]
[tool.check_sdk_mentions]
ignore_lines = []
include = [
"README.md",
"docs/**/*.rst",
"Jenkinsfile",
"src/acconeer/exptool/app/new/ui/resource_tab/*.py",
]
[tool.check_copyright]
ignore_files = [
"src/acconeer/exptool/_winusbcdc/*",
]
docs_conf_file = "docs/conf.py"