Skip to content

Make index_videos.py CI-testable (lazy-import heavy deps) #13

Description

@niranjans

Spun off from Codex review of #11.

src/framedex/index_videos.py imports the whole runtime stack (whisperx, requests) at module level and sys.exit(1)s on ImportError. CI only installs the dev + test groups (no whisperx/torch), so the entire module — not just one test — is uncoverable by CI. tests/test_index_videos.py currently uses pytest.importorskip("whisperx") to avoid breaking CI; the test runs locally but not in the gate.

Effect: a regression in any function inside index_videos.py (including the relative-path writer from #4 / #11) could land without CI catching it.

Options:

  • Move import whisperx / import requests to lazy imports inside the functions that use them; keep a friendly _assert_runtime() called from main() so the user-facing error message stays.
  • Or extract the sidecar frontmatter assembly into a stdlib-only module (e.g. framedex/sidecar.py) and have index_videos.write_sidecar delegate to it.

Either way the goal is: importing write_sidecar works without whisperx installed, so writer behavior can be regression-tested in CI.

No work scheduled yet — tracking only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions