Skip to content

Migrate project from Poetry to uv and consolidate lint tooling#8

Merged
yidakra merged 16 commits into
mainfrom
claude/plan-uv-migration-7HF8o
Apr 16, 2026
Merged

Migrate project from Poetry to uv and consolidate lint tooling#8
yidakra merged 16 commits into
mainfrom
claude/plan-uv-migration-7HF8o

Conversation

@yidakra

@yidakra yidakra commented Apr 16, 2026

Copy link
Copy Markdown
Owner

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

    • Added an automated CI workflow for continuous testing and code-quality checks.
  • Chores

    • Migrated dependency management from Poetry to uv and standardized project metadata.
    • Replaced requirements with fully pinned exports for reproducible installs.
  • Documentation

    • Updated setup, cloud GPU, and test instructions to use uv; added a migration plan.
  • Style

    • Widespread code formatting and refactoring for consistent style and readability.

claude and others added 6 commits April 16, 2026 21:37
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
Copilot AI review requested due to automatic review settings April 16, 2026 22:17
@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@yidakra has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 58 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b8265ed-fecd-4459-b232-51ed2584bf94

📥 Commits

Reviewing files that changed from the base of the PR and between 507911e and 3d80707.

📒 Files selected for processing (2)
  • main.py
  • pyproject.toml
📝 Walkthrough

Walkthrough

This 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 uv, and applies widespread formatting/condensing changes across Python source and test files (no public API signature changes).

Changes

Cohort / File(s) Summary
CI / Workflows
​.github/workflows/ci.yml
Add new CI workflow running on PRs, pushes to main, and manual dispatch; sets concurrency, uses Python 3.12, installs deps via uv, then runs ruff, mypy, and pytest.
Dependency & Build Config
pyproject.toml, poetry.toml, plan.md, requirements.txt
Migrate from Poetry to PEP 621 + uv (add [dependency-groups], move scripts to [project.scripts], switch to Hatchling); remove Poetry virtualenv config; add migration plan; replace short requirements with a fully pinned, uv-exported requirements.txt including many transitive/environment-specific pins.
Documentation
README.md, docs/CLOUD_GPU_SETUP.md, tests/README.md
Replace Poetry usage with uv usage (uv sync, uv run ...) and update setup/test instructions accordingly.
Core App Formatting
main.py, h100_server.py
Code formatting and minor refactors: condensed imports, collapsed multi-line constructs to single lines, small logic simplifications (e.g., prompt init change in main.py); no exported API changes.
Transcriber Tools & Services
src/python/tools/archive_transcriber.py, src/python/tools/archive_transcriber_remote.py, src/python/tools/archive_transcriber_serverless.py, src/python/services/subtitle_autogen.py, src/python/tools/remote_whisper_server.py
Widespread formatting/line-wrapping changes, some boolean-expression simplifications, minor logic tweak in probe_video_metadata() bitrate fallback, and small renames/clarifications; signatures unchanged.
Subtitle / TTML Utilities
src/python/tools/ttml_utils.py, src/python/tools/vtt_to_ttml.py
Docstring and type-annotation reflow, condensed function/type annotations and calls; no behavioral changes.
Tests (formatting)
tests/...
tests/test_archive_transcriber.py, tests/test_smil_generation.py, tests/test_subtitle_autogen.py, tests/test_ttml_simple.py, tests/test_ttml_utils.py, tests/test_vtt_to_ttml_cli.py
Refactor test files to single-line imports/fixtures/calls, consolidate mocks/context managers, and adjust minor formatting; test logic preserved.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 From Poetry’s nest I softly hop,
I swapped the carrots for a quicker crop—uv on top.
Workflows hum, the lockfile’s tight,
Lines trimmed tidy through day and night.
Hear the burrow cheer — dependencies delight! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.24% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and clearly describes the primary changes: migrating from Poetry to uv and consolidating lint tooling with ruff.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/plan-uv-migration-7HF8o

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 and uv lock/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 sync workflows.

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.

Comment thread main.py Outdated
Comment thread src/python/tools/archive_transcriber.py Outdated
yidakra and others added 4 commits April 17, 2026 00:20
@yidakra yidakra self-assigned this Apr 16, 2026
Comment thread main.py Outdated
Comment thread plan.md Outdated
Comment thread requirements.txt
Comment thread src/python/tools/vtt_to_ttml.py Outdated
yidakra and others added 2 commits April 17, 2026 00:34
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 3 file(s) based on 2 unresolved review comments.

Files modified:

  • plan.md
  • pyproject.toml
  • uv.lock

Commit: 507911ed1d77bd16d09eb7a86a3e5e66a12ed619

The changes have been pushed to the claude/plan-uv-migration-7HF8o branch.

Time taken: 3m 22s

Fixed 3 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
main.py (1)

785-791: Redundant second pass of should_filter_segment in hard-subs branch.

segments is already filtered on line 412 (single-track path) and segments_trans on line 387 (both-tracks path). Recomputing filtered_segments_to_use here re-applies should_filter_segment to 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

📥 Commits

Reviewing files that changed from the base of the PR and between bbf27f0 and 507911e.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • main.py
  • plan.md
  • pyproject.toml
  • src/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

@yidakra yidakra merged commit 14dc548 into main Apr 16, 2026
2 checks passed
@yidakra yidakra deleted the claude/plan-uv-migration-7HF8o branch April 16, 2026 22:58
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.

3 participants