Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 107 130 +23
=========================================
+ Hits 107 130 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 Overview
This release fixes an async correctness bug where a single Timer shared across concurrent
asynciotasks could mix up measurements becausethreading.localdoes not isolate between tasks on the same thread. Timer now uses aContextVarwith per-thread (sync) and per-task (async) stack ownership, so concurrent async tasks sharing one Timer get correct timings regardless of finish order.It also ships a reorganized test suite (split by concern into basics, callbacks, errors, metadata, and reuse), a restructured documentation site (new Quickstart and Cookbook sections), and CI/build improvements (parallel jobs, consolidated dev dependencies, updated pre-commit hooks).
🐛 Bug Fixes
Async Task Isolation
ContextVarreplacesthreading.local— Each asyncio task now gets its own measurement stack viacontextvars.ContextVar, keyed by task identity (id(current_task())). Previously, all tasks on the same thread shared a single stack throughthreading.local, causing incorrect timings when tasks finished out of order.id(current_thread())outside of async contexts.📖 Documentation
recipestocookbook; added new entries for metadata patterns and web-framework integration.aboutsection tooverview.🔧 Improvements
CI/CD
Build
requirements-dev.txt— Replaceddevanddocsoptional-dependency groups with a singlerequirements-dev.txtfor simpler contributor setup.pyproject.toml— Alignedproject.urlswith docs site and GitHub links.Code Quality
ruff-pre-commitandsemgreprevisions; addeddetect-private-keyandcodespellhooks.Testing
block_timing.featureandfunction_timing.featureinto five focused feature files:timer_basics,timer_callbacks,timer_errors,timer_metadata, andtimer_reuse.BUFFER_NStolerances across steps.TYPE_CHECKINGguard in step definitions.📝 Migration Guide
No breaking changes. The fix is internal to Timer's stack management; the public API is unchanged.