aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/google_benchmark/example.py
Commit message (Collapse)AuthorAge
* Fix Python manual timing example (#1722)Alex Bilger2024-08-16
| | | | | | | According to the user guide, when manual timing, it is necessary to explicit it by using the `UseManualTime` function. Its equivalent in Python is use_manual_time(). This function was not called in the example. It is possible to verify that the use of this function has an impact on the measure by adding another `time.sleep(0.01)` at the end of the iteration. There is a x2 difference depending on whether `use_manual_time()` is used or not. Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* Add pre-commit config and GitHub Actions job (#1688)Nicholas Junge2023-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add pre-commit config and GitHub Actions job Contains the following hooks: * buildifier - for formatting and linting Bazel files. * mypy, ruff, isort, black - for Python typechecking, import hygiene, static analysis, and formatting. The pylint CI job was changed to be a pre-commit CI job, where pre-commit is bootstrapped via Python. Pylint is currently no longer part of the code checks, but can be re-added if requested. The reason to drop was that it does not play nicely with pre-commit, and lots of its functionality and responsibilities are actually covered in ruff. * Add dev extra to pyproject.toml for development installs * Clarify that pre-commit contains only Python and Bazel hooks * Add one-line docstrings to Bazel modules * Apply buildifier pre-commit fixes to Bazel files * Apply pre-commit fixes to Python files * Supply --profile=black to isort to prevent conflicts * Fix nanobind build file formatting * Add tooling configs to `pyproject.toml` In particular, set line length 80 for all Python files. * Reformat all Python files to line length 80, fix return type annotations Also ignores the `tools/compare.py` and `tools/gbench/report.py` files for mypy, since they emit a barrage of errors which we can deal with later. The errors are mostly related to dynamic classmethod definition.
* Fix typos found by codespell (#1519)SunBlack2023-01-10
|
* Deduplicate test function name in python bindings example (#1189)Mircea Trofin2021-06-28
| | | | This appears to be the source of unclean termination of the test on some versions of python related to object dereferencing.
* Bind benchmark builder to Python (#1040)v1.5.2Antoine Prouvost2020-09-11
| | | | | | | | | | | | | | | * Fix setup.py and reformat * Bind benchmark * Add benchmark option to Python * Add Python examples for range, complexity, and thread * Remove invalid multithreading in Python * Bump Python bindings version to 0.2.0 Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
* Bind more State methods/attributes to Python (#1037)Antoine Prouvost2020-09-10
| | | | | | | | | | | | | * Bind Counter to Python * Bind State methods to Python * Bind state.counters to Python * Import _benchmark.Counter * Add Python example of state usage Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
* Create pylint.yml (#1039)Dominic Hamon2020-09-09
| | | | | | | | | | | | | | | | | * Create pylint.yml * improve file matching * fix some pylint issues * run on PR and push (force on master only) * more pylint fixes * suppress noisy exit code and filter to fatals * add conan as a dep so the module is importable * fix lint error on unreachable branch
* Rename python bindings package to `google_benchmark`. (#999)Chris Jones2020-07-09
A few people have complained that `benchmark` is too generic. Also, add Python 3.8.