chore(toolchain): refresh lockfile, declare db deps, and align hooks with uv.lock - #158
Merged
Conversation
…with uv.lock The lockfile had not moved since March: google-adk sat at 1.26.0 while PyPI shipped 2.8.0, and uv-secure failed CI lint on stale starlette, urllib3 and sqlparse advisories. Upgrading surfaced a packaging defect: google-adk 2.x moved SQLAlchemy and aiosqlite behind its optional `db` extra, so this package imported sqlalchemy without declaring it. The pre-commit line also pinned ruff, uv and uv-secure through mirrors whose versions drifted from the lockfile CI installs. - Declare sqlalchemy[asyncio]>=2.0 and aiosqlite>=0.20 as direct dependencies; `uv lock --upgrade` to google-adk 2.8.0, cryptography 50.0.1, ruff 0.16.5, ty 0.0.78, pytest 9.1.1, docvet 1.15.1 - Run every Python hook through `uv run` so pre-commit and CI share one pinned version; add pre-commit-hooks whitespace/EOF/merge/large-file checks; pin docvet and actionlint actions by SHA in CI - Adopt ruff 0.16 defaults: keep E402 on, ignore RUF022 (our __all__ is plain-alphabetical by test), allow DTZ in tests and spikes, format Markdown code fences; exclude _bmad, _bmad-output, .specify from formatters - Move to PEP 639 license metadata, widen uv_build to <0.13, drop the now-unused pygments uv-secure ignore, refresh contributor docs Test: pre-commit run --all-files; uv run pytest (295 passed on google-adk 2.8.0)
- Raise aiosqlite floor to >=0.21 (the floor every supported google-adk already enforces) and correct the rationale: only sqlalchemy moved behind the `db` extra; aiosqlite is declared because it is our driver - Merge the duplicated Raises section in _rotate_table - Refresh the docvet row and add griffe and yamllint rows in the technology table; note which hooks are gated on lockfile changes - Drop the marker-assignment ignore comment now that the locked google-adk 2.8.0 declares the PrivateAttr
Copilot review follow-up. The PR description said .specify and .claude/commands were excluded from formatters, but only the whitespace hooks excluded them. Ruff currently passes on both, but they are generated by speckit and should not drift into the ruff gate either.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
uv-secure intermittently exits 3 with "<package> raised exception" while fetching advisories (seen on this branch's first run against main). Real findings exit 1 and still fail immediately; only the crash class is retried, mirroring the guard quantfit carries for the same tool.
There was a problem hiding this comment.
🟢 Approval recommended
No functional or CI-blocking issues were identified in the reviewed changes, with only a minor docstring clarity nit suggested.
Pull request overview
This PR refreshes the Python toolchain/lockfile and aligns local/CI quality gates around uv.lock, while fixing an import-time packaging gap introduced by google-adk 2.x moving SQLAlchemy behind an optional extra.
Changes:
- Declare
sqlalchemy[asyncio]>=2.0andaiosqlite>=0.21as direct runtime dependencies and update related docs. - Align pre-commit and CI to run Python tooling via
uv run, and add additional linting checks (yamllint/actionlint) to CI. - Update ruff configuration and apply resulting formatting/docstring updates across code, tests, and documentation.
File summaries
| File | Description |
|---|---|
| tests/unit/test_models.py | Switch test UTC handling to datetime.UTC constant usage. |
| tests/integration/test_docs_examples.py | Remove inline noqa in favor of config-based ignores for exec-based doc tests. |
| src/adk_secure_sessions/services/models.py | Normalize UTC handling to UTC constant and update related docstrings/comments. |
| src/adk_secure_sessions/services/encrypted_session.py | Type decrypt_dispatch, adjust imports, and document direct DB dependency rationale. |
| src/adk_secure_sessions/rotation.py | Clarify error semantics and document intentional broad exception handling. |
| scripts/spike_typedecorator.py | Keep spike script aligned with new UTC handling. |
| README.md | Minor formatting for getting-started snippet readability. |
| pyproject.toml | Add DB deps, adopt PEP 639 license metadata, update ruff config and dev tool versions. |
| examples/basic_usage.py | Docstring improvement and removal of now-unneeded noqa on a fixed SQL string. |
| docs/reference/index.md | Ruff-driven code-fence formatting/whitespace adjustments. |
| docs/project-overview.md | Update dependency/tooling table to reflect new direct deps and versions. |
| docs/index.md | Ruff-driven code-fence formatting/whitespace adjustments. |
| docs/how-to/key-rotation.md | Formatting alignment for code example comments. |
| docs/how-to/backend-authoring.md | Formatting alignment for code examples and registry snippet. |
| docs/getting-started.md | Formatting alignment for code examples. |
| docs/development-guide.md | Update hook documentation to match new uv run-based workflow. |
| docs/adr/ADR-001-protocol-based-interfaces.md | Minor formatting adjustment in code example. |
| CONTRIBUTING.md | Update hook documentation and formatting for examples. |
| .pre-commit-config.yaml | Move Python hooks to uv run, add pre-commit-hooks checks, and make runs consistent with CI. |
| .gitignore | Whitespace-only comment cleanup. |
| .github/workflows/ci.yml | Add yamllint/actionlint to lint job and pin docvet/actionlint actions by SHA. |
| .claude/rules/python.md | Align style example with double-quote formatting convention. |
| .claude/rules/pytest.md | Formatting alignment for examples (ruff-driven). |
Review details
- Files reviewed: 21/24 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+9
to
+12
| SQLAlchemy (with the ``asyncio`` extra) is declared as a direct dependency of | ||
| this package: google-adk 2.x moved it behind its optional ``db`` extra, so it | ||
| can no longer be inherited transitively. ``aiosqlite``, the driver behind the | ||
| default ``sqlite+aiosqlite://`` URL, is declared for the same reason. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lockfile had not moved since March: google-adk sat at 1.26.0 while PyPI shipped 2.8.0, and
uv-securewas failing the CI lint job on stale starlette, urllib3, and sqlparse advisories (this was the redlintcheck on #156). Upgrading surfaced a packaging defect: google-adk 2.x moved SQLAlchemy and aiosqlite behind its optionaldbextra, so this package importedsqlalchemywithout declaring it and would fail at import for anyone installing against ADK 2.x.aiosqlitestayed a core ADK dependency but is declared too, since it is the driver behind our default URL. The pre-commit line also pinned ruff, uv, and uv-secure through mirrors whose versions drifted from the lockfile CI installs, the same pattern quantfit and saucier already moved away from.sqlalchemy[asyncio]>=2.0andaiosqlite>=0.21as direct dependencies;uv lock --upgradeto google-adk 2.8.0, cryptography 50.0.1, ruff 0.16.5, ty 0.0.78, pytest 9.1.1, docvet 1.15.1uv runso pre-commit and CI share one pinned version; addpre-commit-hookswhitespace/EOF/merge-marker/large-file checks; pin the docvet and actionlint actions by SHA in CI and add yamllint + actionlint steps to the lint jobE402on, ignoreRUF022(our__all__ordering is plain-alphabetical, enforced bytest_public_api.py), allowDTZin tests and spike scripts, let ruff format Markdown code fences; exclude the framework-generated_bmad,_bmad-output,.specify, and.claude/commandstrees from ruff and from the whitespace hooksuv_buildto<0.13, drop the now-unused pygmentsuv-secureignore, refresh the hook tables in CONTRIBUTING and the development guideTest:
pre-commit run --all-files(all 14 hooks green);uv run pytest(295 passed on google-adk 2.8.0)PR Review
Checklist
uv run pytest)uv run ruff check .)!in title andBREAKING CHANGE:in bodyReview Focus
uv-securedoes run under--all-files, that the 1.22.0 CI cell keeps SQLAlchemy after the downgrade, and that the BLE001 suppression is load-bearing. It found the aiosqlite rationale was wrong (only SQLAlchemy moved behind the extra), a duplicatedRaises:block, and a stale docvet row; all fixed.relaxedpreset without--strict, so it only fails on syntax errors. Adding--strictwould currently fail on two long lines inci.yml. Separate decision.fix/adk-2x-compatibility, merged as fix(session): restore compatibility with google-adk 1.22.0 through 2.8.0 #156) was deleted. Same three commits, rebased ontomain. Copilot's review of chore(toolchain): refresh lockfile, declare db deps, and align hooks with uv.lock #157 is already addressed and answered there.pyproject.tomldependencies: the newsqlalchemy[asyncio]andaiosqliteentries are a real fix, not housekeeping. Without themuv syncon the upgraded lock has nosqlalchemymodule at all.test_docs_examples.pystill executes the getting-started snippet and passes.ty0.0.78 needed a typeddecrypt_dispatchdict and a# ty: ignore[invalid-method-override]on_get_schema_classes(the old# type: ignore[override]form is not honoured).pytest-randomly, file-size and doc-ref gate scripts. Each is a separate decision.Related