Skip to content

v1.5.0 - Modernise Infrastructure, Refactor Core Logic, and Introduce Numeric Validation

Choose a tag to compare

@chrimaho chrimaho released this 28 Dec 10:54
· 11 commits to main since this release

📋 Summary

Modernise the development infrastructure, refactor core logic for better maintainability, and expand the utility suite with new validation capabilities. Transition the project to uv for package management, introduce code complexity analysis, and refactor the retry() decorator into a robust class-based implementation.

🚀 Infrastructure Modernisation

  • Package Management: Standardise on uv for all package management, environment synchronisation, and script execution tasks.
  • Dependency Consolidation: Remove the requirements/ directory and Makefile in preference for a unified pyproject.toml configuration.
  • Python 3.14 Support: Update CI/CD workflows to include Python 3.14 in the test matrix, ensuring forward compatibility.
  • Windows Compatibility: Fix UnicodeEncodeError in CI by forcing UTF-8 encoding for log output on Windows runners.

🛠️ Core Refactoring & Quality

  • Retry Logic: Refactor the retry() decorator into a helper _Retry() class, reducing cyclomatic complexity from 17 to 4 and improving modularity.
  • Metadata Management: Replace hardcoded version strings with dynamic retrieval via the metadata() function, simplifying the release process.
  • Type Checking: Replace mypy with ty for faster and more consistent type checking across the codebase.
  • Complexity Analysis: Integrate complexipy to automate code complexity monitoring and enforce maintainability standards.

🧪 New Validation Utilities

  • Validators() Class: Introduce the Validators() class to centralise logic for numeric range validation.
  • Range Checks: Implement .value_is_between() and .all_values_are_between() methods for flexible boundary checking.
  • Assertion Support: Provide .assert_value_is_between() and .assert_all_values_are_between() methods to raise descriptive AssertionError() class exceptions.

📖 Documentation & DX

  • README Overhaul: Update README.md with modernised setup guides, uv workflows, and expanded quality assurance documentation.
  • Docstring Standardisation: Migrate docstring formatting checks to a pre-commit hook using docstring-format-checker.
  • Utility Scripts: Refactor src/utils/scripts.py to use dynamic package constants and improve subprocess handling.

🔍 Technical Improvements

  • Type Hint Enhancements: Standardise type annotations using Optional, Union, and Literal for better compatibility and clarity.
  • Pylint Remediation: Resolve numerous Pylint warnings and suppress specific flags where appropriate to maintain a 10/10 quality score.
  • Exception Handling: Standardise exception storage and update return type hints (e.g., NoReturn) for better static analysis.

💪 What's Changed

  • Modernise Infrastructure, Refactor Core Logic, and Introduce Numeric Validation by @chrimaho in #38

Full Changelog: v1.4.1...v1.5.0