WP-0001-T001: service scaffold (Python, FastAPI, uv, ruff, mypy, pytest)

Lands the smallest credible foundation per ADR-0005:

- pyproject.toml: hatchling build, runtime deps (FastAPI, uvicorn, SQLAlchemy 2.0,
  asyncpg, aiosqlite, alembic, blake3, cbor2, typer, structlog, pydantic,
  pydantic-settings); dev deps (pytest, pytest-asyncio, httpx, hypothesis, ruff,
  mypy); ruff + mypy --strict + pytest configured.
- uv.lock committed.
- Makefile thin shims: install / dev / test / lint / format / type / migrate / clean.
- src/artifactstore/ package skeleton with placeholder __init__.py per concern:
  identity, manifest, events, retention, audit, storage, dataplane, registry,
  api/http (minimal FastAPI app, GET / scaffold banner), cli (typer app with
  version subcommand), config (pydantic-settings).
- tests/{unit,integration}/conftest.py present; unit smoke tests assert package
  imports, HTTP root route, CLI version round-trip, settings defaults.
- .env.example documents ARTIFACTSTORE_DATABASE_URL,
  ARTIFACTSTORE_STORAGE_LOCAL_ROOT, ARTIFACTSTORE_LOG_LEVEL.
- README updated with install / dev / test instructions.
- .gitignore: claude local state, local runtime data (var/, sqlite db).

make lint && make type && make test pass on a clean checkout (4 tests, 20
source files type-clean under mypy --strict).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 01:30:22 +02:00
parent b1eba9b41e
commit a6b6746f91
27 changed files with 1662 additions and 20 deletions

0
tests/__init__.py Normal file
View File

5
tests/conftest.py Normal file
View File

@@ -0,0 +1,5 @@
"""Top-level pytest configuration.
Shared fixtures land in this module as the test suite grows. The scaffold
keeps it empty so unit and integration suites configure themselves.
"""

View File

View File

@@ -0,0 +1,5 @@
"""Integration-test pytest configuration.
Integration suites require a database and storage backend; configuration
fixtures land here as those layers come online in later tasks.
"""

0
tests/unit/__init__.py Normal file
View File

1
tests/unit/conftest.py Normal file
View File

@@ -0,0 +1 @@
"""Unit-test pytest configuration."""

35
tests/unit/test_smoke.py Normal file
View File

@@ -0,0 +1,35 @@
"""Smoke tests asserting the scaffold imports cleanly."""
from __future__ import annotations
from typer.testing import CliRunner
import artifactstore
from artifactstore.api.http import app as http_app
from artifactstore.cli import app as cli_app
from artifactstore.config import Settings, get_settings
def test_package_version_exposed() -> None:
assert isinstance(artifactstore.__version__, str)
assert artifactstore.__version__
def test_http_app_root_route_registered() -> None:
routes = {getattr(r, "path", None) for r in http_app.routes}
assert "/" in routes
def test_cli_version_command_round_trips() -> None:
runner = CliRunner()
result = runner.invoke(cli_app, ["version"])
assert result.exit_code == 0, result.output
assert artifactstore.__version__ in result.output
def test_settings_defaults_loadable() -> None:
settings = get_settings()
assert isinstance(settings, Settings)
assert settings.log_level
assert settings.database_url
assert settings.storage_local_root