From 77df6d5bc20a838175f61ef82f3d72a4ec2630c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 04:04:18 +0000 Subject: [PATCH 1/2] Bump tornado from 6.5.10 to 6.6 Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.5.10 to 6.6. - [Changelog](https://github.com/tornadoweb/tornado/blob/master/docs/releases.rst) - [Commits](https://github.com/tornadoweb/tornado/compare/v6.5.10...v6.6.0) --- updated-dependencies: - dependency-name: tornado dependency-version: '6.6' dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 56c020e..d476502 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ pyjwt==2.15.0 pyyaml==6.0.3 requests==2.33.0 there==0.0.9 -tornado==6.5.10 +tornado==6.6 yieldbreaker==0.0.1 From 428362dc32f8a990499bf1478de5ed77265e4a66 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 4 Nov 2026 14:54:51 -0500 Subject: [PATCH 2/2] Fix CI for tornado 6.6: test on Python 3.14 and update pre-commit hooks - Tornado 6.6 requires Python >=3.11, so test on 3.14 (matching .python-version) instead of 3.10. - The 2022-era pre-commit hook pins (black, pyupgrade, flake8 plugins, mypy) crash on Python 3.14, which the pre-commit job now runs on. Bump them all (isort pinned to latest stable rather than a beta) and apply the resulting reformatting. - Address new mypy/flake8 findings: drop duplicate Config attributes (keeping the effective None defaults), remove no-op nonlocal statements, narrow an Optional before indexing, and add httpx to the mypy environment. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 2 +- .github/workflows/connect.py | 2 +- .pre-commit-config.yaml | 24 +++++------ README.md | 12 +++--- meeseeksdev/__init__.py | 1 + meeseeksdev/commands.py | 8 +--- meeseeksdev/meeseeksbox/commands.py | 67 +++++++++-------------------- meeseeksdev/meeseeksbox/core.py | 20 +++++---- meeseeksdev/meeseeksbox/utils.py | 1 + meeseeksdev/tests/test_misc.py | 6 +-- meeseeksdev/tests/test_webhook.py | 1 + 11 files changed, 59 insertions(+), 85 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 870b940..0e37223 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10"] + python-version: ["3.14"] steps: - name: Checkout uses: actions/checkout@v7 diff --git a/.github/workflows/connect.py b/.github/workflows/connect.py index 392efe6..43dfcad 100644 --- a/.github/workflows/connect.py +++ b/.github/workflows/connect.py @@ -13,7 +13,7 @@ found = True break except URLError as e: - if e.reason.errno == errno.ECONNREFUSED: # type:ignore + if e.reason.errno == errno.ECONNREFUSED: # type: ignore time.sleep(1) continue raise diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4bfe88f..3df512b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: check-case-conflict @@ -19,44 +19,44 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 26.10.1 hooks: - id: black args: ["--line-length", "100"] - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 9.0.2 hooks: - id: isort files: \.py$ args: [--profile=black] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v2.4.1 hooks: - id: mypy args: ["--config-file", ".mypy.ini"] - additional_dependencies: [types-requests, types-PyYAML, types-mock, tornado, black, pytest, gitpython, pyjwt] + additional_dependencies: [types-requests, types-PyYAML, types-mock, tornado, black, pytest, gitpython, pyjwt, httpx] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.10.1 + rev: v0.27 hooks: - id: validate-pyproject stages: [manual] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 1.0.0 hooks: - id: mdformat - repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 + rev: v3.22.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/PyCQA/doc8 - rev: v1.0.0 + rev: v2.0.0 hooks: - id: doc8 args: [--max-line-length=200] @@ -64,14 +64,14 @@ repos: stages: [manual] - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.5.0 hooks: - id: flake8 additional_dependencies: - ["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"] + ["flake8-bugbear==26.10.27", "flake8-implicit-str-concat==0.7.0"] stages: [manual] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.19.2 + rev: 0.39.0 hooks: - id: check-github-workflows diff --git a/README.md b/README.md index 3c31cb7..1f29a19 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ users: ``` This will allow `` to ask `@meeseeksdev` to perform above commands. -The conf file is the one that sits on the repository default branch (usually +The conf file is the one that sits on the repository default branch (usually `master`). ## What can a MeeseeksBox do ? @@ -74,9 +74,9 @@ Respond with To test whether a Meeseeks understand you. -### @MeeseeksDev backport \[to\] {branch} +### @MeeseeksDev backport [to] {branch} -If issued from a PR which is merged, attempt to backport (cherry-pick the +If issued from a PR which is merged, attempt to backport (cherry-pick the merge commit) on an older branch and submit a PR with this backport (on said branch) Apply origin-pr labels and milestone to backport. @@ -106,7 +106,7 @@ If it's not it will ask you to do so. ### @MeeseeksDev pre-commit If issued from a PR, will apply pre-commit to this PR and push -a commit with the changes made. If no changes are made, or the changes +a commit with the changes made. If no changes are made, or the changes cannot be automatically fixed, it will show a comment in the PR and bail. You can also use "precommit" as an alias. @@ -131,7 +131,7 @@ Repo admins only, plan to make it available to PR author as well. MeeseeksDev Bot need to be installed on the PR source repository for this to work. If it's not it will ask you to do so. -### @MeeseeksDev migrate \[to\] {target org/repo} +### @MeeseeksDev migrate [to] {target org/repo} Needs MeeseeksBox to be installed on both current and target repo. Command issuer to be admin on both. @@ -155,7 +155,7 @@ Tag with said tags if availlable (comma separated, need to be exact match) Remove said tags if present (comma separated, need to be exact match) -### @MeeseeksDev merge \[merge|squash|rebase\] +### @MeeseeksDev merge [merge|squash|rebase] Issuer needs at least write permission. diff --git a/meeseeksdev/__init__.py b/meeseeksdev/__init__.py index 4079396..06012bc 100644 --- a/meeseeksdev/__init__.py +++ b/meeseeksdev/__init__.py @@ -1,6 +1,7 @@ """ Meeseeksbox main app module """ + import base64 import os import signal diff --git a/meeseeksdev/commands.py b/meeseeksdev/commands.py index 5872411..1f2b7cd 100644 --- a/meeseeksdev/commands.py +++ b/meeseeksdev/commands.py @@ -28,12 +28,8 @@ def help(*, session, payload, arguments): comment_url = payload["issue"]["comments_url"] session.post_comment( comment_url, - dedent( - """The following commands are available:\n\n{} - """.format( - data - ) - ), + dedent("""The following commands are available:\n\n{} + """.format(data)), ) return help diff --git a/meeseeksdev/meeseeksbox/commands.py b/meeseeksdev/meeseeksbox/commands.py index c413376..7765d80 100644 --- a/meeseeksdev/meeseeksbox/commands.py +++ b/meeseeksdev/meeseeksbox/commands.py @@ -3,9 +3,9 @@ """ import os -import shlex import random import re +import shlex import sys import time import traceback @@ -69,8 +69,7 @@ def zen(*, session, payload, arguments, local_config=None): comment_url = payload.get("issue", payload.get("pull_request"))["comments_url"] session.post_comment( comment_url, - dedent( - """ + dedent(""" Zen of Python ([pep 20](https://www.python.org/dev/peps/pep-0020/)) ``` >>> import this @@ -94,8 +93,7 @@ def zen(*, session, payload, arguments, local_config=None): If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! ``` - """ - ), + """), ) @@ -166,9 +164,7 @@ def _pr_head_repo(pr_data: dict) -> Optional[dict]: return (pr_data.get("head") or {}).get("repo") -def _bail_on_deleted_fork( - session: Session, comment_url: str, pr_data: dict, name: str -) -> bool: +def _bail_on_deleted_fork(session: Session, comment_url: str, pr_data: dict, name: str) -> bool: """Post an explanation and return True if the PR's fork is gone.""" if _pr_head_repo(pr_data) is not None: return False @@ -495,12 +491,10 @@ def precommit( # Alert the caller and bail. session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I was unable to fix pre-commit errors because there is no ".pre-commit-config.yaml" file. - """ - ), + """), ) return @@ -519,11 +513,9 @@ def precommit( # Alert the caller and bail. session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I was unable to run "pre-commit" because there was nothing to do. - """ - ), + """), ) return @@ -541,22 +533,18 @@ def precommit( # Alert the caller and bail. session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I was unable to fix pre-commit errors automatically. Try running `pre-commit run --all-files` locally. - """ - ), + """), ) return session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I was unable to fix all of the pre-commit errors automatically. Try running `pre-commit run --all-files` locally. - """ - ), + """), ) succeeded = push_the_work(session, payload, arguments, local_config=local_config) @@ -566,12 +554,10 @@ def precommit( if succeeded: session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I've applied "pre-commit" and pushed. You may have trouble pushing further commits, but feel free to force push and ask me to run again. - """ - ), + """), ) else: session.post_comment(comment_url, body="I was unable to push due to errors") @@ -623,11 +609,9 @@ def blackify(*, session, payload, arguments, local_config=None): if process.returncode != 0: session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I was unable to run "blackify" due to an error. - """ - ), + """), ) return @@ -637,13 +621,11 @@ def blackify(*, session, payload, arguments, local_config=None): if succeeded: session.post_comment( comment_url, - body=dedent( - """ + body=dedent(""" I've rebased this Pull Request, applied `black` on all the individual commits, and pushed. You may have trouble pushing further commits, but feel free to force push and ask me to reformat again. - """ - ), + """), ) else: session.post_comment(comment_url, body="I was unable to push due to errors") @@ -665,13 +647,6 @@ def safe_backport(session, payload, arguments, local_config=None): s_slug = "" def keen_stats(): - nonlocal s_slug - nonlocal s_clone_time - nonlocal s_success - nonlocal s_reason - nonlocal s_fork_time - nonlocal s_clean_time - nonlocal s_ff_time add_event( "backport_stats", { @@ -913,7 +888,7 @@ def keen_stats(): elif "after resolving the conflicts" in e.stderr.lower(): # TODO, here we should also do a git merge --abort # to avoid thrashing the cache at next backport request. - cmd = " ".join(shlex.quote(arg) for arg in sys.argv) + cmd = shlex.join(sys.argv) print( "\nPatch did not apply. Resolve conflicts (add, not commit), then re-run `%s`" % cmd, @@ -1319,7 +1294,5 @@ def quote(*, session, payload, arguments, local_config=None): """ > MeeseeksDev: Gee, {user}, what do you want to do tonight? {user}: The same thing we do every night, MeeseeksDev - try to take over the world! -""".format( - user=user - ), +""".format(user=user), ) diff --git a/meeseeksdev/meeseeksbox/core.py b/meeseeksdev/meeseeksbox/core.py index 642bc02..0dd6c64 100644 --- a/meeseeksdev/meeseeksbox/core.py +++ b/meeseeksdev/meeseeksbox/core.py @@ -15,7 +15,13 @@ from yieldbreaker import YieldBreaker from .scopes import Permission -from .utils import ACCEPT_HEADER_SYMMETRA, Authenticator, add_event, clear_caches, http_client +from .utils import ( + ACCEPT_HEADER_SYMMETRA, + Authenticator, + add_event, + clear_caches, + http_client, +) green = "\033[0;32m" yellow = "\033[0;33m" @@ -26,12 +32,10 @@ class Config: - botname = None - integration_id = -1 key = None botname = None at_botname = None - integration_id = None + integration_id: int | None = None webhook_secret = None personal_account_name = None personal_account_token = None @@ -461,7 +465,7 @@ def dispatch_on_mention(self, body: str, payload: dict, user: str) -> None: permission_level = session._get_permission(org, repo, user) command_args = process_mentioning_comment(body, self.mention_bot_re) - for (command, arguments) in command_args: + for command, arguments in command_args: print(" :: treating", command, arguments) add_event( "dispatch", @@ -609,9 +613,9 @@ def user_can(user, command, repo, org, session): gen.send(None) else: try: - comment_url = payload.get("issue", payload.get("pull_request"))[ - "comments_url" - ] + issue_or_pr = payload.get("issue", payload.get("pull_request")) + assert issue_or_pr is not None + comment_url = issue_or_pr["comments_url"] user = payload["comment"]["user"]["login"] session.post_comment( comment_url, diff --git a/meeseeksdev/meeseeksbox/utils.py b/meeseeksdev/meeseeksbox/utils.py index 6da146f..cefec0e 100644 --- a/meeseeksdev/meeseeksbox/utils.py +++ b/meeseeksdev/meeseeksbox/utils.py @@ -1,6 +1,7 @@ """ Utility functions to work with github. """ + import datetime import json import re diff --git a/meeseeksdev/tests/test_misc.py b/meeseeksdev/tests/test_misc.py index b474cf3..b91085c 100644 --- a/meeseeksdev/tests/test_misc.py +++ b/meeseeksdev/tests/test_misc.py @@ -10,8 +10,7 @@ def test1(): assert ( process_mentioning_comment( - textwrap.dedent( - """ + textwrap.dedent(""" @meeseeksdev nothing @meeseeksdev[bot] do nothing meeseeksdev[bot] do something @@ -19,8 +18,7 @@ def test1(): @meeseeksdev run something - """ - ), + """), reg, ) == [ diff --git a/meeseeksdev/tests/test_webhook.py b/meeseeksdev/tests/test_webhook.py index de886c3..6548e38 100644 --- a/meeseeksdev/tests/test_webhook.py +++ b/meeseeksdev/tests/test_webhook.py @@ -15,6 +15,7 @@ forward_staging_url="", webhook_secret="foo", ) +assert config.integration_id is not None auth = Authenticator( config.integration_id,