Skip to content

v0.4.0#4

Merged
HH-MWB merged 9 commits intomainfrom
v0.4.0
Jan 25, 2026
Merged

v0.4.0#4
HH-MWB merged 9 commits intomainfrom
v0.4.0

Conversation

@HH-MWB
Copy link
Copy Markdown
Owner

@HH-MWB HH-MWB commented Jan 25, 2026

Release v0.4.0: Async Support and Enhanced Testing

🎉 Overview

This release introduces async/await support for the Timer class, making TimeRun compatible with modern asynchronous Python code. Additionally, this PR includes significant improvements to CI/CD infrastructure, code quality, and test coverage.

✨ Key Features

🚀 Async Support (Major Feature)

  • Async context manager support: Use async with Timer() to measure async code blocks
  • Async function decorator: Decorate async functions with @timer to automatically measure execution time
  • Async generator support: Full support for async generator functions
  • Backward compatible: All existing synchronous functionality remains unchanged

Example Usage:

# Async context manager
async def async_code():
    async with Timer() as timer:
        await asyncio.sleep(0.1)
    print(timer.duration)

# Async function decorator
timer = Timer()
@timer
async def async_func():
    await asyncio.sleep(0.1)

🔧 Improvements

CI/CD Enhancements

  • ✅ Updated GitHub Actions workflows to use latest actions and Python 3.11
  • ✅ Integrated Codecov for automated coverage reporting
  • ✅ Added support for Python 3.14 in CI matrix
  • ✅ Improved test dependency installation based on pyproject.toml
  • ✅ Fixed pre-commit configuration to be flexible on Python version

Code Quality

  • ✅ Switched to pyenforce hook and addressed all linting issues
  • ✅ Enhanced type hints and protocol definitions
  • ✅ Improved error handling and exception messages

Testing

  • ✅ Expanded test suite with comprehensive async test coverage
  • ✅ Enhanced test fixtures and configuration
  • ✅ Improved test organization and maintainability

Documentation

  • ✅ Updated README with async usage examples
  • ✅ Updated shields.io badges
  • ✅ Enhanced documentation with latest features

📊 Statistics

  • Files changed: 12
  • Additions: +721 lines
  • Deletions: -199 lines
  • Net change: +522 lines

🧪 Testing

All tests pass, including:

  • ✅ Existing synchronous tests
  • ✅ New async/await tests
  • ✅ Async generator tests
  • ✅ Context manager tests (sync and async)

🔄 Breaking Changes

None - This release is fully backward compatible with existing code.

📝 Migration Guide

No migration needed! Existing code will continue to work as before. To use the new async features, simply use async with instead of with for async code blocks, or use the @timer decorator on async functions.

@HH-MWB HH-MWB self-assigned this Jan 25, 2026
@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@HH-MWB HH-MWB marked this pull request as ready for review January 25, 2026 16:51
@HH-MWB HH-MWB merged commit 24add9e into main Jan 25, 2026
8 checks passed
@HH-MWB HH-MWB deleted the v0.4.0 branch January 25, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants