forked from Draegerwerk/sdc11073
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
187 lines (167 loc) · 7.21 KB
/
Copy pathpyproject.toml
File metadata and controls
187 lines (167 loc) · 7.21 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "sdc11073"
dynamic = ["version"]
authors = [
{ name = "Bernd Deichmann", email = "bernd.deichmann@draeger.com" },
{ name = "Leon Budnick", email = "leon.budnick@draeger.com" },
]
description = "Pure python implementation of IEEE11073 SDC protocol"
readme = "README.rst"
requires-python = ">=3.9, <3.14"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development',
'License :: OSI Approved :: MIT License',
'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',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux'
]
keywords = [
"SDC",
"IEEE11073",
]
dependencies = [
'lxml>=2.3', # do not use lxml>=6, because it breaks the schema validator
'ifaddr',
'aiohttp',
'typing_extensions;python_version<"3.10"',
]
[project.urls]
"Homepage" = "https://github.com/Draegerwerk/sdc11073"
"Bug Tracker" = "https://github.com/Draegerwerk/sdc11073/issues"
[project.optional-dependencies]
lz4 = [
'lz4',
]
test = [
"pytest",
"pytest-html",
"pytest-cov",
"pytest-xdist[psutil]",
"sdc11073[lz4]",
]
mypy = [
"mypy",
"types-lxml",
]
dev = [
"ruff>=0.9.3",
"sdc11073[mypy]",
"sdc11073[test]",
]
[tool.hatch.build.targets.sdist]
include = [
"src/sdc11073/**/*",
"docs/*", # include picture for readme
"LICENSE",
"README.rst",
"pyproject.toml",
"CHANGELOG.md"
]
support-legacy = false
[tool.hatch.build.targets.wheel]
packages = ["src/sdc11073"]
[tool.hatch.version]
path = "src/sdc11073/__init__.py"
[tool.pytest.ini_options]
testpaths = "tests/"
filterwarnings = [# https://docs.python.org/3/library/warnings.html#warning-filter
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
# https://docs.pytest.org/en/latest/how-to/logging.html#live-logs
# please note that live-logs for cli while using xdist is not working. see https://github.com/pytest-dev/pytest-xdist/issues/574
log_cli = true
log_cli_level = "info"
log_cli_format = "%(asctime)s %(levelname)s (%(threadName)-10s) %(filename)s:%(lineno)d %(message)s"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
log_file = "pytest.log"
log_file_level = "debug"
log_file_format = "%(asctime)s %(levelname)s (%(threadName)-10s) %(filename)s:%(lineno)d %(message)s"
log_file_date_format = "%Y-%m-%d %H:%M:%S:%f"
[tool.ruff]
line-length = 120 # https://docs.astral.sh/ruff/settings/#line-length
target-version = "py39" # https://docs.astral.sh/ruff/settings/#target-version
# Allow imports relative to the "src" and "tests" directories.
src = ["src", "tests"] # https://docs.astral.sh/ruff/settings/#src
# In addition to the standard set of exclusions, omit all tutorials and examples
extend-exclude = ["examples", "tools", "tutorial"] # https://docs.astral.sh/ruff/settings/#extend-exclude
[tool.ruff.lint]
select = ["ALL"] # https://docs.astral.sh/ruff/settings/#select
extend-ignore = [# https://docs.astral.sh/ruff/settings/#extend-ignore
"ANN204", # https://docs.astral.sh/ruff/rules/missing-return-type-special-method/
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"C408", # https://docs.astral.sh/ruff/rules/unnecessary-collection-call/
"C409", # https://docs.astral.sh/ruff/rules/unnecessary-literal-within-tuple-call/
"D105", # undocumented-magic-method
"D107", # undocumented-public-init
"D203", # one-blank-line-before-class
"D213", # multi-line-summary-second-line
"EM101", # https://docs.astral.sh/ruff/rules/raw-string-in-exception/
"Q000", # https://docs.astral.sh/ruff/rules/bad-quotes-inline-string/
"S101", # https://docs.astral.sh/ruff/rules/assert/
"S311", # https://docs.astral.sh/ruff/rules/suspicious-non-cryptographic-random-usage/
"SIM102", # collapsible-if
"T201", # https://docs.astral.sh/ruff/rules/print/
"TRY003", # https://docs.astral.sh/ruff/rules/raise-vanilla-args/
"FBT001", # https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/
"FBT002", # https://docs.astral.sh/ruff/rules/boolean-default-value-positional-argument/
"FBT003", # https://docs.astral.sh/ruff/rules/boolean-positional-value-in-call/
]
[tool.ruff.format]
quote-style = "single"
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true # https://docs.astral.sh/ruff/settings/#allow-star-arg-any
suppress-none-returning = true # https://docs.astral.sh/ruff/settings/#suppress-none-returning
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true # https://docs.astral.sh/ruff/settings/#allow-dict-calls-with-keyword-arguments
[tool.ruff.lint.pycodestyle]
max-doc-length = 120 # https://docs.astral.sh/ruff/settings/#max-doc-length
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104"]
"tests/*" = [
"SLF001", # Private member accessed
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison
"E722", # Do not use bare `except`
"PT009", # Use a regular `assert` instead of unittest-style `assertEqual`
"PT027", # Use `pytest.raises` instead of unittest-style `assertRaises`
]
[tool.mypy]
python_version = "3.9" # https://mypy.readthedocs.io/en/stable/config_file.html#confval-python_version
strict = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-strict
disallow_untyped_calls = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_untyped_calls
disallow_untyped_defs = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_untyped_defs
disallow_any_generics = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_any_generics
disallow_any_unimported = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_any_unimported
warn_redundant_casts = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-warn_redundant_casts
check_untyped_defs = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-check_untyped_defs
warn_return_any = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-warn_return_any
warn_unused_configs = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-warn_unused_configs
warn_unused_ignores = true # https://mypy.readthedocs.io/en/stable/config_file.html#confval-warn_unused_ignores
[tool.coverage.report]
exclude_also = [# https://coverage.readthedocs.io/en/latest/config.html#report-exclude-also
"raise AssertionError",
"raise NotImplementedError",
"if (typing\\.)?TYPE_CHECKING:",
"def __repr__",
"def __str__",
"self\\._?logger\\.(info|debug|warning|error|exception|critical)"
]
ignore_errors = true # https://coverage.readthedocs.io/en/latest/config.html#report-ignore-errors
[tool.coverage.run]
parallel = true # https://coverage.readthedocs.io/en/latest/config.html#run-parallel