Skip to content

Runner discovery fails on Python 3.12: mediapy 1.2.6 incompatible with numpy 2.5.0 #355

Description

@gtong-nv

Summary

After uv sync --extra runners on Python 3.12, flashdreams-run --help logs warnings for 14 runner entry points that fail to import. The root cause is that mediapy 1.2.6 (latest on PyPI, locked in uv.lock) crashes on import when numpy 2.5.0 is installed (the version uv.lock resolves for Python >= 3.12).

Environment

  • Python 3.12
  • numpy==2.5.0 (from uv.lock)
  • mediapy==1.2.6 (from uv.lock, latest on PyPI)
  • Install: uv sync --extra runners

Reproduction

uv sync --extra runners
uv run python -c "import mediapy"

Fails with:

TypeError: typealias() takes exactly 2 positional arguments (3 given)

Traceback points to mediapy:

class _VideoArray(npt.NDArray[Any]):

NumPy 2.5 redefined numpy.typing.NDArray as a PEP 695 type alias, which can no longer be subclassed this way.

Running flashdreams-run --help then emits warnings like:

Failed to load flashdreams runner entry point 'cosmos2-t2v-2b-720p' -> cosmos_predict2.config:RUNNER_COSMOS2_T2V_2B_720P

Any integration whose config.py imports runner.py at module level (which does import mediapy) is affected. In a fresh sync this includes 14 runners (cosmos2, wan21, causal_forcing, self_forcing, flashvsr, fastvideo, etc.). Omnidreams runners still appear because omnidreams lazy-imports mediapy.

Impact

  • Affected runners are silently skipped during plugin discovery (flashdreams/flashdreams/plugins/registry.py catches the import error and logs a warning).
  • Users following the README quickstart may not notice until they try to run a non-omnidreams model.
  • Core inference is unaffected; mediapy is only used for runner I/O (read_image, read_video, write_video).

Proposed fix

Pin numpy below 2.5 until mediapy releases a compatible version, using the existing workspace override pattern in root pyproject.toml:

[tool.uv]
override-dependencies = [
    ...
    "numpy>=1.24,<2.5",
]

Verified workaround: numpy==2.4.6 + mediapy==1.2.6 imports cleanly and all runners register.

Upstream

  • mediapy: https://github.com/google/mediapy (no release fixing numpy 2.5 NDArray subclassing yet; 1.2.6 is latest on PyPI)
  • numpy 2.5 typing change: NDArray is now a TypeAliasType (PEP 695)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions