Skip to content

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() and to_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 ClassVar parameter cannot include type variables error
    • Updated type annotations to use concrete Message type instead of type variables
    • Improved type safety by using proper concrete types for class variables
    • Added comprehensive type annotations for all methods and parameters

Code Quality Enhancements

  • Import Cleanup - Removed invalid Unicode characters and simplified import structure
    • Fixed invisible Unicode character \uab that 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

Linting Configuration

  • Ruff Configuration - Updated linting rules to accommodate protobuf DTO patterns
    • Added ANN401 exception for base_protobuf_dto.py to allow Any types in *args and **kwargs
    • Maintained strict type checking while allowing necessary flexibility for DTO inheritance patterns
    • Ensured all pre-commit hooks pass without compromising code quality standards