Skip to content

✨ feat(repository): add Repository.connect() factory classmethod#403

Merged
sodre merged 3 commits into
mainfrom
feat/381-repository-connect
Feb 19, 2026
Merged

✨ feat(repository): add Repository.connect() factory classmethod#403
sodre merged 3 commits into
mainfrom
feat/381-repository-connect

Conversation

@sodre

@sodre sodre commented Feb 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Repository.connect() async classmethod as the recommended one-call entry point for connecting to existing infrastructure (resolves namespace, performs version check, no infra provisioning)
  • Generate SyncRepository.connect() via the async-to-sync transformer for sync parity
  • Deprecate Repository.__init__() direct construction with DeprecationWarning directing users to connect() or builder()
  • Migrate all CLI data-access commands from direct constructor to a shared _connect() helper that calls Repository.connect()
  • Migrate test fixtures (unit, E2E, integration, benchmark, doctest) from constructor to connect() or builder patterns
  • Update all documentation (CLAUDE.md, README, docs/ guides) to use connect() as the primary example

Test plan

  • uv run pytest tests/unit/ -v passes (connect() unit tests, deprecation warning tests, CLI migration tests)
  • uv run pytest tests/integration/ -v passes with LocalStack
  • uv run pytest tests/e2e/test_localstack.py -v passes with LocalStack
  • uv run mypy src/zae_limiter/ reports no new type errors
  • pre-commit run --all-files passes (sync code generation is up to date)
  • Verify grep -rn "Repository(" tests/ --include="*.py" shows only connect(), builder(), or _skip_deprecation_warning calls

Closes #381

🤖 Generated with Claude Code

The bare `python` command is not available in uv-managed environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sodre sodre added this to the v0.10.0 milestone Feb 19, 2026
@sodre sodre added documentation Improvements or additions to documentation testing Test coverage api-design API surface changes area/limiter Core rate limiting logic labels Feb 19, 2026
@codecov

codecov Bot commented Feb 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.76%. Comparing base (c897641) to head (4ba6a45).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #403   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files          33       33           
  Lines        7333     7333           
=======================================
  Hits         6729     6729           
  Misses        604      604           
Flag Coverage Δ
doctest 29.52% <ø> (-0.03%) ⬇️
e2e 42.68% <ø> (-0.66%) ⬇️
integration 51.84% <ø> (+0.57%) ⬆️
unit 91.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sodre and others added 2 commits February 19, 2026 16:02
…environments

Try bare `python` first (works in CI), fall back to `uv run python`
(works in uv-managed local environments).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mples

The set_system_defaults() method requires a limits argument. The
unavailability guide examples were only passing on_unavailable,
causing doctest failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sodre sodre marked this pull request as ready for review February 19, 2026 21:39
@sodre sodre merged commit 55bb4c0 into main Feb 19, 2026
24 of 25 checks passed
@sodre sodre deleted the feat/381-repository-connect branch February 19, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-design API surface changes area/limiter Core rate limiting logic documentation Improvements or additions to documentation testing Test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Add Repository.connect() factory classmethod as recommended entry point

1 participant