Skip to content

Wheel packaging of migrations/ and static/ has no test guard — a regression would ship silently #122

Description

@vishalkalbi27

Summary

The recent fix that packages migrations/ and static/ into the wheel (branch
fix/package-static-assets-in-wheel) is correct, but nothing in the test suite guards it.
If the packaging config is reverted or drifts, every test still passes and a broken wheel ships —
which is exactly how the original bug went unnoticed.

Background — the bug that was fixed

Two failures existed only in a real (non-editable) wheel install, never in a checkout or the
Docker deploy (which uses pip install -e):

  1. Migrationsstore.MIGRATIONS_DIR resolved via Path(__file__).parents[3] / "migrations" / "core".
    In a checkout that is <repo>/migrations/core ✅. In a wheel, store.py lands in site-packages/,
    so parents[3] points at the venv root → the directory doesn't exist → glob() returns []
    the server boots on an empty schema with no error at all.
  2. Static assetsmcp_http._STATIC_DIR = Path(__file__).parent / "static", but static/ was never
    listed in pyproject.toml, so it wasn't in the wheel → StaticFiles(directory=…) raises
    "Directory does not exist" when building the app.

Why the test suite cannot catch this

Tests install the package editable (dev.py: --with-editable packages/agami-core[model,server]),
so the data dirs resolve into the source tree, which exists regardless of what pyproject.toml
packages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions