From cfb1bda82cc5195d799dc9ca0d287755de8c07b7 Mon Sep 17 00:00:00 2001 From: Thomas Polasek Date: Wed, 20 Nov 2024 15:26:13 -0800 Subject: [PATCH] Convert directory fbcode/kernel to use the Ruff Formatter Summary: Converts the directory specified to use the Ruff formatter in pyfmt ruff_dog If this diff causes merge conflicts when rebasing, please run `hg status -n -0 --change . -I '**/*.{py,pyi}' | xargs -0 arc pyfmt` on your diff, and amend any changes before rebasing onto latest. That should help reduce or eliminate any merge conflicts. allow-large-files Reviewed By: amyreese Differential Revision: D66248116 fbshipit-source-id: 7c3d73bd42cd040f0d86db02901694b8707494fa --- kernel_patches_daemon/branch_worker.py | 16 ++++------------ kernel_patches_daemon/github_connector.py | 1 - kernel_patches_daemon/patchwork.py | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/kernel_patches_daemon/branch_worker.py b/kernel_patches_daemon/branch_worker.py index 3abcae8..cac0283 100644 --- a/kernel_patches_daemon/branch_worker.py +++ b/kernel_patches_daemon/branch_worker.py @@ -87,9 +87,7 @@ UPSTREAM_REMOTE_NAME = "upstream" -EMAIL_TEMPLATE_BASE: Final[ - str -] = """\ +EMAIL_TEMPLATE_BASE: Final[str] = """\ Dear patch submitter, CI has tested the following submission: @@ -103,26 +101,20 @@ kernel-ci@meta.com. """ -EMAIL_TEMPLATE_MERGE_CONFLICT_BODY: Final[ - str -] = """\ +EMAIL_TEMPLATE_MERGE_CONFLICT_BODY: Final[str] = """\ PR: {github_pr_url} Please rebase your submission onto the most recent upstream change and resubmit the patch to get it tested again. """ -EMAIL_TEMPLATE_SUCCESS_BODY: Final[ - str -] = """\ +EMAIL_TEMPLATE_SUCCESS_BODY: Final[str] = """\ Matrix: {github_actions_url} No further action is necessary on your part. """ -EMAIL_TEMPLATE_FAILURE_BODY: Final[ - str -] = """\ +EMAIL_TEMPLATE_FAILURE_BODY: Final[str] = """\ Matrix: {github_actions_url} {inline_logs}\ diff --git a/kernel_patches_daemon/github_connector.py b/kernel_patches_daemon/github_connector.py index 8c5b06e..daff129 100644 --- a/kernel_patches_daemon/github_connector.py +++ b/kernel_patches_daemon/github_connector.py @@ -65,7 +65,6 @@ def __init__( app_auth: Optional[Auth.AppInstallationAuth] = None, http_retries: Optional[int] = None, ) -> None: - assert bool(github_oauth_token) ^ bool( app_auth ), "Only one of github_oauth_token or app_auth can be set" diff --git a/kernel_patches_daemon/patchwork.py b/kernel_patches_daemon/patchwork.py index b8d7f63..7c89402 100644 --- a/kernel_patches_daemon/patchwork.py +++ b/kernel_patches_daemon/patchwork.py @@ -453,7 +453,6 @@ async def is_expired(self) -> bool: @cached(cache=TTLCache(maxsize=1, ttl=120)) async def get_patch_binary_content(self) -> bytes: - content = await self.pw_client.get_blob(self.mbox) logger.debug( f"Received patch mbox for series {self.id}, size: {len(content)} bytes"