3.5.0 — 2025-07-26¶
← 3.5.1 | 3.4.5 → | ↑ 3.x series
New Features¶
Protobuf DTO Support¶
- BaseProtobufDTO - Added new base class for Data Transfer Objects that can be converted to and from Protobuf
messages
- Provides seamless integration between Pydantic DTOs and Google Protocol Buffers
- Supports bidirectional conversion with
from_proto()andto_proto()methods - Includes runtime dependency checking for protobuf availability
- Maintains type safety with proper error handling for missing protobuf dependencies
Bug Fixes¶
Type Safety Improvements¶
- ClassVar Type Variable Issue - Fixed critical type annotation issue in BaseProtobufDTO where ClassVar contained
type variables
- Resolved
ClassVarparameter cannot include type variables error - Updated type annotations to use concrete
Messagetype instead of type variables - Improved type safety by using proper concrete types for class variables
- Added comprehensive type annotations for all methods and parameters
- Resolved
Code Quality Enhancements¶
- Import Cleanup - Removed invalid Unicode characters and simplified import structure
- Fixed invisible Unicode character
\uabthat was causing linter errors - Streamlined protobuf import logic by removing unnecessary type variables
- Enhanced code readability and maintainability
- Added proper docstring formatting with Google-style documentation
- Fixed invisible Unicode character
Linting Configuration¶
- Ruff Configuration - Updated linting rules to accommodate protobuf DTO patterns
- Added
ANN401exception forbase_protobuf_dto.pyto allowAnytypes in*argsand**kwargs - Maintained strict type checking while allowing necessary flexibility for DTO inheritance patterns
- Ensured all pre-commit hooks pass without compromising code quality standards
- Added