Repository navigation
Simplify the codebase and remove the psutil dependency - #40
Merged
Merged
Conversation
- Replace the psutil-based termination logic with a short function that signals FFmpeg's process group (SIGTERM, then SIGKILL) on Unix and calls terminate() on Windows. - Share the parsing of FFmpeg's progress output between the Rich and tqdm progress bars with a read_progress() generator, and move the handling of unknown durations and failures into FfmpegProcess.run(). - Split FfmpegProcess.__init__ into small helper functions. - Reduce ruff.toml to the settings that differ from Ruff's defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaLfZ2px1aY8V13hGcztsq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaLfZ2px1aY8V13hGcztsq
- Run the test job on ubuntu-24.04: ubuntu-latest is now Ubuntu 26.04, which has no Python 3.9 build for actions/setup-python. - test_failure_includes_log_tail no longer depends on FFmpeg's error wording, which in newer versions does not name the missing encoder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaLfZ2px1aY8V13hGcztsq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaLfZ2px1aY8V13hGcztsq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplifies the package from about 1,120 to 775 lines without changing the public API, and bumps the version to 6.0.1.
terminate_process.py, 244 → 44 lines): FFmpeg already runs in its own process group, so thepsutil-based child walking and fallbacks are replaced by signalling that group (SIGTERM, thenSIGKILLafter 2 seconds) on Linux/macOS, andterminate()on Windows.psutilis removed as a dependency.progress_bars.py, 192 → 98 lines): the Rich and tqdm functions shared near-identical parsing loops. A singleread_progress()generator inutils.pynow reads FFmpeg's output, replacing the two old line parsers.FfmpegProcess:run()now handles the unknown-duration case and the failure check once for both bars.__init__is split into small helpers for log level,duration_overrideand default log-file name.ruff.tomlreduced from 73 to 7 lines (only non-default settings).CHANGELOG.mdupdated.CI fixes
ubuntu-latestis now Ubuntu 26.04, which broke CI independently of the changes above:ubuntu-24.04, because Ubuntu 26.04 has no Python 3.9 build foractions/setup-python.test_failure_includes_log_tailnow checks that the log tail is included rather than FFmpeg's exact wording. Newer FFmpeg versions sayEncoder not foundwithout naming the encoder.Behaviour differences
✓ Processed '<file>'is now printed with Rich too, not only tqdm.loggingmodule.Test plan
ruff checkandruff format --checkpasspytest: 48 tests pass withpsutiluninstalled, including the Ctrl+C testtest.pywith Rich, a tqdm run, and a run with no detectable durationSIGTERMis force-killed after 2 seconds🤖 Generated with Claude Code
https://claude.ai/code/session_01XaLfZ2px1aY8V13hGcztsq