2.7 KiB
Dependency Policy
Date: 2026-04-09
Goal
Keep one explicit dependency contract per use case and avoid drift between packaging metadata, manual installs, and CI tooling.
Source Of Truth
requirements.txtis the primary dependency source of truth for the project.requirements.txtis also the default runtime install contract for the extension.requirements-vector.txtextends runtime with optional AI/vector dependencies.requirements-dev.txtis the contributor tooling layer for tests, linting, typing, and security checks.pyproject.tomlmirrors published metadata and optional dependency groups for packaging, but does not replacerequirements.txtas the source of truth used by users and CI.
Dependency Roles
Runtime
Put a dependency in requirements.txt only if the extension needs it for normal backend operation.
Examples:
aiohttpaiosqlitepillowavsend2trash
Optional AI / Vector
Put a dependency in requirements-vector.txt only if it is required for optional AI, vector search, captioning, clustering, or related enrichment features.
This file must include -r requirements.txt so it always layers on top of the runtime baseline.
Dev / Contributor Tooling
Put a dependency in requirements-dev.txt only if it is used to develop, test, lint, type-check, or audit the project locally or in CI.
Examples:
pytestruffmypybanditpip-audit
Dev tools must not be added to requirements.txt just because CI uses them.
Update Rules
When adding or changing a dependency:
- Decide whether it is
runtime,vector, ordev. - Update
requirements.txtfirst when the dependency affects the main project baseline. - Update the matching extension file when the dependency is optional or contributor-only.
- Mirror the change in
pyproject.tomlwhen it affects published metadata. - Update docs if the install story or contributor workflow changed.
- Run the relevant tests or quality checks for the impacted area.
CI And Quality Gate Expectations
- Runtime security auditing targets
requirements.txt. - Contributor tooling is installed from
requirements-dev.txtfor local development and quality workflows. - Optional AI/vector installs remain opt-in and must not become implicit in the default setup.
Non-Goals
- No hidden dependency source in ad hoc scripts.
- No “install everything always” default for end users.
- No divergence between README instructions and the actual files used by installs.
Quick Commands
# Runtime only
pip install -r requirements.txt
# Runtime + optional AI/vector features
pip install -r requirements.txt -r requirements-vector.txt
# Contributor tooling
pip install -r requirements-dev.txt