forked from ChelseaKR/habitable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (144 loc) · 5.09 KB
/
Copy pathpyproject.toml
File metadata and controls
160 lines (144 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
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
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright 2026 Chelsea Kelly-Reif
[project]
name = "habitable"
version = "0.4.0"
description = "Court-ready, offline-first, end-to-end-encrypted habitability evidence for tenant unions."
readme = "README.md"
requires-python = ">=3.14"
license = "AGPL-3.0-or-later"
license-files = ["LICENSE", "NOTICE"]
authors = [{ name = "Chelsea Kelly-Reif" }]
keywords = [
"tenant-rights",
"evidence",
"rfc3161",
"trusted-timestamping",
"local-first",
"crdt",
"end-to-end-encryption",
"chain-of-custody",
"civic-tech",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Legal Industry",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3.14",
"Topic :: Security :: Cryptography",
"Typing :: Typed",
]
dependencies = [
"cryptography>=44",
"asn1crypto>=1.5",
"reportlab>=5.0.0",
"pillow>=12.3.0",
"piexif>=1.1.3",
]
[project.optional-dependencies]
# The standalone verifier deliberately depends on as little as possible, so a
# court or legal-aid group can run it without pulling the whole stack. It is also
# offered under Apache-2.0 (see NOTICE) for embedding.
verify = ["cryptography>=44", "asn1crypto>=1.5"]
# The reusable, local-first evidence kernel (EXP-13): canonical + evidence + tsa +
# verify + crypto-verify, exposed as the stable, embeddable public surface
# `habitable.kernel`, under the same Apache-2.0 additional permission. Same minimal
# runtime as `verify`; other civic tools adopt this subset without copying code. See
# docs/evidence-kernel.md for the API + semver contract and the golden corpus.
kernel = ["cryptography>=44", "asn1crypto>=1.5"]
[project.scripts]
habitable = "habitable.cli:main"
[project.urls]
Homepage = "https://github.com/ChelseaKR/habitable"
Source = "https://github.com/ChelseaKR/habitable"
Issues = "https://github.com/ChelseaKR/habitable/issues"
[dependency-groups]
dev = [
"pytest>=9.1.1",
"pytest-cov>=5",
"hypothesis>=6.165.2",
"mypy>=2.3.0",
"ruff>=0.16.2",
"pip-audit>=2.7",
"playwright>=1.62.0",
"axe-playwright-python>=0.1.8",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/habitable"]
# The local-first web client lives at the repository root so it can also be
# audited and served as plain static files during development. Map it into the
# Python package when building a wheel; otherwise an installed `habitable app`
# has no HTML, JavaScript, translations, manifest, or icons to serve.
[tool.hatch.build.targets.wheel.force-include]
"app" = "habitable/_app"
[tool.ruff]
line-length = 100
target-version = "py314"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
"RUF", # ruff-specific
"S", # flake8-bandit (security)
"C90", # mccabe complexity
]
ignore = [
"S101", # assert is fine in tests and internal invariants
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S", "N802", "N803"]
# media.py shells out to a fixed ffmpeg/ffprobe binary (never a shell, executable
# is a module constant, args are file paths passed as a list) -- S603's "untrusted
# input" concern does not apply to these controlled invocations (EXP-07).
"src/habitable/media.py" = ["S603"]
[tool.mypy]
python_version = "3.14"
strict = true
warn_unreachable = true
warn_redundant_casts = true
disallow_any_generics = true
no_implicit_reexport = true
files = ["src", "tests"]
mypy_path = "contrib"
[[tool.mypy.overrides]]
module = ["piexif.*", "reportlab.*", "PIL.*", "asn1crypto.*", "axe_playwright_python.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
addopts = "-ra --strict-markers --strict-config --import-mode=importlib"
testpaths = ["tests"]
filterwarnings = ["error"]
markers = [
"a11y: browser-based accessibility (axe-core) checks; needs Playwright + Chromium",
"integration: hits a real external service (e.g. a public RFC 3161 TSA); needs network",
]
[tool.coverage.run]
branch = true
source = ["habitable"]
[tool.coverage.report]
# Baseline floor: 85% branch coverage (--cov-fail-under in `make cov`). The
# security/crypto-critical modules — src/habitable/{crypto,vault,tsa,verify}.py —
# carry a stricter per-module 95% floor: `make cov` runs ONE
# `coverage report --include=<single module> --fail-under=95` per module (and CI
# via `make verify`), because `--fail-under` only ever tests the TOTAL row, so a
# single --include over all four would be a pooled average in which one module at
# 100% can carry another below the line (issue #183). See CODE-QUALITY-STANDARD
# "per-module floors".
fail_under = 85
show_missing = true
skip_covered = false
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "raise NotImplementedError"]