Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a08b7bb
Basic template of the project
Apr 9, 2026
eadf7bb
Add full documentation with examples and feature comparison
Apr 9, 2026
728d0bb
Update spec.md to clarify documentation language, code formatting, and
Apr 9, 2026
05c4e1f
Better readme
Apr 9, 2026
0bb653b
Better readme
Apr 9, 2026
074e8a3
Export core classes from microbenchmark.__init__.py
Apr 9, 2026
128d85d
Implement core benchmarking classes: Scenario, ScenarioGroup, and
Apr 9, 2026
1d1a3b0
Add noqa comment to Scenario.__init__ for PLR0913
Apr 9, 2026
62d8d36
Basic unit tests
Apr 9, 2026
1aef2dd
Typing tests
Apr 9, 2026
faaa395
Tests for CLI
Apr 9, 2026
251f303
Tests for docs
Apr 9, 2026
22a7091
Fixes for typing tests
Apr 9, 2026
2d4d682
Some lint's issues fixed
Apr 9, 2026
862e925
Refactor to_json/from_json to use TypedDict for schema validation
Apr 9, 2026
bbb7b97
Factor CLI args into shared _CliArgs class for Scenario and
Apr 9, 2026
188a221
Update args type hint to Sequence[object] for consistency and future
Apr 9, 2026
841cf3b
Add CLI edge case tests and scenario group divider logic
Apr 9, 2026
5802a89
Add assertions to verify scenario references in results
Apr 9, 2026
46a0d46
Add tests for BenchmarkResult serialization, Scenario construction/run
Apr 9, 2026
a61b1e1
Add test to ensure --help does not run benchmark
Apr 9, 2026
f5fcec9
Add tests for BenchmarkResult serialization, percentile handling, and
Apr 9, 2026
825fd3b
Add test for negative warmup handling in Scenario.run
Apr 9, 2026
6f265c1
Add tests for ScenarioGroup CLI divider and percentile edge cases
Apr 9, 2026
a95187a
Add tests for CLI help output, empty/invalid durations, and
Apr 9, 2026
c3791cd
Add tests for BenchmarkResult JSON handling and Scenario addition
Apr 9, 2026
6e25ff4
Fix percentile validation to reject non-positive values
Apr 9, 2026
6ab1b11
Add test for combined --number and --max-mean CLI options
Apr 9, 2026
7521147
Add pragma to suppress type check warning in TYPE_CHECKING block
Apr 9, 2026
690d840
Add validation for percentile with NaN/inf and null durations in JSON
Apr 9, 2026
d42dcc6
Add pragma to suppress TYPE_CHECKING import warning
Apr 9, 2026
1f3041c
Add test for Scenario.__radd__ and validate JSON deserialization
Apr 9, 2026
e53b447
Add CLI output validation and ScenarioGroup edge cases
Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: pomponchik

---

## Short description

Replace this text with a short description of the error and the behavior that you expected to see instead.


## Describe the bug in detail

Please add a test that reproduces the bug (i.e., currently fails):

```python
def test_your_bug():
...
```

When writing the test, please ensure compatibility with the [`pytest`](https://docs.pytest.org/) framework.

If for some reason you cannot describe the error in the test format, describe the steps to reproduce it here.


## Environment
- OS: ...
- Python version (the output of the `python --version` command): ...
- Version of this package: ...
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Documentation fix
about: Add something to the documentation, delete it, or change it
title: ''
labels: documentation
assignees: pomponchik
---

## It's cool that you're here!

Documentation is an important part of the project; we strive to make it high-quality and keep it up to date. Please adjust this template by outlining your proposal.


## Type of action

What do you want to do: remove something, add something, or change something?


## Where?

Specify which part of the documentation you want to change. For example, the name of an existing documentation section or a line number in `README.md`.


## The essence

Please describe the essence of the proposed change.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: pomponchik

---

## Short description

What do you propose and why do you consider it important?


## Some details

If you can, provide code examples that will show how your proposal will work. Also, if you can, indicate which alternative approaches you have considered. And finally, describe how you propose to verify that your idea is implemented correctly, if at all possible.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question or consultation
about: Ask anything about this project
title: ''
labels: question
assignees: pomponchik

---

## Your question

Here you can freely describe your question about the project. Please read the documentation provided before doing this, and ask the question only if it is not answered there. In addition, please keep in mind that this is a free non-commercial project and user support is optional for its author. Response times are not guaranteed.
65 changes: 65 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Lint

on:
push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15.0-alpha.1']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
shell: bash
run: uv pip install --system -r requirements_dev.txt

- name: Install the library
shell: bash
run: uv pip install --system .

- name: Run ruff
shell: bash
run: ruff check microbenchmark

- name: Run ruff for tests
shell: bash
run: ruff check tests

- name: Run mypy
shell: bash
run: >-
mypy
--show-error-codes
--strict
--disallow-any-decorated
--disallow-any-explicit
--disallow-any-expr
--disallow-any-generics
--disallow-any-unimported
--disallow-subclassing-any
--warn-return-any
microbenchmark

- name: Run mypy for tests
shell: bash
run: mypy --exclude '^tests/typing/' tests
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
branches:
- main

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 15
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
shell: bash
run: uv pip install --system -r requirements_dev.txt

- name: Build the project
shell: bash
run: python -m build .

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
64 changes: 64 additions & 0 deletions .github/workflows/tests_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tests

on:
push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15.0-alpha.1']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
shell: bash
run: uv pip install --system -r requirements_dev.txt

- name: Install the library
shell: bash
run: uv pip install --system .

- name: Print all libs
shell: bash
run: uv pip list --system

- name: Run tests and show the branch coverage on the command line
shell: bash
run: |
pth_file="$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')/microbenchmark_coverage_process_startup.pth"
printf "import os; os.getenv('COVERAGE_PROCESS_START') and __import__('coverage').process_startup()\n" > "$pth_file"
coverage erase
COVERAGE_PROCESS_START="$PWD/pyproject.toml" coverage run -m pytest -n auto --cache-clear --assert=plain
coverage combine
coverage report -m --fail-under=100 --omit='*tests*'
coverage xml --omit='*tests*'

- name: Upload coverage to Coveralls
if: runner.os == 'Linux' && matrix.python-version == '3.13'
env:
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
uses: coverallsapp/github-action@v2
with:
format: cobertura
file: coverage.xml
flag-name: ubuntu-python-3.13-branch
continue-on-error: true
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.DS_Store
__pycache__
venv
.pytest_cache
build
dist
*.egg-info
test.py
.coverage
.coverage.*
.idea
.ruff_cache
.mutmut-cache
.mypy_cache
html
CLAUDE.md
.claude
mutants
planning_features.md
coverage.xml
.qwen
uv.lock
Loading
Loading