diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac5988f4..6d915857 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ default_language_version: python: python3 repos: -- repo: https://github.com/psf/black - rev: 24.10.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -23,7 +23,7 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/pycqa/flake8 - rev: 7.1.1 + rev: 7.3.0 hooks: - id: flake8 name: flake8 except __init__.py @@ -34,7 +34,7 @@ repos: args: [--extend-ignore=F401] # ignore imported unused in __init__.py files: __init__.py - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.21.2 hooks: - id: pyupgrade - repo: https://github.com/asottile/seed-isort-config @@ -42,6 +42,6 @@ repos: hooks: - id: seed-isort-config - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort diff --git a/src/oca_github_bot/__main__.py b/src/oca_github_bot/__main__.py index 2d96a9fb..42031c9b 100644 --- a/src/oca_github_bot/__main__.py +++ b/src/oca_github_bot/__main__.py @@ -1,11 +1,12 @@ # Copyright (c) ACSONE SA/NV 2018 # Distributed under the MIT License (http://opensource.org/licenses/MIT). -""" OCA GitHub Bot +"""OCA GitHub Bot This is the main program, which provides the dispatching mechanisms for webhook calls from github. """ + import logging import aiohttp diff --git a/src/oca_github_bot/pypi.py b/src/oca_github_bot/pypi.py index 0a4355bd..5d50f91d 100644 --- a/src/oca_github_bot/pypi.py +++ b/src/oca_github_bot/pypi.py @@ -1,6 +1,7 @@ # Copyright (c) ACSONE SA/NV 2021 # Distributed under the MIT License (http://opensource.org/licenses/MIT). """Utilities to work with PEP 503 package indexes.""" + import logging import os from io import StringIO diff --git a/tests/test_build_wheels.py b/tests/test_build_wheels.py index 7647b145..c27bca9d 100644 --- a/tests/test_build_wheels.py +++ b/tests/test_build_wheels.py @@ -38,15 +38,11 @@ def _make_addon( ) (addon_dir / "__init__.py").write_text("") if pyproject: - (addon_dir / "pyproject.toml").write_text( - textwrap.dedent( - """\ + (addon_dir / "pyproject.toml").write_text(textwrap.dedent("""\ [build-system] requires = ["whool"] build-backend = "whool.buildapi" - """ - ) - ) + """)) subprocess.check_call(["git", "add", addon_name], cwd=addons_dir) subprocess.check_call( ["git", "commit", "-m", "[BOT] add " + addon_name], cwd=addons_dir diff --git a/tests/test_commands.py b/tests/test_commands.py index 7a9e90bf..10bd277b 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -18,9 +18,7 @@ def test_parse_command_not_a_command(): def test_parse_command_multi(): - cmds = list( - parse_commands( - """ + cmds = list(parse_commands(""" ... /ocabot merge major /ocabot merge patch @@ -33,9 +31,7 @@ def test_parse_command_multi(): /ocabot merge minor # ignored /ocabot rebase, please ... - """ - ) - ) + """)) assert [(cmd.name, cmd.options) for cmd in cmds] == [ ("merge", ["major"]), ("merge", ["patch"]), @@ -100,9 +96,7 @@ def test_parse_command_comment(): > Some comment {merge_command} >> Double comment! {merge_command} This is the one {merge_command} patch - """.format( - merge_command="/ocabot merge" - ) + """.format(merge_command="/ocabot merge") command = list(parse_commands(body)) assert len(command) == 1 command = command[0]