-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
164 lines (138 loc) · 3.8 KB
/
pyproject.toml
File metadata and controls
164 lines (138 loc) · 3.8 KB
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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "labone"
dynamic = ["version"]
description = "Python API for Zurich Instruments LabOne software."
readme = "README.md"
license = { text = "Apache 2.0" }
requires-python = ">=3.9"
authors = [
{ name = "Zurich Instruments Development Team", email = "info@zhinst.com" },
]
keywords = ["zhinst"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
dependencies = [
"numpy>=1.20",
"packaging",
"typing_extensions>=4.8.0",
"zhinst-comms~=3.0",
]
[project.urls]
homepage = "https://zhinst.com"
repository = "https://github.com/zhinst/labone-python"
changelog = "https://github.com/zhinst/labone-python/blob/main/CHANGELOG.md"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/labone/_version.py"
[tool.hatch.build.targets.sdist]
exclude = ["/.github", "/docs"]
[tool.hatch.build.targets.wheel]
packages = ["src/labone"]
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.test]
dependencies = ["coverage[toml]>=6.5", "hypothesis", "pytest", "pytest-asyncio"]
[tool.pytest.ini_options]
markers = [
"mock_compatibility: Testing that session mock (still) behaves like hpk server",
]
[tool.hatch.envs.test.scripts]
test = "pytest {args:tests} -m 'not mock_compatibility'"
test-cov = "coverage run -m pytest {args:tests} -m 'not mock_compatibility'"
mock_compatibility = "pytest {args:tests} -m mock_compatibility"
cov-report = [
"- coverage combine",
"coverage report",
"coverage html",
"coverage xml",
]
cov = ["test-cov", "cov-report"]
[[tool.hatch.envs.lint.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.lint]
dependencies = [
"black>=24.8.0",
"mypy>=1.11.2",
"ruff>=0.6.4",
"numpy>=1.20",
"zhinst-comms~=3.0",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/labone}"
style = ["ruff check {args:.}", "black --check --diff {args:.}"]
fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"]
all = ["style", "typing"]
[tool.black]
target-version = ["py39"]
[tool.ruff]
src = ["src", "tests"]
target-version = "py39"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Missing docstring in `__init__`
"D107",
# Missing docstring in magic method
"D105",
# Missing type annotation for `*args`
"ANN002",
# Missing type annotation for `**kwargs`
"ANN003",
# Too many return statements
"PLR0911",
# Missing return type annotation for special method
"ANN204",
# Too many arguments in function definition
"PLR0913",
]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 15.
max-complexity = 15
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = [
"PLR2004",
"S101",
"TID252",
"ANN",
"D",
"SLF001",
"PT011",
"RUF006",
]
[tool.coverage.run]
source_pkgs = ["labone"]
branch = true
parallel = true
omit = ["src/labone/__about__.py"]
[tool.coverage.paths]
labone = ["src/labone", "*/labone/src/labone"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if t.TYPE_CHECKING:",
"\\.\\.\\.",
]