-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
120 lines (108 loc) · 5.09 KB
/
Copy pathpyproject.toml
File metadata and controls
120 lines (108 loc) · 5.09 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "span-panel-simulator"
version = "1.2.2"
description = "Standalone eBus simulator for SPAN panels"
requires-python = ">=3.14"
dependencies = [
"aiomqtt>=2.0.0",
"aiohttp>=3.9.0",
"aiohttp-jinja2>=1.6",
"jinja2>=3.1.0",
"cryptography>=42.0.0",
"pyyaml>=6.0",
"zeroconf>=0.131.0",
"timezonefinder>=6.0",
# Runtime dependencies of the vendored flat emitter
# (`src/span_panel_simulator/flat_emitter`, see its module docstring for provenance).
#
# ebus-sdk is upper-bounded at 0.2: the vendored `wire/graph_builder.py` targets the
# 0.1.x `Device` constructor. 0.2.0 introduced parent/child device trees, replaced the
# `children_ids`/`root_id`/`parent_id` kwargs with a `parent=` Device reference, removed
# `Device.add_child()`, and changed the `mqtt_cfg` default from `{}` to `None` — which
# makes the root Device we build as a passive topic/schema model raise in
# `connect_broker()`. Raising this bound requires porting graph_builder to the tree API
# and deciding who owns the broker connection (today the producer's client publishes
# everything). This simulator publishes the flat schema, so the port has no urgency.
#
# Pinned exactly, not ranged, so vendoring is behaviour-neutral: 0.1.5 is what the
# emitter's lockfile resolved and what this code was developed and tested against.
# Letting it float within <0.2 resolves 0.1.10, which drops the module-level
# `setLevel(INFO)` on the `homie` logger that `tests/test_main_logging.py` guards —
# the noise-filter premise documented in `__main__.py`. The add-on image installs from
# this file rather than the lockfile, so the declared bound is the operative control
# in production. Raising it is a deliberate follow-up with its own testing, not a
# side effect of moving code.
"ebus-sdk==0.23.1",
"paho-mqtt>=2.0.0",
]
[dependency-groups]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
"pytest-cov>=5.0",
"ruff>=0.15.0",
"mypy>=1.10",
"pre-commit>=4.0",
"types-pyyaml>=6.0",
"amqtt>=0.11.3",
]
[project.scripts]
span-simulator = "span_panel_simulator.__main__:main"
[tool.hatch.build.targets.wheel]
# `packages` already ships every file under src/span_panel_simulator, including
# dashboard/templates and dashboard/static. A `force-include` table re-adding
# those two directories at the same destination paths made hatchling write each
# file twice; newer hatchling rejects that outright ("A second file is being
# added to the wheel archive at the same path"), breaking `pip install .` in the
# add-on Docker build. Build isolation resolves `hatchling` fresh on every build,
# so the older, tolerant version this was authored against is not coming back.
#
# The same applies to the vendored flat emitter's data files
# (`flat_emitter/wire/profiles/*.json`, `flat_emitter/wire/mapping/*.yaml`): they live
# under `src/span_panel_simulator`, so `packages` already ships them. Upstream declared
# them via `force-include` because its package root was elsewhere; re-adding that here
# would reintroduce the duplicate-path collision described above.
packages = ["src/span_panel_simulator"]
[tool.ruff]
# Pinned to py313 because ruff 0.15.x has a formatter bug under py314 that
# rewrites ``except (A, B):`` into the Python-2 ``except A, B:`` syntax.
# Bump back to py314 once the upstream bug is fixed.
target-version = "py313"
line-length = 99
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM", "TCH", "RUF"]
# TC001/TC002/TC003 (move imports into TYPE_CHECKING blocks) conflict with mypy's need for
# runtime resolution of imported names referenced from generic functions/methods. Disable to
# allow straightforward runtime imports.
#
# This ignore was previously described by this comment but never actually declared — none of
# the simulator's own modules happened to trigger the rules, so the omission was invisible.
# The vendored flat emitter does trigger them, and was authored under an identical select
# list plus this same ignore, so declaring it here restores the intent rather than relaxing
# the bar for vendored code.
ignore = ["TC001", "TC002", "TC003"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.mypy]
python_version = "3.14"
strict = true
[[tool.mypy.overrides]]
module = "timezonefinder"
ignore_missing_imports = true
# ebus-sdk ships without a py.typed marker. Previously these overrides lived in the emitter's
# own pyproject; they move here with the vendored code. Both forms are needed — the wildcard
# alone does not match the top-level `ebus_sdk` import in `flat_emitter/wire/_sdk_seam.py`.
[[tool.mypy.overrides]]
module = "ebus_sdk"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "ebus_sdk.*"
ignore_missing_imports = true
# CloneRuntime is defined in runtime.py, but setter_handlers references it through a
# TYPE_CHECKING import. mypy under --strict still complains about the forward ref when
# runtime.py hasn't been written; relax for the emitter_adapter subpackage during the
# integration build-out.