diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d468878b..62ef7c98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +exclude: ^pyperformance/data-files/ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.12.11 @@ -5,17 +6,13 @@ repos: - id: ruff-check 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/ - diff --git a/pyperformance/_manifest.py b/pyperformance/_manifest.py index 582ed4e8..ca9583c8 100644 --- a/pyperformance/_manifest.py +++ b/pyperformance/_manifest.py @@ -313,8 +313,8 @@ def _parse_benchmarks_section(lines): version = origin = None for line in lines: try: - name, metafile = (None if l == '-' else l - for l in line.split('\t')) + name, metafile = (None if field == '-' else field + for field in line.split('\t')) except ValueError: raise ValueError(f'bad benchmark line {line!r}') spec = _benchmark.BenchmarkSpec(name or None, version, origin) diff --git a/pyperformance/_utils.py b/pyperformance/_utils.py index 1e3349e6..7e80fa09 100644 --- a/pyperformance/_utils.py +++ b/pyperformance/_utils.py @@ -24,6 +24,8 @@ import os.path import shlex import shutil +import subprocess +import sys import tempfile import urllib.request @@ -81,9 +83,6 @@ def safe_rmtree(path): ####################################### # platform utils -import subprocess -import sys - MS_WINDOWS = (sys.platform == 'win32') diff --git a/pyperformance/_venv.py b/pyperformance/_venv.py index 34f6f82c..eab426d4 100644 --- a/pyperformance/_venv.py +++ b/pyperformance/_venv.py @@ -43,7 +43,7 @@ def parse_venv_config(lines, root=None): if isinstance(lines, str): lines = lines.splitlines() else: - lines = (l.rstrip(os.linesep) for l in lines) + lines = (line.rstrip(os.linesep) for line in lines) cfg = types.SimpleNamespace( home=None, diff --git a/pyperformance/tests/test_venv.py b/pyperformance/tests/test_venv.py index b16ac2ce..64d39623 100644 --- a/pyperformance/tests/test_venv.py +++ b/pyperformance/tests/test_venv.py @@ -47,7 +47,7 @@ def render_venv_config(cfg): lines.append(f'executable = {cfg.executable}') if cfg.command is not None: lines.append(f'command = {cfg.command}') - return ''.join(l + os.linesep for l in lines) + return ''.join(line + os.linesep for line in lines) class VenvConfigTests(tests.Functional, unittest.TestCase): diff --git a/pyproject.toml b/pyproject.toml index 888f6f15..a64337fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,12 +102,7 @@ lint.select = [ "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]