feat: multi-Python CI and callback serialization#95
Open
acere wants to merge 6 commits into
Open
Conversation
Implement to_dict/from_dict on Callback base class using a "module:ClassName" type marker (_callback_type) for dynamic dispatch. Any Callback subclass — built-in or third-party — can now round-trip through JSON without a hardcoded registry. - Callback.to_dict() emits _callback_type with fully-qualified class path - Callback.from_dict() dynamically imports and instantiates the correct subclass, delegating to overridden from_dict when present - CostModel.to_dict() injects _callback_type alongside existing _type - CostModel.from_dict() strips both markers before construction - MlflowCallback gains to_dict/from_dict (replaces NotImplementedError stubs) - _RunConfig.save()/load() now serialize and restore callbacks - Replace old Callback base tests with serialization round-trip tests
- Add uv constraint-dependencies to cap onnxruntime<1.24 and gevent<25.5 on Python 3.10 (newer versions dropped cp310 wheels) - Set default-groups to exclude heavy dev group (sagemaker) from test runs - Rewrite multiline f-string in heatmap.py to 3.10-compatible syntax - Replace standalone mock package imports with stdlib unittest.mock
acere
force-pushed
the
feat/multi-python-ci
branch
2 times, most recently
from
July 16, 2026 12:58
7b145ac to
a9e0560
Compare
Add CI workflow (.github/workflows/ci.yml) with lint and test jobs. The test matrix is dynamically derived from pyproject.toml classifiers, so adding/removing a Python version only requires updating one file. Uses actions/checkout@v7 and astral-sh/[email protected] (Node.js 22+). setup-uv handles Python installation directly, no setup-python needed. Also add trove classifiers to pyproject.toml.
acere
force-pushed
the
feat/multi-python-ci
branch
from
July 16, 2026 13:02
a9e0560 to
8ac34f4
Compare
- Set dummy AWS credentials and region in test step env - Add ruff, bandit, and ipykernel to test dependency group
- Scope ruff/format to llmeter/ and tests/ (skip example notebooks) - Add ruff, bandit, ipykernel to test dependency group - Fix abstract class error message match for Python 3.10 - Add audio/wave MIME type support in OpenAI endpoint - Handle missing task.cancelling() on Python 3.10 - Remove unused imports and variables in tests
- Full Python version matrix (from classifiers) on pull_request - Lint + Python 3.12 tests only on push to main - Skip CI entirely for docs-only changes (docs/**, *.md)
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.
Summary
.github/workflows/ci.ymlwith lint (ruff, bandit) and test jobs. The test matrix is dynamically derived frompyproject.tomlclassifiers, so adding/removing a Python version only requires updating one file.mockimports withunittest.mock.to_dict/from_dictonCallbackbase class using a_callback_typemarker ("module:ClassName") for dynamic dispatch. Any Callback subclass—built-in or third-party—can now round-trip through JSON without a hardcoded registry._RunConfig.save()/load()now serialize and restore callbacks.Test plan
uv run pytest --cov=llmeter -m "not integ"passes (921 tests, 89% coverage)