Migrate project from Poetry to uv and consolidate lint tooling#8
Conversation
Outlines 6-step plan to migrate from Poetry to uv: convert pyproject.toml to PEP 621, generate uv.lock, regenerate requirements.txt, update docs, and verify. https://claude.ai/code/session_011VEgunZ3pxABEA5HCpdQeJ
Ruff is already a dev dependency but unconfigured. It replaces black (formatter), isort (import sorting), and flake8 (linter), dropping dev deps from 8 to 5. https://claude.ai/code/session_011VEgunZ3pxABEA5HCpdQeJ
- Convert pyproject.toml from Poetry ([tool.poetry]) to PEP 621 ([project]) - Switch build backend from poetry-core to hatchling - Replace poetry.lock with uv.lock (107 packages resolved) - Drop black, isort, flake8 dev deps in favor of ruff (8 → 5 dev deps) - Add [tool.ruff] config: line-length=120, py310, E/F/W/I rules - Remove [tool.black] and [tool.isort] configs - Regenerate requirements.txt via uv export - Update docs to use uv sync / uv run https://claude.ai/code/session_011VEgunZ3pxABEA5HCpdQeJ
Auto-applied ruff format and ruff check --fix to all Python files, replacing the previously configured black + isort formatting. https://claude.ai/code/session_011VEgunZ3pxABEA5HCpdQeJ
…ogging in transcriber scripts
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 38 minutes and 58 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR migrates the project from Poetry to uv for dependency management, adds a GitHub Actions CI workflow, regenerates a fully-pinned requirements.txt, updates docs and setup/test instructions to use Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s packaging/workflow from Poetry to uv, consolidates lint/format tooling around Ruff, and applies repo-wide formatting/readability updates (including transcriber-related modules and tests).
Changes:
- Replace Poetry configuration with PEP 621
[project]metadata anduvlock/exported requirements. - Configure Ruff as the primary lint tool and apply formatting cleanups across the repo.
- Update documentation and tests to use
uv run/uv syncworkflows.
Reviewed changes
Copilot reviewed 22 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Adds/updates uv lockfile to reflect resolved dependencies under uv. |
requirements.txt |
Replaces the hand-maintained list with an exported, pinned uv requirements set. |
pyproject.toml |
Migrates from Poetry config to PEP 621 + Hatchling build backend; adds Ruff config and dev dependency group. |
poetry.toml |
Removes Poetry-specific virtualenv configuration. |
plan.md |
Adds migration plan documentation for uv + Ruff consolidation. |
README.md |
Updates install instructions to use uv sync and documents uv requirement. |
docs/CLOUD_GPU_SETUP.md |
Updates cloud setup commands to use uv instead of Poetry. |
tests/README.md |
Updates test running/install instructions to use uv. |
tests/test_vtt_to_ttml_cli.py |
Formatting-only changes to align with Ruff/formatting updates. |
tests/test_ttml_utils.py |
Formatting/docstring wrapping adjustments. |
tests/test_ttml_simple.py |
Formatting adjustments (type annotations and long calls). |
tests/test_subtitle_autogen.py |
Import ordering and formatting/docstring wrapping updates. |
tests/test_smil_generation.py |
Formatting/docstring wrapping and minor assertion formatting. |
tests/test_archive_transcriber.py |
Formatting updates and line wrapping for calls/assertions. |
src/python/tools/vtt_to_ttml.py |
Formatting/docstring wrapping and minor line wrapping in logging/calls. |
src/python/tools/ttml_utils.py |
Docstring wrapping and formatting for list comprehensions/calls. |
src/python/tools/remote_whisper_server.py |
Import ordering and formatting updates. |
src/python/tools/archive_transcriber_serverless.py |
Import ordering, typing alias formatting, and general line wrapping cleanup. |
src/python/tools/archive_transcriber_remote.py |
Import reordering and line wrapping cleanup. |
src/python/tools/archive_transcriber.py |
Readability/formatting changes plus a few small refactors in logic and logging. |
src/python/services/subtitle_autogen.py |
Argparse definitions reformatted to single-line where possible. |
main.py |
Significant formatting/refactoring for readability; some behavior-adjacent changes in subtitle generation paths. |
h100_server.py |
Import ordering and line wrapping cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 3 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 3 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
main.py (1)
785-791: Redundant second pass ofshould_filter_segmentin hard-subs branch.
segmentsis already filtered on line 412 (single-track path) andsegments_transon line 387 (both-tracks path). Recomputingfiltered_segments_to_usehere re-appliesshould_filter_segmentto an already-filtered list on every chunk. Harmless, but wasted work on a hot path.♻️ Proposed simplification
- async with aiofiles.tempfile.NamedTemporaryFile(dir=chunk_dir, delete=False, suffix=".srt") as srt_file: - segments_to_use = segments if not args.both_tracks else segments_trans - filtered_segments_to_use = [ - segment for segment in segments_to_use if not should_filter_segment(segment.text) - ] - - srt_content = segments_to_srt(filtered_segments_to_use, start_ts) + async with aiofiles.tempfile.NamedTemporaryFile(dir=chunk_dir, delete=False, suffix=".srt") as srt_file: + segments_to_use = segments_trans if args.both_tracks else segments + srt_content = segments_to_srt(segments_to_use, start_ts)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@main.py` around lines 785 - 791, The code redundantly re-filters segments with should_filter_segment before generating SRTs; instead, use the pre-filtered lists (segments or segments_trans) directly to avoid the extra pass. In the async block around NamedTemporaryFile, remove the filtered_segments_to_use comprehension and pass segments_to_use unchanged into segments_to_srt (keep the existing selection via args.both_tracks), leaving variables like segments, segments_trans, segments_to_use, should_filter_segment and segments_to_srt intact.plan.md (1)
20-20: Clarify that the CI workflow is being added in this migration.Line 20 describes the GitHub Actions workflow as if it currently exists, but per the AI summary this PR "adds a GitHub Actions CI workflow." In the "Current State" section—which describes the pre-migration baseline (note lines 17 and 21 list Poetry and black/isort/flake8 artifacts that will be removed)—this phrasing may mislead readers into thinking the workflow pre-existed.
📝 Suggested wording to clarify the workflow is new
-- CI/CD: GitHub Actions workflow (.github/workflows/ci.yml) runs linting, type-checking, and tests on push/PR +- CI/CD: GitHub Actions workflow added in this migration (.github/workflows/ci.yml) to run linting, type-checking, and tests on push/PR🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plan.md` at line 20, Update the wording in plan.md to clarify the GitHub Actions workflow is being introduced by this PR: change the current line that reads "CI/CD: GitHub Actions workflow (.github/workflows/ci.yml) runs linting, type-checking, and tests on push/PR" to explicitly state the workflow is added in this migration (e.g., "Adds a GitHub Actions CI workflow..."), and ensure the "Current State" section explicitly notes that no GitHub Actions workflow exists prior to this change so readers are not misled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@main.py`:
- Around line 785-791: The code redundantly re-filters segments with
should_filter_segment before generating SRTs; instead, use the pre-filtered
lists (segments or segments_trans) directly to avoid the extra pass. In the
async block around NamedTemporaryFile, remove the filtered_segments_to_use
comprehension and pass segments_to_use unchanged into segments_to_srt (keep the
existing selection via args.both_tracks), leaving variables like segments,
segments_trans, segments_to_use, should_filter_segment and segments_to_srt
intact.
In `@plan.md`:
- Line 20: Update the wording in plan.md to clarify the GitHub Actions workflow
is being introduced by this PR: change the current line that reads "CI/CD:
GitHub Actions workflow (.github/workflows/ci.yml) runs linting, type-checking,
and tests on push/PR" to explicitly state the workflow is added in this
migration (e.g., "Adds a GitHub Actions CI workflow..."), and ensure the
"Current State" section explicitly notes that no GitHub Actions workflow exists
prior to this change so readers are not misled.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 39e37a1e-a7ec-45ca-b9c8-12c5046b2863
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
main.pyplan.mdpyproject.tomlsrc/python/tools/vtt_to_ttml.py
✅ Files skipped from review due to trivial changes (1)
- src/python/tools/vtt_to_ttml.py
🚧 Files skipped from review as they are similar to previous changes (1)
- pyproject.toml
Summary\n- migrate project workflow from Poetry to uv\n- remove Poetry-specific lock/config and align project metadata\n- consolidate lint/format tooling around Ruff and apply repo-wide cleanup\n- include follow-up readability/logging/docs updates in transcriber-related modules\n\n## Validation\n- uv run ruff check .\n- uv run pytest -q (94 passed)\n
Summary by CodeRabbit
New Features
Chores
Documentation
Style