From 6f50cd89e71262bef6c9b31c5902438c778b398d Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:12:47 +0200 Subject: [PATCH 01/19] basic pre-commit-config --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..fccbebd4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.12.11 + hooks: + - id: ruff-check + name: Run Ruff (lint) + args: [--exit-non-zero-on-fix] From 55684a92ff7bafdfbea114dc385abae2a5e26051 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:19:30 +0200 Subject: [PATCH 02/19] ruff github action, pyproject --- .github/workflows/ruff.yml | 16 ++++++++++++++++ pyproject.toml | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 00000000..87e08c71 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,16 @@ +name: ruff + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: read + +jobs: + ruff: + name: Check code with ruff + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v3 + with: + args: "check" diff --git a/pyproject.toml b/pyproject.toml index da88a7b9..3ae79967 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,3 +104,18 @@ exclude = [ [[tool.mypy.overrides]] module = "pyperf" ignore_missing_imports = true + +[tool.ruff.lint] +ignore = [ + "E402", # module level import not at top of file + "E501", # line too long + "E701", # multiple statements on one line (colon) + "E722", # do not use bare 'except' + "E741", # ambiguous variable name + "F405" # name may be undefined, or defined from star imports +] + +select = [ + "E", + "F", +] From 78ec1ed610781b2142552def6710f6dfeb6f518c Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:26:16 +0200 Subject: [PATCH 03/19] target version --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3ae79967..a096deb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,9 @@ exclude = [ module = "pyperf" ignore_missing_imports = true +[tool.ruff] +target-version = "py310" + [tool.ruff.lint] ignore = [ "E402", # module level import not at top of file From c09315d27733b022e40262f6eb56716357c687f9 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:34:45 +0200 Subject: [PATCH 04/19] v5 --- .github/workflows/ruff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 87e08c71..e7f6cc5f 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -10,7 +10,7 @@ jobs: name: Check code with ruff runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: astral-sh/ruff-action@v3 with: args: "check" From 4773b5d49f6179e131c2c0afc5ed1369c3697ee4 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:48:49 +0200 Subject: [PATCH 05/19] ruff.toml, exclude benchmarks --- .pre-commit-config.yaml | 1 + .ruff.toml | 18 ++++++++++++++++++ pyproject.toml | 18 ------------------ 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .ruff.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fccbebd4..377d19f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,3 +5,4 @@ repos: - id: ruff-check name: Run Ruff (lint) args: [--exit-non-zero-on-fix] + exclude: ^pyperformance/data-files/ diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 00000000..139408ab --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,18 @@ +target-version = "py310" + +exclude = ["pyperformance/data-files/"] + +[lint] +select = [ + "E", + "F", +] + +ignore = [ + "E402", # module level import not at top of file + "E501", # line too long + "E701", # multiple statements on one line (colon) + "E722", # do not use bare 'except' + "E741", # ambiguous variable name + "F405" # name may be undefined, or defined from star imports +] diff --git a/pyproject.toml b/pyproject.toml index a096deb9..da88a7b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,21 +104,3 @@ exclude = [ [[tool.mypy.overrides]] module = "pyperf" ignore_missing_imports = true - -[tool.ruff] -target-version = "py310" - -[tool.ruff.lint] -ignore = [ - "E402", # module level import not at top of file - "E501", # line too long - "E701", # multiple statements on one line (colon) - "E722", # do not use bare 'except' - "E741", # ambiguous variable name - "F405" # name may be undefined, or defined from star imports -] - -select = [ - "E", - "F", -] From 780f4e0ce012baab3572c6c0930233f9c1ace6cc Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:55:22 +0200 Subject: [PATCH 06/19] pass uvx ruff check --- pyperformance/_benchmark.py | 2 +- pyperformance/_benchmark_metadata.py | 2 +- pyperformance/_manifest.py | 4 +--- pyperformance/_pyproject_toml.py | 6 +++--- pyperformance/_utils.py | 1 - pyperformance/run.py | 1 + pyperformance/tests/test_commands.py | 6 +++--- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pyperformance/_benchmark.py b/pyperformance/_benchmark.py index bade89ea..7aa9619f 100644 --- a/pyperformance/_benchmark.py +++ b/pyperformance/_benchmark.py @@ -218,7 +218,7 @@ def _run_perf_script(python, runscript, runid, *, '--output', tmp, ] if pyperf_opts and '--copy-env' in pyperf_opts: - argv, env = _prep_cmd(python, runscript, opts, runid, NOOP) + argv, env = _prep_cmd(python, runscript, opts, runid, lambda name: None) else: opts, inherit_envvar = _resolve_restricted_opts(opts) argv, env = _prep_cmd(python, runscript, opts, runid, inherit_envvar) diff --git a/pyperformance/_benchmark_metadata.py b/pyperformance/_benchmark_metadata.py index cae97dc1..42fe6cd7 100644 --- a/pyperformance/_benchmark_metadata.py +++ b/pyperformance/_benchmark_metadata.py @@ -194,7 +194,7 @@ def _resolve(project, tool, filename): if target is None: target = field if field == 'url': - repo = project.get('urls', {}).get('repository') + _repo = project.get('urls', {}).get('repository') raise NotImplementedError elif not resolved.get(target): value = project.get(field) diff --git a/pyperformance/_manifest.py b/pyperformance/_manifest.py index cd9479ef..582ed4e8 100644 --- a/pyperformance/_manifest.py +++ b/pyperformance/_manifest.py @@ -343,13 +343,12 @@ def _parse_metafile(metafile, name): def _parse_groups_section(lines): - for name in seclines: + for name in lines: _utils.check_name(name) yield name def _parse_group_section(lines): - yielded = False for line in lines: if line.startswith('-'): # Exclude a benchmark or group. @@ -363,7 +362,6 @@ def _parse_group_section(lines): name = line _benchmark.check_name(name) yield op, name - yielded = True def _get_tags(benchmarks): diff --git a/pyperformance/_pyproject_toml.py b/pyperformance/_pyproject_toml.py index 637c5888..fe72f8b6 100644 --- a/pyperformance/_pyproject_toml.py +++ b/pyperformance/_pyproject_toml.py @@ -100,7 +100,7 @@ def load_pyproject_toml(filename, *, name=None, tools=None, requirefiles=True): def _check_relfile(relname, rootdir, kind): if os.path.isabs(relname): - raise ValuError(f'{relname!r} is absolute, expected relative') + raise ValueError(f'{relname!r} is absolute, expected relative') actual = os.path.join(rootdir, relname) if kind == 'dir': if not os.path.isdir(actual): @@ -122,11 +122,11 @@ def _check_file_or_text(table, rootdir, requirefiles, extra=None): if 'file' in table: if 'text' in table: - raise ValueError(f'"file" and "text" are mutually exclusive') + raise ValueError('"file" and "text" are mutually exclusive') kind = 'file' if requirefiles else None _check_relfile(table['file'], rootdir, kind) else: - text = table['text'] + _text = table['text'] # XXX Validate it? diff --git a/pyperformance/_utils.py b/pyperformance/_utils.py index 908adc26..1e3349e6 100644 --- a/pyperformance/_utils.py +++ b/pyperformance/_utils.py @@ -6,7 +6,6 @@ 'check_dir', # platform 'MS_WINDOWS', - 'run_command', # misc 'check_name', 'parse_name_pattern', diff --git a/pyperformance/run.py b/pyperformance/run.py index b535f96a..98d80b16 100644 --- a/pyperformance/run.py +++ b/pyperformance/run.py @@ -1,6 +1,7 @@ from collections import namedtuple import hashlib import json +import os import sys import time import traceback diff --git a/pyperformance/tests/test_commands.py b/pyperformance/tests/test_commands.py index 42574f26..bd5a0f51 100644 --- a/pyperformance/tests/test_commands.py +++ b/pyperformance/tests/test_commands.py @@ -102,13 +102,13 @@ def div(): print() def expect_success(*args): - text = self.run_pyperformance( + _text = self.run_pyperformance( *args, capture=None, ) def expect_failure(*args): - text = self.run_pyperformance( + _text = self.run_pyperformance( *args, capture=None, exitcode=1, @@ -148,7 +148,7 @@ def test_run_and_show(self): # --debug-single-value: benchmark results don't matter, we only # check that running benchmarks don't fail. # XXX Capture and check the output. - text = self.run_pyperformance( + _text = self.run_pyperformance( 'run', '-b', 'all', '--debug-single-value', From 70732e45a7146c70163280516ae2081bcb677d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:57:03 +0200 Subject: [PATCH 07/19] Update .ruff.toml Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- .ruff.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ruff.toml b/.ruff.toml index 139408ab..b3e2dd9d 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,6 +1,8 @@ target-version = "py310" -exclude = ["pyperformance/data-files/"] +exclude = [ + "pyperformance/data-files/", +] [lint] select = [ From 88427d4dcc6d700f1b7214e554b2bb02b4a6a1c8 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 01:04:12 +0200 Subject: [PATCH 08/19] delete dead code --- pyperformance/_benchmark_metadata.py | 1 - pyperformance/_pyproject_toml.py | 3 --- pyperformance/tests/test_commands.py | 6 +++--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pyperformance/_benchmark_metadata.py b/pyperformance/_benchmark_metadata.py index 42fe6cd7..4a6b8944 100644 --- a/pyperformance/_benchmark_metadata.py +++ b/pyperformance/_benchmark_metadata.py @@ -194,7 +194,6 @@ def _resolve(project, tool, filename): if target is None: target = field if field == 'url': - _repo = project.get('urls', {}).get('repository') raise NotImplementedError elif not resolved.get(target): value = project.get(field) diff --git a/pyperformance/_pyproject_toml.py b/pyperformance/_pyproject_toml.py index fe72f8b6..06fc4096 100644 --- a/pyperformance/_pyproject_toml.py +++ b/pyperformance/_pyproject_toml.py @@ -125,9 +125,6 @@ def _check_file_or_text(table, rootdir, requirefiles, extra=None): raise ValueError('"file" and "text" are mutually exclusive') kind = 'file' if requirefiles else None _check_relfile(table['file'], rootdir, kind) - else: - _text = table['text'] - # XXX Validate it? def _normalize_project(data, rootdir, name, requirefiles, **_ignored): diff --git a/pyperformance/tests/test_commands.py b/pyperformance/tests/test_commands.py index bd5a0f51..4eb0978c 100644 --- a/pyperformance/tests/test_commands.py +++ b/pyperformance/tests/test_commands.py @@ -102,13 +102,13 @@ def div(): print() def expect_success(*args): - _text = self.run_pyperformance( + self.run_pyperformance( *args, capture=None, ) def expect_failure(*args): - _text = self.run_pyperformance( + self.run_pyperformance( *args, capture=None, exitcode=1, @@ -148,7 +148,7 @@ def test_run_and_show(self): # --debug-single-value: benchmark results don't matter, we only # check that running benchmarks don't fail. # XXX Capture and check the output. - _text = self.run_pyperformance( + self.run_pyperformance( 'run', '-b', 'all', '--debug-single-value', From e92204b1dfa94b2d5aa55adc165dfe14cd049473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:25:36 +0200 Subject: [PATCH 09/19] Update .github/workflows/ruff.yml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/ruff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index e7f6cc5f..ebd80cfb 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,4 +1,4 @@ -name: ruff +name: Lint on: [push, pull_request, workflow_dispatch] From 77ef64d09742bd9d776e50b924b58e2dc283783a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:25:42 +0200 Subject: [PATCH 10/19] Update .github/workflows/ruff.yml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/ruff.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index ebd80cfb..79659c61 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -2,8 +2,7 @@ name: Lint on: [push, pull_request, workflow_dispatch] -permissions: - contents: read +permissions: {} jobs: ruff: From 478e9c3b723da3d19816f886dbb06a0950d116ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:25:49 +0200 Subject: [PATCH 11/19] Update .github/workflows/ruff.yml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/ruff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 79659c61..de968bed 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] permissions: {} jobs: - ruff: + lint: name: Check code with ruff runs-on: ubuntu-latest steps: From 6d3c3b1422458e63d387e7d7da8bd2d33e49f369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:25:56 +0200 Subject: [PATCH 12/19] Update .github/workflows/ruff.yml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/ruff.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index de968bed..69fc5b1e 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -10,6 +10,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: astral-sh/ruff-action@v3 - with: - args: "check" + - uses: tox-dev/action-pre-commit-uv@v1 From 8629e1367ac6ace3c7e9830f7478dfe068ba7ae2 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:26:18 +0200 Subject: [PATCH 13/19] mv ruff.yml lint.yml --- .github/workflows/{ruff.yml => lint.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ruff.yml => lint.yml} (100%) diff --git a/.github/workflows/ruff.yml b/.github/workflows/lint.yml similarity index 100% rename from .github/workflows/ruff.yml rename to .github/workflows/lint.yml From ee393e2e315053bb6f5e32000993e95ad1f764f5 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:29:59 +0200 Subject: [PATCH 14/19] ruff.toml -> pyproject --- .ruff.toml | 20 -------------------- pyproject.toml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 .ruff.toml diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index b3e2dd9d..00000000 --- a/.ruff.toml +++ /dev/null @@ -1,20 +0,0 @@ -target-version = "py310" - -exclude = [ - "pyperformance/data-files/", -] - -[lint] -select = [ - "E", - "F", -] - -ignore = [ - "E402", # module level import not at top of file - "E501", # line too long - "E701", # multiple statements on one line (colon) - "E722", # do not use bare 'except' - "E741", # ambiguous variable name - "F405" # name may be undefined, or defined from star imports -] diff --git a/pyproject.toml b/pyproject.toml index da88a7b9..6604131e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,3 +104,25 @@ exclude = [ [[tool.mypy.overrides]] module = "pyperf" ignore_missing_imports = true + +[tool.ruff] +target-version = "py310" + +exclude = [ + "pyperformance/data-files/", +] + +[tool.ruff.lint] +select = [ + "E", + "F", +] + +ignore = [ + "E402", # module level import not at top of file + "E501", # line too long + "E701", # multiple statements on one line (colon) + "E722", # do not use bare 'except' + "E741", # ambiguous variable name + "F405", # name may be undefined, or defined from star imports +] From 7e433d43a2d4afee92eaf485104153a2907adaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:02:55 +0200 Subject: [PATCH 15/19] Update pyproject.toml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6604131e..db67f008 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,8 +114,8 @@ exclude = [ [tool.ruff.lint] select = [ - "E", - "F", + "E", # pycodestyle errors + "F", # pyflakes errors ] ignore = [ From 46191aeada55705d63bb949d1c9b0c502488602e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:03:27 +0200 Subject: [PATCH 16/19] Update pyproject.toml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index db67f008..bae22696 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,3 +126,6 @@ ignore = [ "E741", # ambiguous variable name "F405", # name may be undefined, or defined from star imports ] + +[tool.pyproject-fmt] +max_supported_python = "3.14" From 8a962568cf10ee23fa9170bb25c705675f76d778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:03:39 +0200 Subject: [PATCH 17/19] Update .pre-commit-config.yaml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .pre-commit-config.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 377d19f4..d468878b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,3 +6,16 @@ repos: name: Run Ruff (lint) args: [--exit-non-zero-on-fix] exclude: ^pyperformance/data-files/ + + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.6.0 + hooks: + - id: pyproject-fmt + exclude: ^pyperformance/data-files/ + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.24.1 + hooks: + - id: validate-pyproject + exclude: ^pyperformance/data-files/ + From 776037e46ffc03d20a8c67b035b6c7dd98db9710 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:33:24 +0200 Subject: [PATCH 18/19] uvx pre-commit run --all-files --- .../tests/data/bm_local_wheel/pyproject.toml | 19 ++- pyproject.toml | 110 +++++++++--------- 2 files changed, 71 insertions(+), 58 deletions(-) diff --git a/pyperformance/tests/data/bm_local_wheel/pyproject.toml b/pyperformance/tests/data/bm_local_wheel/pyproject.toml index 2710ced7..453345d4 100644 --- a/pyperformance/tests/data/bm_local_wheel/pyproject.toml +++ b/pyperformance/tests/data/bm_local_wheel/pyproject.toml @@ -1,9 +1,20 @@ [project] -name = "pyperformance_bm_local_wheel" -requires-python = ">=3.7" -dependencies = ["pyperf"] -urls = {repository = "https://github.com/python/pyperformance"} +name = "pyperformance-bm-local-wheel" version = "1.0" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +dependencies = [ "pyperf" ] +urls = { repository = "https://github.com/python/pyperformance" } + [tool.pyperformance] name = "local_wheel" diff --git a/pyproject.toml b/pyproject.toml index bae22696..7061b1bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,51 +38,78 @@ # - git push [build-system] -requires = ["setuptools >= 61"] build-backend = "setuptools.build_meta" +requires = [ "setuptools>=61" ] + [project] name = "pyperformance" -dynamic = ["version"] -license = {text = "MIT"} description = "Python benchmark suite" readme = "README.rst" -urls = {Homepage = "https://github.com/python/pyperformance"} -authors= [{name = "Collin Winter"}, {name= "Jeffrey Yasskin"}] +license = { text = "MIT" } +authors = [ { name = "Collin Winter" }, { name = "Jeffrey Yasskin" } ] +requires-python = ">=3.9" classifiers = [ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python', + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +dynamic = [ "version" ] dependencies = [ - "pyperf", - "tomli; python_version < '3.11'", - "packaging", + "packaging", + "pyperf", + "tomli; python_version<'3.11'", ] -[project.optional-dependencies] -dev = [ - 'tox', - 'mypy==1.2.0', - 'tomli', # Needed even on 3.11+ for typechecking with mypy +optional-dependencies.dev = [ + "mypy==1.2", + "tomli", # Needed even on 3.11+ for typechecking with mypy + "tox", ] - -[project.scripts] -pyperformance = "pyperformance.cli:main" +urls = { Homepage = "https://github.com/python/pyperformance" } +scripts.pyperformance = "pyperformance.cli:main" [tool.setuptools] include-package-data = true [tool.setuptools.packages] -find = {} # Scanning implicit namespaces is active by default +find = {} # Scanning implicit namespaces is active by default [tool.setuptools.dynamic] -version = {attr = "pyperformance.__version__"} +version = { attr = "pyperformance.__version__" } + +[tool.ruff] +target-version = "py310" + +exclude = [ + "pyperformance/data-files/", +] + +lint.select = [ + "E", # pycodestyle errors + "F", # pyflakes errors +] +lint.ignore = [ + "E402", # module level import not at top of file + "E501", # line too long + "E701", # multiple statements on one line (colon) + "E722", # do not use bare 'except' + "E741", # ambiguous variable name + "F405", # name may be undefined, or defined from star imports +] + +[tool.pyproject-fmt] +max_supported_python = "3.14" [tool.mypy] python_version = "3.9" @@ -94,38 +121,13 @@ warn_redundant_casts = true warn_unused_ignores = true warn_unused_configs = true files = [ - 'pyperformance/', + 'pyperformance/', ] exclude = [ - 'pyperformance/data-files/', - 'pyperformance/tests/' + 'pyperformance/data-files/', + 'pyperformance/tests/', ] [[tool.mypy.overrides]] module = "pyperf" ignore_missing_imports = true - -[tool.ruff] -target-version = "py310" - -exclude = [ - "pyperformance/data-files/", -] - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "F", # pyflakes errors -] - -ignore = [ - "E402", # module level import not at top of file - "E501", # line too long - "E701", # multiple statements on one line (colon) - "E722", # do not use bare 'except' - "E741", # ambiguous variable name - "F405", # name may be undefined, or defined from star imports -] - -[tool.pyproject-fmt] -max_supported_python = "3.14" From b3958f45d19a04c80b6df13800c57aa1a58a5e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurycy=20Paw=C5=82owski-Wiero=C5=84ski?= <5383+maurycy@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:53:49 +0200 Subject: [PATCH 19/19] Update pyproject.toml Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 7061b1bf..888f6f15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,6 +95,8 @@ exclude = [ "pyperformance/data-files/", ] +fix = true + lint.select = [ "E", # pycodestyle errors "F", # pyflakes errors