forked from ChelseaKR/olive-bark-logger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
124 lines (108 loc) · 4.77 KB
/
Copy pathpyproject.toml
File metadata and controls
124 lines (108 loc) · 4.77 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
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "olive-bark-logger"
version = "0.1.0"
description = "Privacy-first, on-device noise monitor: logs sound-level events (never audio) and generates an honest report."
readme = "README.md"
requires-python = ">=3.9"
license = { text = "MIT" }
authors = [{ name = "Chelsea" }]
# Core has ZERO runtime dependencies: level math, detector, store, and report are
# pure standard library so `make verify` runs on any Python 3.9+ with no installs.
dependencies = []
[project.optional-dependencies]
# Live microphone capture on a Raspberry Pi / laptop. Optional on purpose: the
# core pipeline and all tests run without it. Installing audio libs does NOT add
# any path that writes or transmits audio — capture only yields in-memory frames.
live = ["sounddevice>=0.4"]
# Tagged, accessible PDF/A export (EXP-06). Optional for the same reason as `live`:
# the zero-dependency core (monitor/store/report HTML) is unaffected; this only adds
# a new export-side path. See docs/adr/0004-weasyprint-for-tagged-pdf-a-export.md for
# why WeasyPrint and why >=67 (PDF/A level-A — "pdf/a-3a", archival + tagged in one
# ISO 19005 conformance claim — landed in 67.0, 2025-12-02). NOTE: WeasyPrint >=67
# itself requires a >=3.10 host interpreter, so this extra cannot install on the
# >=3.9 core floor (ADR-0002) — a documented, scoped divergence for this optional,
# non-core extra only; nothing on the always-run monitoring/report path is affected.
# pypdf reads the generated PDF's own structure tree back out again, for
# tests/test_pdf_export.py's structural assertions (tag presence, reading order,
# header association) — the only way to verify what actually got written, short of
# a human assistive-technology pass (still deferred, see the ADR).
pdf = [
"weasyprint>=67,<70; python_version >= '3.10'",
"pypdf>=5,<7; python_version >= '3.10'",
]
[dependency-groups]
# PEP 735 dependency group (CQ-27): dev-only tooling, not a runtime extra.
# `mypy<2` is a real floor, not decoration: mypy 2.x dropped support for a
# Python 3.9 host interpreter (this repo's own venv target), so `mypy>=2`
# cannot be installed into `.venv` here — verified locally 2026-07-05.
dev = [
"pytest>=8",
"pytest-cov>=5",
"hypothesis>=6",
"ruff>=0.15",
"mypy>=1.18,<2",
"bandit>=1.8",
"pip-audit>=2.7",
"tzdata>=2025.2",
]
[project.scripts]
olive-monitor = "monitor.service:main"
olive-report = "report.render:main"
olive-tune = "monitor.calibrate:main_tune"
olive-calibrate = "monitor.calibrate:main_calibrate"
[tool.setuptools]
packages = ["monitor", "store", "report"]
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
# `tests/` is added to sys.path explicitly (rather than relying on "prepend"
# import-mode's implicit rootdir insertion) so the guarantee tests' own
# `from conftest import source_files` keeps working under `--import-mode=importlib`.
pythonpath = ["tests"]
addopts = "-q --strict-markers --strict-config --import-mode=importlib"
[tool.coverage.run]
branch = true
source = ["monitor", "store", "report"]
omit = ["monitor/capture_live.py"] # live mic path needs hardware; excluded from coverage, covered by the no-audio static gate
[tool.coverage.report]
fail_under = 85
show_missing = true
skip_covered = false
[tool.ruff]
target-version = "py39"
line-length = 100
src = ["monitor", "store", "report", "tests"]
[tool.ruff.lint]
select = ["E", "W", "F", "I", "UP", "B", "SIM", "S", "C90", "RUF"]
ignore = ["E501"] # line length is handled by the formatter
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
# `assert` is the standard pytest idiom, not a production security concern (S101).
"tests/*" = ["S101"]
# Mirrors the intentional en-dash time-range literal from report/violations.py.
"tests/test_violations.py" = ["RUF001", "RUF003"]
[tool.mypy]
# Runtime target is 3.9 (see requires-python); the code uses `from __future__ import
# annotations`, so checking under 3.10 semantics is safe and required by current mypy.
python_version = "3.10"
strict = true
files = ["monitor", "store", "report"]
exclude = "(^|/)capture_live\\.py$"
# The live mic path depends on an untyped third-party lib and a hardware callback;
# it is excluded from coverage and from strict checking (the no-audio gate guards it).
[[tool.mypy.overrides]]
module = "monitor.capture_live"
ignore_errors = true
[[tool.mypy.overrides]]
module = "sounddevice"
ignore_missing_imports = true
# weasyprint (the `pdf` extra, EXP-06) ships no py.typed marker / stubs either;
# report/pdf_export.py imports it lazily inside a function and treats its return
# values as opaque (see the `cast(bytes, ...)` there), same posture as sounddevice.
[[tool.mypy.overrides]]
module = "weasyprint"
ignore_missing_imports = true