Releases: SyntaxArc/ArchiPy
Releases · SyntaxArc/ArchiPy
3.8.1
Changed
Dependency Updates
- Elasticsearch Version Bump - Updated Elasticsearch Docker image from 9.1.2 to 9.1.3 in test configuration
- Enhanced test reliability with latest Elasticsearch stable version
- Improved test container compatibility and performance
Code Quality Improvements
- Enhanced Keycloak Utils Type Safety - Improved type handling in Keycloak utilities for gRPC metadata
- Fixed handling of both bytes and string metadata values in gRPC authentication
- Enhanced type conversion safety with proper string/bytes compatibility
- Improved authentication reliability across different gRPC implementations
- MyPy Configuration Enhancements - Expanded MyPy overrides for better type checking coverage
- Added comprehensive overrides for Keycloak utilities, MinIO, Kafka, and payment gateway adapters
- Enhanced type checking for optional imports with proper type placeholders
- Improved development experience with more accurate type checking
Library Updates
- Development Tools - Updated multiple development dependencies for improved tooling
- Updated Ruff from 0.7.4 to 0.12.11 for enhanced linting capabilities
- Updated various type stubs packages for better IDE support and type checking
- Enhanced MkDocs Material theme from 9.6.7 to 9.6.18 for improved documentation
- Core Dependencies - Updated runtime dependencies for better performance and security
- Updated fakeredis from 2.30.1 to 2.31.1 for improved Redis mocking
- Updated sentry-sdk from 2.33.0 to 2.36.0 for better error tracking
- Updated pymysql from 1.1.1 to 1.1.2 for enhanced MySQL compatibility
- Updated behave from 1.3.1 to 1.3.2 for improved BDD testing
Documentation and Code Structure
- Enhanced CLAUDE.md - Comprehensive documentation improvements for Claude Code integration
- Added detailed architecture overview with module descriptions
- Enhanced code style guidelines with Python 3.13+ requirements
- Improved command reference with complete development workflow
- Added comprehensive MyPy configuration documentation
Bug Fixes
Type Safety
- Optional Import Handling - Fixed type assignments for optional gRPC imports
- Resolved type compatibility issues when gRPC dependencies are not available
- Enhanced graceful degradation with proper type placeholders
- Improved development experience with better error messages
Configuration
- Workflow Permissions - Fixed potential security issues in GitHub Actions workflows
- Added proper permissions configuration to prevent unauthorized access
- Enhanced CI/CD security with explicit permission declarations
- Resolved code scanning alerts for workflow security best practices
Full Changelog: 3.8.0...3.8.1
3.8.0
Changed
Build System Migration
- Poetry to UV Migration - Migrated from Poetry to UV for improved performance and modern toolchain
- Replaced Poetry with UV for dependency management and virtual environment handling
- Updated all GitHub Actions workflows to use
astral-sh/setup-uv@v4 - Converted
pyproject.tomlto use standard[project]format with UV-compatible optional dependencies - Updated Makefile commands to use UV equivalents (
uv sync,uv run,uv build) - Updated pre-commit hooks to use UV for tool execution
- Migrated from Poetry build backend to Hatchling for better flexibility
- Updated all documentation to reflect UV usage instead of Poetry
- Significant performance improvements in dependency resolution and installation
Python 3.13 Compatibility
- Modern Type Hints - Updated codebase to use Python 3.13 generic syntax and modern type annotations
- Migrated from
Union[T, None]toT | Nonesyntax throughout the codebase - Updated Generic syntax to use modern Python 3.13 patterns (UP046, UP047)
- Enhanced type safety with improved generic type operations and Comparable protocol
- Fixed type assignment issues in error classes and DTO implementations
- Added comprehensive mypy overrides for flexible data dictionary assignments
- Migrated from
Code Quality Improvements
- Linting and Type Checking - Resolved all ruff and mypy issues across the codebase
- Fixed type annotations and imports across configs, models, and decorators
- Added missing error classes (DeadlineExceededError, DeprecationError)
- Enhanced SQLAlchemy column type compatibility with mapped_column
- Resolved import conflicts and improved code organization
- Added missing docstrings and type hints for better code documentation
- Test Infrastructure Cleanup - Streamlined test helper functions for better maintainability
- Removed unused imports and dependencies from test_helpers.py
- Cleaned up test infrastructure to reduce code duplication
- Improved test execution efficiency and maintainability
CI/CD Enhancements
- GitHub Actions Updates - Updated all GitHub Actions workflows to latest versions
- Bumped actions/setup-python from 4 to 5 for improved Python support
- Bumped actions/cache from 3 to 4 for enhanced caching capabilities
- Bumped actions/checkout from 4 to 5 for better repository access
- Improved workflow reliability and performance across all CI/CD pipelines
Testing Framework Updates
- Behave Version Upgrade - Updated Behave testing framework to version 1.3.1
- Enhanced test execution capabilities with latest Behave features
- Improved test reliability and performance across all test suites
- Better compatibility with modern Python development practices
- MyPy Version Upgrade - Updated MyPy type checker to version 1.17.1
- Enhanced type checking capabilities with latest MyPy features
- Improved type safety and error detection across the codebase
- Better support for Python 3.13 type annotations and modern type patterns
Bug Fixes
Type System
- Generic Type Operations - Fixed generic type operations with Comparable protocol in DTO classes
- SQLAlchemy Compatibility - Resolved SQLAlchemy column type compatibility issues with mapped_column
- Error Class Initialization - Fixed type assignment issues in error classes for better type safety
Configuration
- Type Annotations - Resolved type annotation and inheritance issues in configuration classes
- Validator Documentation - Added missing docstrings to validators for better code documentation
Known Issues
- Remaining Linting Issues - Some minor linting issues remain that are planned for future releases
- 13 ANN401 (any-type) violations for flexible data handling
- 11 ANN201 (missing return type annotations) for public functions
- 8 D415 (missing terminal punctuation) for docstrings
- These issues are intentionally allowed for specific use cases and will be addressed incrementally
Full Changelog: 3.7.0...3.8.0
3.7.0
New Features
Elasticsearch Index Management
- Index Existence Check - Added
index_existsmethod to Elasticsearch adapters for improved index management- New
index_exists()method in both synchronous and asynchronous Elasticsearch ports - Enhanced index lifecycle management with proper existence validation
- Improved error handling and index operation safety
- Better support for index-dependent operations and workflows
- New
CI/CD Pipeline Enhancement
- Dedicated Test Workflow - Implemented comprehensive CI/CD pipeline for automated testing
- Added dedicated GitHub Actions workflow for Behave BDD tests
- Automated test execution on push to main branch and pull requests
- Python 3.13 matrix testing with Poetry dependency management
- Enhanced test reliability and continuous integration capabilities
Improvements
Testing Framework
- Kafka Test Reliability - Enhanced Kafka adapter tests with retry mechanism for improved stability
- Implemented retry logic for Kafka connection tests to handle transient network issues
- Improved test reliability in CI/CD environments with better error handling
- Enhanced test coverage for Kafka adapter functionality
Configuration Management
- PostgreSQL DSN Type Safety - Fixed PostgresDsn type instantiation for improved configuration validation
- Corrected PostgresDsn type handling in configuration templates
- Enhanced type safety for database connection string validation
- Improved configuration error handling and validation
Development Tools
- Dependency Updates - Updated development dependencies for improved tooling and security
- Enhanced Poetry dependency management with latest package versions
- Improved development environment setup and tooling
- Better compatibility with Python 3.13 and modern development practices
Bug Fixes
Test Infrastructure
- Image Version Compatibility - Fixed test container image versions for improved test reliability
- Updated Elasticsearch, Keycloak, and Kafka test container images
- Resolved test environment compatibility issues
- Enhanced test stability across different environments
Error Handling
- Exception Utility Assertions - Fixed error assertion logic in exception utilities
- Corrected error handling in test scenarios for better validation
- Improved error message consistency and debugging capabilities
Dependencies
- Development Tools - Updated development dependencies for improved tooling and security
- Test Containers - Enhanced test container configurations for better test reliability
- CI/CD Tools - Improved GitHub Actions workflow for automated testing
Community Contributions
- @heysaeid - Fixed PostgresDsn type instantiation for improved configuration validation
- @negatic - Enhanced Kafka adapter tests with retry mechanism and improved test infrastructure
- @s.kazemi - Added index_exists method to Elasticsearch adapters and implemented CI/CD test workflow
Full Changelog: 3.6.1...3.7.0
3.6.1
New Features
Security Scanning Integration
- Bandit Security Tool - Added comprehensive security vulnerability scanning to the development workflow
- Integrated Bandit 1.7.8 for automated security analysis of Python code
- Added security scanning to CI/CD pipeline with configurable rules and exclusions
- Enhanced security posture with automated detection of common security issues
- Improved code quality through proactive security vulnerability identification
Enhanced Testing Framework
- Behave 1.3.0 Upgrade - Updated BDD testing framework to latest version with improved async support
- Enhanced async test handling capabilities for better performance and reliability
- Improved test execution efficiency with optimized async context management
- Streamlined test infrastructure with cleaner step definitions and scenario management
- Enhanced test coverage and reliability across all adapter test suites
Improvements
SQLAlchemy Type Safety
- Generic TypeVar Support - Enhanced SQLAlchemy adapters with improved generic type preservation
- Added TypeVar support to preserve concrete entity types in adapter operations
- Improved type safety for database operations with better generic type handling
- Enhanced IDE support and type checking for database adapter usage
- Maintained backward compatibility while improving type inference capabilities
Test Infrastructure
- Streamlined Test Helpers - Refactored and optimized test infrastructure for better maintainability
- Removed redundant test helper functions to reduce code duplication
- Enhanced step definitions with cleaner, more focused implementations
- Improved test scenario context management for better test isolation
- Optimized test execution with reduced overhead and improved performance
Code Quality
Security Enhancements
- Automated Security Checks - Integrated security scanning into development workflow
- Added Bandit configuration with customizable security rules and exclusions
- Enhanced CI/CD pipeline with automated security vulnerability detection
- Improved security posture through proactive code analysis
- Standardized security practices across development team
Testing Improvements
- Enhanced Test Coverage - Improved test reliability and maintainability
- Updated all adapter test suites to work with Behave 1.3.0
- Streamlined test step definitions for better readability and maintenance
- Enhanced test context management for improved test isolation
- Optimized test execution performance and reliability
Dependencies
- Security Tools - Added Bandit 1.7.8 for automated security scanning
- Testing Framework - Updated Behave to version 1.3.0 for improved async support
- Development Tools - Enhanced development workflow with security and testing improvements
New Contributors
- @younesious made their first contribution in #62
Full Changelog: 3.6.0...3.6.1
3.6.0
New Features
gRPC Exception Interceptor System
- Centralized Exception Handling - Implemented comprehensive gRPC server exception interceptors for both synchronous
and asynchronous operations- Added
GrpcServerExceptionInterceptorfor synchronous gRPC services with automatic exception conversion - Added
AsyncGrpcServerExceptionInterceptorfor asynchronous gRPC services with async exception handling - Eliminated the need for repetitive try-catch blocks in individual gRPC service methods
- Automatic conversion of exceptions to appropriate gRPC error responses with proper status codes
- Added
Enhanced Error Handling
- Pydantic Validation Error Handling - Integrated automatic Pydantic validation error processing in gRPC
interceptors- Automatic conversion of ValidationError to InvalidArgumentError with detailed error information
- Structured validation error formatting with field-level error details
- Enhanced debugging capabilities with comprehensive validation error reporting
Language Configuration System
- Global Language Configuration - Added LANGUAGE configuration to BaseConfig for consistent language handling
- Introduced LANGUAGE attribute in BaseConfig with default Persian (FA) language support
- Standardized language type constants to uppercase for ISO compliance
- Improved language handling across error messages and user interfaces
Improvements
gRPC Status Code Management
- Enhanced Status Code Handling - Improved gRPC status code conversion and management in BaseError
- Added static method for converting integer status codes to gRPC StatusCode enums
- Enhanced metadata handling in gRPC abort methods with conditional additional data inclusion
- Refined type hints for context parameters in abort methods for better clarity
- Improved error context preservation and debugging capabilities
Error System Refactoring
- Optional Language Parameters - Refactored error handling classes to use optional language parameters
- Removed mandatory language parameter requirements for improved flexibility
- Enhanced error initialization with automatic language detection from global configuration
- Improved error message consistency and localization support
- Maintained backward compatibility while improving developer experience
Bug Fixes
Error Initialization
- Language Configuration Fix - Fixed language initialization in BaseError to use global configuration
- Ensured language is set correctly from global configuration when not provided during initialization
- Improved error message consistency across different initialization scenarios
- Enhanced code readability and maintainability
Type Safety Improvements
- Enhanced Type Hints - Improved type hints for gRPC status codes and error handling
- Refined type annotations for better IDE support and code reliability
- Enhanced type safety across error handling components
- Improved developer experience with better autocomplete and error detection
Code Quality
- Comprehensive Error Coverage - Updated all error classes to support the new language and gRPC handling system
- Enhanced auth_errors, business_errors, database_errors, network_errors, resource_errors, system_errors, and
validation_errors - Improved error categorization and handling consistency
- Enhanced error reporting and debugging capabilities across all error types
- Enhanced auth_errors, business_errors, database_errors, network_errors, resource_errors, system_errors, and
Full Changelog: 3.5.2...3.6.0
3.5.2
Bug Fixes
Elasticsearch Authentication
- Password Secret Value Extraction - Fixed critical authentication issue in Elasticsearch adapters where password secret values were not being properly extracted
- Updated both synchronous and asynchronous Elasticsearch adapters to use
get_secret_value()method for HTTP_PASSWORD - Resolved authentication failures when using SecretStr password configuration
- Improved security by properly handling encrypted password fields in Elasticsearch configuration
- Updated both synchronous and asynchronous Elasticsearch adapters to use
Dependencies
- Poetry Lock Update - Updated poetry.lock file to Poetry 2.1.2 for improved dependency management
- Enhanced dependency resolution with latest Poetry version
- Updated platform-specific package markers for better cross-platform compatibility
- Improved package hash verification and security
Code Quality
- Authentication Consistency - Standardized password handling across Elasticsearch adapters
- Ensured consistent secret value extraction in both sync and async adapters
- Maintained backward compatibility while improving security practices
- Enhanced error handling for authentication configuration
What's Changed
- Fix Get elastic seea by @majasemzadeh in #57
Full Changelog: 3.5.1...3.5.2
3.5.1
Bug Fixes
HTTP Status Code Handling
- Status Code Name Mismatch - Fixed critical issue in FastAPIExceptionHandler where
http_status_codewas incorrectly referenced- Changed from
exception.http_status_codetoexception.http_status_code_valuefor proper status code retrieval - Resolved HTTP status code name mismatch that was causing incorrect error responses
- Improved error handling consistency in FastAPI exception processing
- Changed from
Improvements
Protobuf DTO Runtime Type Safety
- Runtime Type Checking - Enhanced BaseProtobufDTO with comprehensive runtime type validation
- Added runtime type checking in
from_proto()method to validate input parameter types - Implemented proper type validation before protobuf message processing
- Enhanced error messages with clear type mismatch information
- Added runtime type checking in
Custom Exception Integration
- Custom Exception Handling - Replaced generic TypeError with domain-specific InvalidEntityTypeError
- Updated protobuf DTO type validation to use
InvalidEntityTypeErrorfor better error categorization - Improved error context with expected and actual type information
- Enhanced error handling consistency across the protobuf DTO system
- Updated protobuf DTO type validation to use
Code Quality Enhancements
- Error Handling Consistency - Standardized error handling patterns across protobuf DTO operations
- Improved error message clarity and debugging capabilities
- Enhanced type safety with proper exception chaining
- Maintained backward compatibility while improving error reporting
New Contributors
- @itsnegaar made their first contribution in #56
Full Changelog: 3.5.0...3.5.1
3.5.0
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
New Contributors
Full Changelog: 3.4.5...3.5.0
3.4.5
Improvements
Configuration Template Enhancements
- Improved Readability - Enhanced ElasticsearchAPMConfig size fields to use human-readable string values instead of raw bytes
- Changed
API_REQUEST_SIZEfrom768 * 1024to"768kb"for better configuration clarity - Changed
LOG_FILE_SIZEfrom50 * 1024 * 1024to"50mb"for improved readability
- Changed
- Configuration Clarity - Updated size-related configuration fields to use standard size notation (kb, mb) making configuration files more intuitive and easier to understand
Bug Fixes
- Code Cleanup - Removed redundant files to improve project structure and reduce maintenance overhead
Full Changelog: 3.4.4...3.4.5
3.4.4
Improvements
gRPC Integration Improvements
- Import Safety - Added robust gRPC import handling with try/except blocks to prevent import errors when gRPC is not
available - Type Safety - Enhanced type annotations for gRPC context handling with improved error type definitions
- Error Handling - Improved gRPC error handling with better type safety and context management
Dependency Updates
- Kafka - Updated confluent-kafka to version 2.11.0+ for improved stability and performance
- Keycloak - Updated python-keycloak to version 5.7.0+ for enhanced security and features
- Sentry - Updated sentry-sdk to version 2.33.0+ for better error tracking capabilities
- MyPy - Updated MyPy to version 1.17.0+ for improved type checking and Python 3.13 support
Full Changelog: 3.4.3...3.4.4