Skip to content

Adopt uv for dependency management, add ruff and ty#15

Open
Broyojo wants to merge 1 commit into
mainfrom
chore/uv-ruff-ty
Open

Adopt uv for dependency management, add ruff and ty#15
Broyojo wants to merge 1 commit into
mainfrom
chore/uv-ruff-ty

Conversation

@Broyojo

@Broyojo Broyojo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Modernizes the project tooling:

  • pyproject.toml + uv replace requirements.txt. Setup is now uv sync and uv run main.py / uv run build.py; uv.lock is committed for reproducible installs. README updated.
  • pynput unpinned from the git PR ref (refs/pull/541/head) to the released package (>=1.8.2) — that PR's Apple Silicon support has long since shipped in releases, and the git ref was a liability (branch could disappear, blocked CI caching).
  • wmi gets a Windows-only environment marker instead of installing everywhere.
  • ruff (default rules + import sorting): fixed all findings — bare except:s, type(x) == y comparisons, import order, unused f-string prefix.
  • ty: configured with python-platform = "all" so platform-guarded code (os.startfile, ctypes.windll) isn't flagged; fixed the real findings — Qt property kwargs that aren't in the PyQt6 stubs (converted to explicit setChecked/setCheckable calls), closeEvent override signature, and _get_bitrate_mbps returning None for unlisted fps values instead of falling through to the linear model.

Both uv run ruff check . and uv run ty check now pass, with one intentional exception: ty still warns about obs.error in obs_client.py — that's a real bug (crash on recent obsws-python) fixed by #12, and the warning disappears once it merges. Nice independent confirmation that the type checker earns its keep.

Verified with uv run python -c "import ducktrack" — the full app package imports cleanly under the locked environment.

Notes

Independent of #12/#13/#14 (different files/hunks) — can merge in any order. A ruff format pass over the repo is deliberately not included to keep the diff reviewable; happy to do it as a follow-up.

🤖 Generated with Claude Code

- pyproject.toml replaces requirements.txt; deps managed with uv
  (uv sync, uv run main.py), lockfile committed for reproducibility
- pynput moved from a git PR ref to the released package (>=1.8.2),
  which includes the Apple Silicon support the pin was for
- wmi is now correctly Windows-only via an environment marker
- ruff configured (default rules + import sorting) and findings fixed:
  bare excepts, type() comparisons, unused f-string, import order
- ty configured with python-platform = "all" for the platform-guarded
  code paths; fixed the real findings it surfaced (Qt property kwargs
  not in stubs, closeEvent override signature, _get_bitrate_mbps
  returning None for unknown fps values)

The remaining ty warning about obs.error is a real bug fixed in #12.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant