Skip to content
Open
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint

on: [push, pull_request, workflow_dispatch]

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: j178/prek-action@v1
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff-check
name: Run Ruff (lint)
args: [--exit-non-zero-on-fix]
- id: ruff-format
name: Run Ruff (format)
args: [--exit-non-zero-on-fix]
18 changes: 11 additions & 7 deletions pyperf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
from time import perf_counter

VERSION = (2, 10, 0)
__version__ = '.'.join(map(str, VERSION))
__version__ = ".".join(map(str, VERSION))

# Export pyperf.perf_counter for backward compatibility with pyperf 1.7
# which supports Python 2 and Python 3
__all__ = ['perf_counter']
__all__ = ["perf_counter"]

from pyperf._utils import python_implementation, python_has_jit # noqa
__all__.extend(('python_implementation', 'python_has_jit'))

__all__.extend(("python_implementation", "python_has_jit"))

from pyperf._metadata import format_metadata # noqa
__all__.append('format_metadata')

__all__.append("format_metadata")

from pyperf._bench import Run, Benchmark, BenchmarkSuite, add_runs # noqa
__all__.extend(('Run', 'Benchmark', 'BenchmarkSuite', 'add_runs'))

from pyperf._runner import Runner # noqa
__all__.append('Runner')
__all__.extend(("Run", "Benchmark", "BenchmarkSuite", "add_runs"))

from pyperf._runner import Runner # noqa

__all__.append("Runner")
Loading