Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (158 loc) · 5.86 KB
/
Copy pathpyproject.toml
File metadata and controls
174 lines (158 loc) · 5.86 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
[project]
name = "inkypi"
version = "1.4.16"
description = "InkyPi — e-ink dashboard for Raspberry Pi"
requires-python = ">=3.11,<3.14"
# Runtime dependencies mirror install/requirements.in during the uv-lock migration
# window (JTN-616). The source of truth is this pyproject.toml + uv.lock; the
# install/requirements.txt file is regenerated from uv.lock via `uv export`.
dependencies = [
"flask>=3.1,<4",
"python-dotenv>=1.0,<2",
"inky>=2.3,<3; sys_platform == 'linux'",
"requests>=2.32,<3",
"urllib3>=2.0,<3",
"werkzeug>=3.1,<4",
"pillow>=11.0,<13",
"pi-heif==1.4.0",
"tzdata>=2024.1",
"openai>=3.0,<4",
"google-genai>=2.0,<3",
# numpy 2.5 requires Python 3.12+. Capped so uv.lock resolves one version for
# every supported Python; a split breaks CI, which co-installs this export with
# the pip-compiled dev lock. Lift the cap when 3.11 support is dropped.
"numpy>=2.0,<2.5",
"icalendar>=7.0,<8",
"recurring-ical-events>=3.0,<4",
"psutil>=7.0,<8",
"cysystemd>=2.0,<3; sys_platform == 'linux'",
"waitress>=3.0,<4",
"feedparser>=6.0,<7",
"jsonschema>=4.0,<5",
"astral>=3.0,<4",
"prometheus-client>=0.21,<1",
]
[tool.uv]
# uv needs to know we support Linux (Pi) + macOS (dev) + arm64/aarch64/armhf wheels.
# A universal resolution covers all supported platforms in a single lockfile.
required-environments = [
"sys_platform == 'linux' and platform_machine == 'aarch64'",
"sys_platform == 'linux' and platform_machine == 'armv7l'",
"sys_platform == 'linux' and platform_machine == 'armv6l'",
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
"sys_platform == 'darwin' and platform_machine == 'x86_64'",
]
[tool.setuptools]
# We only use pyproject.toml for dependency metadata; no packages are published.
packages = []
[tool.black]
line-length = 88
target-version = ["py311"]
extend-exclude = """
(
mock_display_output
)
"""
[tool.ruff]
line-length = 88
target-version = "py311"
src = ["src", "tests", "scripts"]
exclude = [
".git",
".venv",
"venv",
"build",
"dist",
"mock_display_output",
"src/display/waveshare_epd",
"clients"
]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort (imports)
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"PERF", # perflint
"PIE", # flake8-pie
"RSE", # flake8-raise
"DTZ", # flake8-datetimez
"RET", # flake8-return
]
ignore = [
"E501", # line length handled by Black
"B011", # assert False (used as sentinel in tests)
"B017", # pytest.raises(Exception) is acceptable
"SIM105", # contextlib.suppress — noisy, debatable
"SIM117", # multiple with statements — stylistic
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["src"]
[tool.ruff.lint.per-file-ignores]
# Tests intentionally construct naive datetimes for fixture-style assertions and
# deterministic clock stubs. Mirroring production's tz-aware datetime everywhere
# would bloat the suite without exercising new behavior. We still enforce
# timezone-awareness for clock-based calls (now/fromtimestamp/date.today) in
# tests because those drift with host locale and can hide real bugs.
"tests/**" = ["DTZ001", "DTZ002", "DTZ003", "DTZ007"]
[tool.mutmut]
# Copy the full source tree so imports and runtime assets remain available,
# while preserving the original four-package mutation scope.
source_paths = ["src/"]
only_mutate = [
"src/app_setup/*",
"src/blueprints/*",
"src/utils/*",
"src/refresh_task/*",
]
pytest_add_cli_args = ["-x", "--tb=no", "-q", "-m", "not container"]
pytest_add_cli_args_test_selection = ["tests/"]
# The suite checks repository configuration and runs helper scripts from the
# isolated mutants/ tree, so copy those inputs alongside the tests and source.
also_copy = [
"pytest.ini", "mypy.ini", "VERSION", "CHANGELOG.md", "README.md",
"CONTRIBUTING.md", "LICENSE", "Dockerfile", "docker-compose.yml",
"sonar-project.properties", ".coveragerc", ".gitignore", ".dockerignore",
".pre-commit-config.yaml", ".github/", "install/", "scripts/", "docs/",
"clients/", "runtime/", "templates/", "translations/", "vendor/",
"devbox.json", ".editorconfig", ".gitattributes", ".gitmodules",
".gitleaks.toml", ".lycheeignore", ".stylelintrc.json",
]
[tool.semantic_release]
# Keep BOTH the PEP-621 [project].version and the semantic-release anchor in
# sync on every release. Listing them together means python-semantic-release
# rewrites both TOML keys when bumping, so packaging metadata (pip, uv,
# importlib.metadata) and the VERSION file stay aligned. See JTN-624.
version_toml = [
"pyproject.toml:project.version",
"pyproject.toml:tool.semantic_release.version",
]
version = "1.4.16"
commit_parser = "conventional"
tag_format = "v{version}"
# Regenerate VERSION from the canonical pyproject.toml value on each release.
# Using NEW_VERSION (env var exported by python-semantic-release to
# build_command) avoids relying on shell {version} expansion, which PSR does
# NOT perform — the previous `echo '{version}'` wrote the literal placeholder
# into VERSION on every release.
assets = ["VERSION", "uv.lock"]
# Regenerate VERSION from the canonical pyproject.toml value AND refresh uv.lock
# so the inkypi package version in the lockfile tracks the release bump.
# Without `uv lock`, the lockfile drifts from pyproject.toml and the "Lockfile
# drift" CI check fails on every new PR (see JTN-655).
build_command = "printf '%s\\n' \"$NEW_VERSION\" > VERSION && uv lock"
[tool.semantic_release.changelog]
mode = "update"
insertion_flag = "<!-- version list -->"
[tool.semantic_release.commit_parser_options]
# Preserve v9 parsing behavior for this repo's squash-merged PR messages.
parse_squash_commits = false
ignore_merge_commits = false
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"