4.17.1
·
44 commits
to master
since this release
Added
Adapters - Keycloak
- Adapter Mixins - Split the Keycloak adapter and port definitions into focused mixins (
auth,auth_flows,authz,client_scopes,clients,components,connection,groups,organizations,realms,roles,uma,users) plus a shared exception-handling mixin.- Reduced
adapters.pyandports.pyfrom monolithic multi-thousand-line files to thin compositions of mixins.
- Reduced
Adapters - Redis
- Adapter Mixins - Split the Redis adapter and port definitions into focused mixins (
arrays,cluster,connection,hashes,keys,lists,pubsub,sets,sorted_sets) plus a shared exception-handling mixin, mirroring the Keycloak mixin architecture.
Changed
Configs - Ruff Lint Baseline
- Stricter Rule Enforcement - Removed 22 rules from the Ruff ignore list —
ANN002,ANN003,C901,D107,EM101,EM102,F811,G004,PLR0904,PLR0914,PLR1702,PLR2004,Q000,RUF001,S101,S301,S403,SIM108,TC001,TC002,TC003,TRY003— now enforcing McCabe complexity limits,TYPE_CHECKING-gated imports,%-style logging, no magic values in comparisons,__init__docstrings, and exception messages defined on the exception class rather than inline.- Added
PLR0917(too many positional arguments) to the ignore list for abstract methods that must match external APIs.
- Added
- Narrowed Source Scope -
ruffsrcnow targets onlyarchipy(previouslyarchipyandfeatures); this is what caused CI'sformat --checkto start walkingdocs/*.md(see Fixed). - Cleaned Per-File Ignores - Removed ignores that were no longer needed once the underlying code was refactored to comply (
BLE001on Redis/ScyllaDB/Keycloak adapters,PLR0912/PLR0915on decorators and the gRPC trace server interceptor,features/steps/*,scripts/*) and added matching entries for the newadapter_mixins/*andport_mixins/*packages in Keycloak and Redis so they inherit their parentadapters.py/ports.pyexemptions.
Configs - Type Checking
- Strict
tyRule Set - Enabled 41 additionaltyrules at error level, covering dataclass/enum/generic/typed-dict correctness (invalid-dataclass,invalid-generic-enum,invalid-typed-dict-field,dataclass-field-order, ...),final/override checks (final-without-value,override-of-final-variable,abstract-method-in-final-class, ...), and misuse detection (unused-awaitable,pydantic-discarded-extra-argument,shadowed-type-variable,isinstance-against-protocol); removed the deprecatedinvalid-type-guard-callrule.
Helpers - Error Handling
- Specific Exceptions Over
ValueError-BaseError.abort_grpc_async/abort_grpc_sync/_convert_int_to_grpc_statusnow raiseInternalErrorwhen gRPC is unavailable andInvalidArgumentErrorfor an invalid gRPC context, instead of bareValueError. sqlalchemy_atomicArgument Validation -sqlalchemy_atomic_decoratornow raisesInvalidArgumentError(with the validdb_typevalues inadditional_data) instead ofValueErrorfor an unrecognized database type.
Adapters - Logging
- Log Formatting - Standardized logger calls to
%-style formatting and removed f-strings from debug/info logs across email, Parsian/Saman IPG, Keycloak, ScyllaDB, and Redis adapters, satisfying the newly enforcedG004.
Fixed
Configs - CI
- Ruff Format Check - Restricted the
ruff-actionsrcinput soformat --checkno longer walks Markdown code fences underdocs/, which broke after Ruff 0.16 started formatting Markdown.
Models - DTOs
- Redis Search DTO Rebuild -
KnnQueryDTOandRangeQueryDTOimported their field enums only underTYPE_CHECKING, causing Pydantic model rebuilding to fail at runtime; the enums are now imported unconditionally.
Refactored
Helpers - Decorators & Interceptors
- Complexity Reduction - Split
tracing.py's transaction/span decorators,sqlalchemy_atomic.py's exception mapping and wrapper construction,string_utils.py's Persian text normalization/masking pipeline,tracing_utils.py, and the gRPC trace/metric/rate-limit interceptors into smaller private helper functions to satisfy the newly enforced McCabe complexity limit (C901).
Adapters & Helpers - Type Imports
TYPE_CHECKINGMigration - Moved typing-only imports (Callable,Coroutine, session manager ports, language/error types, and others) behindTYPE_CHECKINGacross SQLAlchemy, Elasticsearch, Email, Parsian/Saman IPG, Kafka, Keycloak, Redis, ScyllaDB, and Temporal adapters, plus decorators, interceptors, and error modules, to satisfyTC001–TC003.
Chore
Configs
- Type Annotation Fixes - Added targeted
ty: ignore[no-matching-overload]foros.fspathanddict.getcall sites,noqa: LOG004forlogger.exceptionusage, and reordered union types in Kafka/Redis return annotations ahead of the stricter rule rollout.
Tooling
- Graphify Integration - Added the Graphify Cursor plugin,
.opencodeconfiguration, and a workspace rule so agents query a codebase knowledge graph instead of ad-hoc grepping.
Adapters - Redis
- Test Environment Images - Bumped Redis, StarRocks, and ScyllaDB container images in
.env.testfor compatibility with the mixin-based adapter.
Dependencies
- Refreshed
uv.lockacross thetyrule rollout, Graphify plugin addition, and Redis mixin refactor.
Full Changelog: 4.17.0...4.17.1