Skip to content

chore: sync pre-commit hook versions with uv.lock; make Instruments real enum members - #39

Merged
aradng merged 1 commit into
mainfrom
chore/sync-pre-commit-with-uv
Oct 10, 2026
Merged

aradng merged 1 commit into
mainfrom
chore/sync-pre-commit-with-uv

Conversation

@aradng

@aradng aradng commented Oct 10, 2026

Copy link
Copy Markdown
Owner
  • sync-with-uv keeps the pre-commit revs of ruff and mypy, and the mypy additional_dependencies marked # sync-with-uv, equal to the versions in uv.lock. mypy moves 1.19.1 → 2.3.0, ruff 0.15.7 → 0.15.21, and the pinned mypy deps to the locked pydantic, typing-extensions, mypy-extensions and types-pyyaml. returns isn't in uv.lock (only mypy's plugin uses it), so it stays unpinned.
  • Instruments had no members. An Enum turns a function value into a method, so Instruments.REDIS was the bare function and list(Instruments) == []; instrument_otel only worked because it calls whatever it gets. mypy 2.3 flagged it. Each value is now enum.member(...); instrument_otel already uses .value for members. No service references Instruments directly. A test pins the members.
  • tests/test_meta.py: the three reads through SelfSustaining's class forwarding get # type: ignore[misc], as the repo allows for that pattern.
  • Version 0.5.8.

Verification: pytest 282 passed; prek run --all-files clean at mypy 2.3.0 and ruff 0.15.21; a second sync-with-uv run changes nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QA7Vjn4bbjxRsvyz8DNHPQ

sync-with-uv rewrites the ruff and mypy revs, and the mypy dependencies
marked `# sync-with-uv`, to the versions uv.lock pins, so the hooks lint
with the same tools as the project. That moves mypy from 1.19.1 to 2.3.0
and ruff from 0.15.7 to 0.15.21.

mypy 2.3 found that Instruments had no members: an Enum turns a function
value into a method, so Instruments.REDIS was the bare function and
list(Instruments) was empty; instrument_otel worked only because it calls
whatever it is given. Each value is now an enum.member, and a test pins
that. The three test_meta reads through SelfSustaining's class forwarding
get the `# type: ignore[misc]` the repo uses for that pattern.

Version 0.5.8.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QA7Vjn4bbjxRsvyz8DNHPQ
@aradng
aradng merged commit 494794a into main Oct 10, 2026
3 checks passed
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