Running the application depended on work_item/scripts/python, which is the work-item helper's launcher: it probes for conda with `command -v`, cannot see a lazily-defined shell function, and falls back to a bare system interpreter with none of the dependencies installed. The application now installs into an ordinary virtualenv instead. That exposed two packaging faults. Pillow, numpy, and scipy were declared test-only although the application imports them at runtime — thumbnails decode through Pillow and the perceptual hash is a DCT over decoded pixels — and an editable install failed outright because setuptools could not choose between photo_pipeline, migrations, and work_item. Both are fixed here, and the OpenAI client moves to a `vision` extra so a review-only install does not pull an API client it never calls. Config.from_env now reads `.env`, or the file named by PHOTO_PIPELINE_ENV_FILE, before it looks at the environment. The file is parsed, never executed: KEY=value lines, comments, optional quotes, no interpolation and no export. Anything already exported wins, so the file is standing configuration and the shell stays the override for one run. The archived CLI's names are mapped as aliases (LLM_API_KEY/GEMINI_API_KEY, LLM_BASE_URL, LIBRARY), so an existing photo_analyzer.env configures the application unchanged. .env, *.env, .venv/, and *.egg-info/ are ignored: the real configuration file holds a live provider key and must never be committed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SH4M1PHPwJsM9btcg8hzCs
53 lines
1.8 KiB
TOML
53 lines
1.8 KiB
TOML
[project]
|
|
name = "photoanalyzer"
|
|
version = "0.1.0"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"fastapi>=0.115",
|
|
"uvicorn>=0.30",
|
|
"sqlalchemy>=2.0",
|
|
"alembic>=1.13",
|
|
"pydantic>=2.7",
|
|
# Imaging is runtime, not test-only: thumbnails decode through Pillow, and the
|
|
# perceptual hash is a DCT over the decoded pixels (services/hashing.py).
|
|
"pillow>=10",
|
|
"numpy>=1.26",
|
|
"scipy>=1.11",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
# The cloud vision provider. Optional because the analysis stage is the only thing
|
|
# that needs it, and a local review-only install should not pull an API client.
|
|
vision = ["openai>=1.30"]
|
|
test = [
|
|
"pytest>=8",
|
|
"httpx>=0.27",
|
|
"playwright>=1.40",
|
|
"pytest-playwright>=0.4",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools]
|
|
# The importable application. ``migrations`` and ``work_item`` live beside it but
|
|
# are not part of the package; without this, an editable install cannot guess.
|
|
packages = ["photo_pipeline"]
|
|
# Browser end-to-end tests also require: python -m playwright install chromium
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
# The frozen CLI archive is evidence, not code under maintenance (US07-01).
|
|
extend-exclude = ["legacy_cli_archive"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
markers = [
|
|
"phase_b: Phase B end-to-end acceptance (US02-07) — API, worker-recovery, and browser journeys",
|
|
"phase_c: Phase C end-to-end acceptance (US03-05) — album proposal API and browser journeys",
|
|
"phase_d: Phase D end-to-end acceptance (US04-06) — guarded rename API, fault, and browser journeys",
|
|
"phase_e: Phase E end-to-end acceptance (US05-06) — upload preflight, uploader, and browser journeys",
|
|
"phase_f: Phase F end-to-end acceptance (US06-06) — archive destination, transfer, and restore journeys",
|
|
]
|