Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 101 107 +6
=========================================
+ Hits 101 107 +6
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.
Release v0.6.0: Callbacks, Docs Site, and Project Health
🎉 Overview
This release adds observability hooks to the Timer: optional
on_startandon_endcallbacks so each measurement can be logged, sent to OpenTelemetry, or enqueued to a metrics pipeline. It also ships a documentation site (Zensical, deployed to GitHub Pages), community and repo policy (Code of Conduct, SECURITY, issue/PR templates), CI improvements (pip-audit, 100% coverage enforcement, standardized workflows), and a restructured Makefile with clearer init/clean and contributing docs.API change:
Timerconstructor is keyword-only (Timer(metadata=..., maxlen=...)). ExistingTimer()andTimer(metadata=...)usage is unchanged; positionalTimer(some_dict)is no longer valid.✨ Key Features
🚀 Callbacks on Start and End (New)
on_start(measurement)— Called once per measurement when timing is about to start. TheMeasurementhasmetadataset (deep copy of the Timer’s metadata);wall_timeandcpu_timeareNone. Can be use for logging, setting span context, or enriching metadata from context variables.on_end(measurement)— Called once per measurement when timing has just ended. TheMeasurementhaswall_timeandcpu_timeset. Can be use for logging duration, sending to OpenTelemetry, or enqueueing to a metrics pipeline.Note: Callbacks are synchronous only. For async exporters, schedule work from the callback (e.g.
asyncio.create_task(export(m))in an async context, or use a thread/queue).Example:
See the Callbacks guide and Share results recipe for patterns (logging, file, OpenTelemetry).
🔧 Improvements
Documentation
main.CI/CD
coverage report+fail_under = 100), matrix Python 3.10–3.14; Build job. Workflow names and job names standardized.releaseevents (published/edited); conditional publish step; clearer structure.mainor workflow_dispatch).Code Quality
*, metadata=..., on_start=..., on_end=..., maxlen=...) for clearer API and future extensibility.__version__removed from__all__(still available astimerun.__version__).dev(adds pip-audit),docs(zensical); coveragefail_under = 100.Community and Repo
Developer Experience
PYTHON=, clean removes paths from.gitignore);make help;make test/make test-verbose/make docs/make docs-build/make lint; CONTRIBUTING aligned.make init), development commands, testing (Behave), code style, project structure, PR process, releasing.Testing
📊 Statistics
🧪 Testing
All behavior is covered by Behave, including:
🔄 Breaking Changes
Minor — Constructor is keyword-only;
__all__no longer exports__version__.Timer(),Timer(metadata={...}),Timer(on_end=...), etc. PositionalTimer(some_dict)is invalid and will raise.from timerun import *—__version__is no longer in__all__. Useimport timerunandtimerun.__version__, orfrom timerun import __version__(still works; only star-import is affected).📝 Migration Guide
Timer(metadata=x)(or the appropriate keyword).import timerunandtimerun.__version__, orfrom timerun import __version__.See the documentation site for full guides and recipes.