-
-
Notifications
You must be signed in to change notification settings - Fork 723
Expand file tree
/
Copy pathpyproject.toml
More file actions
250 lines (239 loc) · 7.18 KB
/
Copy pathpyproject.toml
File metadata and controls
250 lines (239 loc) · 7.18 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "anthias"
version = "2026.05.1"
description = "The world's most popular open source digital signage project."
readme = "README.md"
requires-python = ">=3.13"
dependencies = []
[project.scripts]
anthias-manage = "anthias_server.manage:main"
[tool.setuptools.packages.find]
where = ["src"]
include = ["anthias_*"]
namespaces = false
[dependency-groups]
dev-host = [
"ansible-lint==26.4.0",
"celery-types==0.26.0",
"django-stubs==6.0.3",
"djangorestframework-stubs==3.16.9",
"mypy==1.18.2",
"ruff==0.14.10",
"tenacity==9.1.4",
"types-gunicorn==25.3.0.20260408",
"types-netifaces==0.11.0.20260408",
"types-python-dateutil==2.9.0.20260408",
"types-pytz==2026.1.1.20260408",
"types-PyYAML==6.0.12.20260408",
"types-requests==2.33.0.20260408",
]
docker-image-builder = [
"click==8.1.7",
"jinja2==3.1.6",
"pygit2==1.19.1",
"requests==2.33.1",
"python-on-whales==0.81.0",
]
server = [
"cec==0.2.8",
"celery==5.6.3",
"certifi==2026.4.22",
"channels==4.3.1",
"channels-redis==4.3.0",
"Django==5.2.14",
"djangorestframework==3.16.1",
"django-dbbackup==5.3.0",
"django-stubs-ext==6.0.3",
"drf-spectacular==0.29.0",
"Jinja2==3.1.6",
"netifaces==0.11.0",
"packaging==26.1",
# Pillow + pillow-heif power the upload-time image normalisation
# pipeline (HEIC / HEIF / TIFF → lossless WebP). pillow-heif
# registers a libheif-backed Pillow plugin at import time; the
# libheif1 system package is supplied by the base image (see
# docker/Dockerfile.server.j2). Pillow itself is otherwise unused
# — adding it here instead of relying on a transitive import keeps
# the dependency explicit.
"Pillow==12.2.0",
"pillow-heif==1.3.0",
"psutil==7.2.1",
"pydbus==0.6.0",
"python-dateutil==2.9.0.post0",
"pytz==2025.2",
"PyYAML==6.0.2",
"redis==7.4.0",
"requests==2.33.1",
"tenacity==9.1.4",
"sh==2.2.2",
"urllib3==2.7.0",
"uvicorn[standard]==0.32.1",
"whitenoise==6.12.0",
"yt-dlp>=2026.3.17",
]
viewer = [
"cec==0.2.8",
"certifi==2026.4.22",
"Django==5.2.14",
"Jinja2==3.1.6",
"netifaces==0.11.0",
"pydbus==0.6.0",
"python-dateutil==2.9.0.post0",
"python-vlc==3.0.21203",
"pytz==2025.2",
"redis==7.4.0",
"requests==2.33.1",
"tenacity==9.1.4",
"sh==2.2.2",
"urllib3==2.7.0",
]
dev = [
"pytest==9.0.3",
"pytest-cov==6.0.0",
"pytest-django==4.12.0",
"pytest-mock==3.15.1",
"pytest-xdist==3.6.1",
"playwright==1.59.0",
"pytest-playwright==0.7.2",
"time-machine==2.15.0",
]
host = [
"ansible-core==2.19.9",
"netifaces2==0.0.22",
"redis==7.4.0",
"requests==2.33.1",
"tenacity==9.1.4",
]
local = [
"click==8.1.7",
"requests==2.33.1",
"tenacity==9.1.4",
]
website = [
"pytest==9.0.3",
"requests==2.33.1",
]
test = [
{ include-group = "server" },
{ include-group = "viewer" },
{ include-group = "dev" },
]
# Used by the python-mypy CI job. The django-stubs plugin imports
# anthias_server.django_project.settings to introspect the app registry, so we need the
# runtime deps that settings touches — but not the heavy native-extension
# deps from the server group (cec, netifaces, etc.). We also include
# docker-image-builder so its tools (pygit2, python_on_whales) resolve.
mypy = [
{ include-group = "dev-host" },
{ include-group = "docker-image-builder" },
"channels==4.3.1",
"channels-redis==4.3.0",
"Django==5.2.14",
"django-dbbackup==5.3.0",
"django-stubs-ext==6.0.3",
"djangorestframework==3.16.1",
"drf-spectacular==0.29.0",
# Pillow ships PEP 561 stubs (py.typed). The processing module
# imports PIL at top level, so mypy needs the package resolvable
# to type-check the upload-time normalisation pipeline.
# pillow-heif is intentionally not pinned here — it's listed in
# tool.mypy.overrides above so its missing-import error is
# ignored, mirroring the cec / pydbus / sh / vlc pattern.
"Pillow==12.2.0",
"pytz==2025.2",
"whitenoise==6.12.0",
]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "anthias_server.django_project.settings"
testpaths = ["tests", "src/anthias_server/api/tests"]
python_files = ["test_*.py"]
markers = [
"integration: marks tests as integration (deselect with '-m \"not integration\"')",
]
# pytest-playwright config:
# --browser chromium - skip firefox/webkit (only chromium is
# installed in docker/Dockerfile.test).
# --tracing retain-on-failure
# - per-test trace; dropped for green tests,
# drained to test-artifacts/<id>/trace.zip
# on failure. `playwright show-trace
# trace.zip` replays.
# --screenshot only-on-failure
# - full-page PNG into the same per-test dir.
# --output test-artifacts - directory the GH Actions upload-artifact
# step picks up (.gitignored).
addopts = "--strict-markers --browser chromium --tracing retain-on-failure --screenshot only-on-failure --output test-artifacts"
[tool.coverage.run]
branch = true
source = [
"src/anthias_server",
"src/anthias_common",
"src/anthias_viewer",
]
omit = [
"*/migrations/*",
"*/__init__.py",
"src/anthias_server/django_project/asgi.py",
"src/anthias_server/django_project/routing.py",
"src/anthias_server/django_project/urls.py",
"src/anthias_server/django_project/wsgi.py",
"src/anthias_server/app/management/*",
"src/anthias_server/manage.py",
"src/anthias_host_agent/*",
"bin/*",
"tools/raspberry_pi_imager/*",
"tools/image_builder/*",
"src/anthias_viewer/__main__.py",
]
[tool.coverage.report]
fail_under = 80
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.coverage.xml]
output = "coverage.xml"
[tool.mypy]
python_version = "3.13"
strict = true
follow_imports = "normal"
mypy_path = ["src", "stubs"]
explicit_package_bases = true
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
exclude = [
"^\\.venv/",
"^node_modules/",
"/migrations/",
"/static/",
"^build/",
"^dist/",
# Vendored verbatim from a pinned Yocto/poky upstream commit; see
# the file header. Adding type annotations would put the file
# off-pin and silently break the provenance comment.
"^webview/sysroot-relativelinks\\.py$",
]
[[tool.mypy.overrides]]
# Third-party libs without type stubs. Listed explicitly so a future stub
# release is noticed (and the override removed) instead of silently ignored.
# `channels` itself is covered by partial PEP 561 stubs in stubs/channels-stubs/;
# only the helpers we actually call are typed there.
module = [
"cec",
"channels_redis.*",
"pillow_heif",
"pydbus",
"sh",
"vlc",
"yt_dlp",
"yt_dlp.*",
]
ignore_missing_imports = true
[tool.django-stubs]
django_settings_module = "anthias_server.django_project.settings"