Skip to content

Move media backends into one 'media' extra; base keeps the pure modules (#54) - #56

Merged
thorwhalen merged 2 commits into
mainfrom
media-extra
Oct 14, 2026
Merged

thorwhalen merged 2 commits into
mainfrom
media-extra

Conversation

@thorwhalen

Copy link
Copy Markdown
Collaborator

Closes #54. Under the commitment on reeleehq/reelee#541.

What changes

  • Base install (pip install mixing) now declares only config2py, dol, xdol. The pure modules (srt, chapters, errors, util, egress, transcript, dubbing TTS/SRT) import and work with no media backend.
  • One new extra, media: moviepy, opencv-contrib-python, scipy, pydub, burns, plus numpy, pillow and looks, which only the media modules import. The testing and dev extras include mixing[media], so CI still runs the whole suite.
  • Clear failure without the extra: mixing.audio and mixing.video (and facade names resolving to them, e.g. mixing.Video, dub_video_from_srt) raise ImportError: ... requires the 'media' extra (missing: ...). Install it with pip install 'mixing[media]'. The check is util.require_media_extra, run at the top of both package __init__s via find_spec, so nothing heavy is imported to decide. util.require_package also names the extra for media libs imported lazily (e.g. scipy.signal).
  • No public name removed or renamed. The lazy facade table is untouched.
  • Docs (README, .claude/CLAUDE.md, the mixing skill) updated.

Tests

New mixing/tests/test_guard_base_install.py runs a fresh interpreter with the media libs hidden (sys.modules[name] = None): the pure modules import and load none of them; each media entry point raises the ImportError naming mixing[media]; the pyproject split is pinned. Full suite green locally with the extra installed.

In-fleet dependents

Found by rg over pyproject.toml/setup.cfg under the projects tree. One-line PRs change the dependency to mixing[media]; on a mixing without the extra pip only warns, so they can land before or after this release.

Dependent Relies on mixing for media backends? Action
muvid yes (mixing.audio, mixing.video) reeleehq/muvid#172
reelee yes (assemble_audio_track, replace_audio, concatenate_videos) reeleehq/reelee#646
braidio yes (mixing.video) reeleehq/braidio#103
paces yes (mixing.audio) reeleehq/paces#27
walkthru yes (reelee and synth extras, mixing.audio) reeleehq/walkthru#39
yb yes (mixing.video.thumbnail) issue reeleehq/yb#35 (outside the brief)
tituli, arioso, an no mixing dependency declared none
illustration mentions mixing only in a comment none

For syll-songs: a pinned mixing==0.0.55 is unaffected. An unpinned fresh install needs mixing[media].

Deploy: merging releases to PyPI. Anything that installs mixing unpinned in a fresh environment (reelee-iq deploy, syll-songs rebuilds) must carry mixing[media], or have the dependent PRs above merged first.

Review: small packaging change, tests only (per the review policy).

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 14, 2026 12:07
…modules (#54)

moviepy, opencv-contrib-python, scipy, pydub, burns, numpy, pillow and looks
move from the base dependencies to the 'media' extra. mixing.audio and
mixing.video raise an ImportError naming "pip install 'mixing[media]'" when
the extra is missing. No public name is removed or renamed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 867c5cf into main Oct 14, 2026
10 of 12 checks passed
@thorwhalen
thorwhalen deleted the media-extra branch October 14, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the base install light: media backends (moviepy/opencv/scipy) into extras

1 participant