-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
234 lines (210 loc) · 5.85 KB
/
pyproject.toml
File metadata and controls
234 lines (210 loc) · 5.85 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
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
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[project]
name = "pypms"
dynamic = ["version"]
description = "Data acquisition and logging for Air Quality Sensors with UART interface"
authors = [{ name = "Alvaro Valdebenito", email = "avaldebe@gmail.com" }]
requires-python = ">=3.10,<4.0"
readme = "README.md"
keywords = ["air quality", "particulate matter"]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Terminals :: Serial",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [
"pyserial >=3.5",
"typer-slim >=0.12.4",
"loguru >=0.7.0",
"importlib-metadata >=3.6 ; python_version < '3.10'",
"typing-extensions >=3.10.0.2; python_version < '3.10'",
]
[project.optional-dependencies]
rich = ["typer-slim[standard]>=0.12.0"]
mqtt = ["paho-mqtt >=2.1.0"]
influxdb = [
"influxdb >=5.2.0",
"pytz >=2020",
"requests >=2.32.0",
"urllib3 >=1.23",
]
[project.urls]
Homepage = "https://avaldebe.github.io/PyPMS"
Repository = "https://github.com/avaldebe/PyPMS"
[project.scripts]
pms = "pms.main:main"
[project.entry-points."pypms.sensors"]
# docs/sensors/Plantower.md
PMSx003 = "pms.sensors.plantower.pmsx003"
PMS3003 = "pms.sensors.plantower.pms3003"
PMS5003S = "pms.sensors.plantower.pms5003s"
PMS5003ST = "pms.sensors.plantower.pms5003st"
PMS5003T = "pms.sensors.plantower.pms5003t"
# docs/sensors/NovaFitness.md
SDS01x = "pms.sensors.novafitness.sds01x"
SDS198 = "pms.sensors.novafitness.sds198"
# docs/sensors/Honeywell.md
HPMA115S0 = "pms.sensors.honeywell.hpma115s0"
HPMA115C0 = "pms.sensors.honeywell.hpma115c0"
SPS30 = "pms.sensors.sensirion.sps30"
# docs/sensors/mcu680.md
MCU680 = "pms.sensors.bosch_sensortec.mcu680"
# docs/sensors/Winsen.md
MHZ19B = "pms.sensors.winsen.mhz19b"
ZH0xx = "pms.sensors.winsen.zh0xx"
[project.entry-points."pypms.extras"]
influxdb = "pms.extra.cli:influxdb"
mqtt = "pms.extra.cli:mqtt"
bridge = "pms.extra.cli:bridge"
[dependency-groups]
dev = [
{ include-group = "test" },
"pytest-cov >=6.1.1",
"pytest-sugar >=1.0.0",
"mypy >=1.19.1",
"types-pyserial",
]
test = [
"pytest >=8.3.5",
"packaging >=25.0",
"mock_serial",
{ include-group = "coverage" },
]
coverage = ["coverage >=7.8"]
docs = ["mkdocs>=1.2.3", "mkdocs-material>=9.4", "pymdown-extensions>=9.5"]
[tool.hatch]
build.targets.sdist.include = ["src/pms"]
build.targets.wheel.packages = ["src/pms"]
build.hooks.version.path = "src/pms/_version.py"
version.source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
pattern = "default-unprefixed"
[tool.uv]
environments = ["sys_platform == 'linux'"]
cache-keys = [{ file = "pyproject.toml" }, { file = "src/pms/_version.py" }]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = lint, docs, py310, py311, py312, py313, py314, report
skip_missing_interpreters = True
isolated_build = True
requires =
tox >=4.22
tox-uv >=1.25
labels =
coverage = py310, py311, py312, py313, py314, report
[testenv]
description =
py310: test with lowest dependency versions
!py310: test with {base_python}
uv_resolution =
py310: lowest
set_env =
!report: COVERAGE_FILE={env:COVERAGE_FILE:.coverage/coverage.{envname}}
commands =
coverage run -m pytest -ra -q
extras =
influxdb
mqtt
dependency_groups =
test
[testenv:report]
description = combined coverage report
skip_install = true
parallel_show_output = true
commands =
coverage combine --keep
coverage report
dependency_groups =
coverage
depends =
py310, py311, py312, py313, py314
[testenv:lint]
description = code quality
skip_install = true
commands =
pre-commit autoupdate
pre-commit run --hook-stage manual --all-files --show-diff-on-failure
dependency_groups =
deps =
pre-commit
pre-commit-uv
[testenv:docs{,-serve,-deploy}]
env_name = docs
description = build docs
commands =
docs: mkdocs build --clean
docs-serve: mkdocs serve
docs-deploy: mkdocs gh-deploy {posargs:--clean}
dependency_groups =
docs
"""
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ff"
testpaths = ["tests"]
required_plugins = ["mock-serial"]
filterwarnings = [
# DeprecationWarning from pypms are errors
"error::DeprecationWarning:(pms|tests).*:",
# Python3.12 influxdb-5.3.2
"ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:influxdb.*",
]
[tool.coverage.paths]
source = ["src", "**/site-packages"]
[tool.coverage.run]
source = ["pms"]
data_file = ".coverage/coverage"
[tool.coverage.report]
exclude_also = [
"@overload",
"@abstractmethod",
"ModuleNotFoundError",
"KeyboardInterrupt",
"UserWarning",
"def __repr__",
"def __str__",
'if spec == "":',
]
show_missing = true
skip_covered = true
fail_under = 95
[tool.ruff]
line-length = 100
lint.select = ["E", "F", "I", "UP", "FA"]
[tool.ruff.lint.per-file-ignores]
"cli.py" = [
"FA100", # https://docs.astral.sh/ruff/rules/future-rewritable-type-annotation/
]
[tool.mypy]
python_version = "3.10"
warn_unused_configs = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = false
warn_unreachable = true
show_error_codes = true
pretty = true
sqlite_cache = true
exclude = "site"
[[tool.mypy.overrides]]
module = ["influxdb", "mock_serial"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["pms.extra.mqtt", "pms.extra.influxdb"]
warn_unused_ignores = false