fieldwitness/pyproject.toml
Aaron D. Lee 16318daea3
Some checks failed
CI / lint (push) Failing after 12s
CI / typecheck (push) Failing after 12s
Add comprehensive test suite: integration tests + Playwright e2e
Integration tests (350 passing):
- test_evidence_summary.py: HTML/PDF generation, XSS safety, anchor rendering
- test_tor.py: Tor module unit tests (mocked, no Tor needed)
- test_c2pa_importer.py: Import result dataclass, trust evaluation, graceful degradation
- test_file_attestation.py: All file types (PNG, PDF, CSV, empty, large), determinism
- test_paths.py: Registry correctness, env var override, all paths under BASE_DIR
- test_killswitch_coverage.py: Tor keys, trusted keys, carrier history destruction

Playwright e2e infrastructure:
- tests/e2e/ with conftest (live server, auth fixtures), helpers (test file generators)
- test_auth.py: Setup flow, login/logout, protected routes
- test_attest.py: Image/PDF/CSV attestation, verify, attestation log
- test_dropbox.py: Token creation, source upload, branding check
- test_keys.py: Identity display, trust store
- test_fieldkit.py: Status dashboard, killswitch page
- test_navigation.py: All nav links, responsive layout

Run: pytest (unit/integration) or pytest -m e2e tests/e2e/ (browser)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:22:12 -04:00

186 lines
4.2 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "fieldwitness"
version = "0.3.0"
description = "FieldWitness — offline-first security toolkit for journalists, NGOs, and at-risk organizations"
readme = "README.md"
license = "GPL-3.0-only"
requires-python = ">=3.11"
authors = [
{ name = "Aaron D. Lee" }
]
keywords = [
"steganography",
"provenance",
"attestation",
"security",
"privacy",
"fieldkit",
"airgap",
"offline",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Environment :: Console",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Security :: Cryptography",
"Topic :: Multimedia :: Graphics",
]
dependencies = [
"pillow>=10.0.0",
"cryptography>=41.0.0",
"argon2-cffi>=23.0.0",
"zstandard>=0.22.0",
"cbor2>=5.6.0",
"uuid-utils>=0.9.0",
]
[project.optional-dependencies]
stego-dct = [
"numpy>=2.0.0",
"scipy>=1.10.0",
"jpeglib>=1.0.0",
"reedsolo>=1.7.0",
]
stego-audio = [
"pydub>=0.25.0",
"numpy>=2.0.0",
"scipy>=1.10.0",
"soundfile>=0.12.0",
"reedsolo>=1.7.0",
]
stego-compression = [
"lz4>=4.0.0",
]
attest = [
"imagehash>=4.3.0",
"lmdb>=1.4.0",
"exifread>=3.0.0",
]
cli = [
"click>=8.0.0",
"rich>=13.0.0",
"qrcode>=7.30",
"piexif>=1.1.0",
]
web = [
"flask>=3.0.0",
"flask-wtf>=1.2.0",
"waitress>=3.0.0",
"gunicorn>=21.0.0",
"qrcode>=7.3.0",
"pyzbar>=0.1.9",
"piexif>=1.1.0",
"fieldwitness[attest,stego-dct]",
]
api = [
"fastapi>=0.109.0",
"uvicorn[standard]>=0.27.0",
"python-multipart>=0.0.6",
"fieldwitness[stego-dct]",
]
fieldkit = [
"watchdog>=4.0.0",
"pyudev>=0.24.0",
]
federation = [
"aiohttp>=3.9.0",
]
tor = [
"stem>=1.8.0",
]
c2pa = [
"c2pa-python>=0.6.0",
"fieldwitness[attest]",
]
evidence-pdf = [
"xhtml2pdf>=0.2.11",
]
rpi = [
"fieldwitness[web,cli,fieldkit]",
"gpiozero>=2.0",
]
all = [
"fieldwitness[stego-dct,stego-audio,stego-compression,attest,cli,web,api,fieldkit,federation,tor,c2pa,evidence-pdf]",
]
dev = [
"fieldwitness[all]",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
]
test-e2e = [
"pytest-playwright>=0.4.0",
"playwright>=1.40.0",
]
[project.scripts]
fieldwitness = "fieldwitness.cli:main"
[project.urls]
Homepage = "https://github.com/alee/fieldwitness"
Repository = "https://github.com/alee/fieldwitness"
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/frontends",
]
[tool.hatch.build.targets.wheel]
packages = ["src/fieldwitness", "frontends"]
[tool.hatch.build.targets.wheel.sources]
"src" = ""
[tool.hatch.build.targets.wheel.force-include]
"src/fieldwitness/stego/data/bip39-words.txt" = "fieldwitness/stego/data/bip39-words.txt"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = "-v --cov=fieldwitness --cov-report=term-missing"
markers = [
"e2e: end-to-end Playwright browser tests (require `playwright install` and `pip install fieldwitness[test-e2e]`)",
]
[tool.black]
line-length = 100
target-version = ["py311", "py312", "py313"]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
ignore = ["E501"]
[tool.ruff.lint.per-file-ignores]
# YCbCr colorspace variables (R, G, B, Y, Cb, Cr) are standard names
"src/fieldwitness/stego/dct_steganography.py" = ["N803", "N806"]
# MDCT transform variables (N, X) are standard mathematical names
"src/fieldwitness/stego/spread_steganography.py" = ["N803", "N806"]
# Package __init__.py has imports after try/except and aliases - intentional structure
"src/fieldwitness/stego/__init__.py" = ["E402"]
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true