diff --git a/async_subprocess.py b/async_subprocess.py index b55584b..fe393ea 100644 --- a/async_subprocess.py +++ b/async_subprocess.py @@ -1,4 +1,5 @@ """asyncio subprocess create_subprocess_exec""" + import asyncio import subprocess diff --git a/async_subprocess_test.py b/async_subprocess_test.py index 3119110..a2fe1a4 100644 --- a/async_subprocess_test.py +++ b/async_subprocess_test.py @@ -1,4 +1,5 @@ """Tests for async_subprocess_test""" + import subprocess import pytest diff --git a/bot_local_test.py b/bot_local_test.py index d3cc54b..d0c0900 100644 --- a/bot_local_test.py +++ b/bot_local_test.py @@ -1,4 +1,5 @@ """Make sure bot_local works""" + import pytest from bot_local import async_main diff --git a/bot_test.py b/bot_test.py index f439d2b..ad4215a 100644 --- a/bot_test.py +++ b/bot_test.py @@ -1,4 +1,5 @@ """Tests for Doof""" + import asyncio from datetime import timedelta @@ -1045,13 +1046,15 @@ async def test_wait_for_checkboxes( get_release_pr_mock = mocker.async_patch("bot.get_release_pr", return_value=pr) get_unchecked_patch = mocker.async_patch( "bot.get_unchecked_authors", - side_effect=[ - {"author1", "author2", "author3"}, - {"author2"}, - set(), - ] - if has_checkboxes - else [set()], + side_effect=( + [ + {"author1", "author2", "author3"}, + {"author2"}, + set(), + ] + if has_checkboxes + else [set()] + ), ) doof.slack_users = [ {"profile": {"real_name": name}, "id": username} @@ -1403,15 +1406,17 @@ async def test_start_new_releases( ) get_release_pr_mock = mocker.async_patch( "bot.get_release_pr", - return_value=ReleasePR( - version=old_version, - url="https://example.com", - body="...", - number=123, - open=False, - ) - if has_release_pr - else None, + return_value=( + ReleasePR( + version=old_version, + url="https://example.com", + body="...", + number=123, + open=False, + ) + if has_release_pr + else None + ), ) release_notes = f"Release notes for {test_repo.repo_url}" get_project_version_mock = mocker.async_patch( diff --git a/client_wrapper.py b/client_wrapper.py index 34a6180..b4c2152 100644 --- a/client_wrapper.py +++ b/client_wrapper.py @@ -1,4 +1,5 @@ """Wrapper for HTTP client. Replaces httpx until it matures.""" + import requests from requests.adapters import HTTPAdapter from urllib3.util import Retry diff --git a/conftest.py b/conftest.py index c60982b..cee81bc 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,5 @@ """Fixtures for tests""" + import os import pytest diff --git a/constants.py b/constants.py index 4c45a50..453ff1a 100644 --- a/constants.py +++ b/constants.py @@ -1,4 +1,5 @@ """Constants""" + import os diff --git a/exception.py b/exception.py index 3562785..08c6962 100644 --- a/exception.py +++ b/exception.py @@ -1,4 +1,5 @@ """Exceptions for release script""" + from subprocess import CalledProcessError diff --git a/finish_release.py b/finish_release.py index 24a4015..c5b1b42 100644 --- a/finish_release.py +++ b/finish_release.py @@ -1,4 +1,5 @@ """Release script to finish the release""" + import os import re from datetime import datetime diff --git a/finish_release_test.py b/finish_release_test.py index 0142231..7784ade 100644 --- a/finish_release_test.py +++ b/finish_release_test.py @@ -1,4 +1,5 @@ """Tests for finish_release.py""" + from datetime import datetime import re import os diff --git a/github_test.py b/github_test.py index b938f5c..a5a32aa 100644 --- a/github_test.py +++ b/github_test.py @@ -1,4 +1,5 @@ """Tests for github functions""" + import json import os from urllib.parse import quote diff --git a/lib.py b/lib.py index 111146d..e3d335d 100644 --- a/lib.py +++ b/lib.py @@ -1,4 +1,5 @@ """Shared functions for release script Python files""" + from collections import namedtuple from contextlib import asynccontextmanager from datetime import datetime, timezone diff --git a/lib_test.py b/lib_test.py index 6cdf1fb..a82c273 100644 --- a/lib_test.py +++ b/lib_test.py @@ -1,4 +1,5 @@ """Tests for lib""" + from requests import Response, HTTPError import pytest diff --git a/publish.py b/publish.py index aee86f4..132a4cf 100644 --- a/publish.py +++ b/publish.py @@ -1,4 +1,5 @@ """Functions for publishing""" + import os from pathlib import Path diff --git a/publish_test.py b/publish_test.py index 8ce0d51..ed45ea9 100644 --- a/publish_test.py +++ b/publish_test.py @@ -1,6 +1,7 @@ """ Test package uploading functions """ + import os from pathlib import Path import subprocess diff --git a/release_test.py b/release_test.py index fdb78e7..f77b8f0 100644 --- a/release_test.py +++ b/release_test.py @@ -1,4 +1,5 @@ """Tests for release script""" + import os from subprocess import CalledProcessError diff --git a/repo_info.py b/repo_info.py index ae8c078..0662718 100644 --- a/repo_info.py +++ b/repo_info.py @@ -1,4 +1,5 @@ """Information about repositories""" + from collections import namedtuple RepoInfo = namedtuple( diff --git a/slack.py b/slack.py index 948afd8..72a28f7 100644 --- a/slack.py +++ b/slack.py @@ -1,4 +1,5 @@ """functions for interacting with slack""" + from client_wrapper import ClientWrapper diff --git a/slack_test.py b/slack_test.py index 9629053..8de2f02 100644 --- a/slack_test.py +++ b/slack_test.py @@ -1,4 +1,5 @@ """Tests for slack functions""" + import pytest diff --git a/status.py b/status.py index 174e38a..5512639 100644 --- a/status.py +++ b/status.py @@ -1,4 +1,5 @@ """Get release status of a repository""" + from constants import ( BLOCKER_LABELS, DEPLOYED_TO_PROD, @@ -89,9 +90,11 @@ async def status_for_repo_new_commits(*, github_access_token, repo_info, release ) default_branch = await get_default_branch(working_dir) return await any_commits_between_branches( - branch1="origin/release-candidate" - if release_pr and release_pr.open - else f"v{last_version}", + branch1=( + "origin/release-candidate" + if release_pr and release_pr.open + else f"v{last_version}" + ), branch2=default_branch, root=working_dir, ) diff --git a/status_test.py b/status_test.py index 535389f..43c7dec 100644 --- a/status_test.py +++ b/status_test.py @@ -1,4 +1,5 @@ """Tests for statuses""" + import pytest @@ -159,9 +160,11 @@ async def test_status_for_repo_new_commits( # pylint: disable=too-many-argument ) get_default_branch_mock.assert_called_once_with(test_repo_directory) any_commits_mock.assert_called_once_with( - branch1="origin/release-candidate" - if has_release_pr and is_open - else f"v{get_project_version_mock.return_value}", + branch1=( + "origin/release-candidate" + if has_release_pr and is_open + else f"v{get_project_version_mock.return_value}" + ), branch2=get_default_branch_mock.return_value, root=test_repo_directory, ) diff --git a/test_constants.py b/test_constants.py index 2510706..f2c481c 100644 --- a/test_constants.py +++ b/test_constants.py @@ -1,6 +1,5 @@ """Constants used in unit test""" - FAKE_RELEASE_PR_BODY = """ ## Alice Pote diff --git a/test_requirements.txt b/test_requirements.txt index ba54d7c..1807841 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,4 @@ -black==22.3.0 +black==25.1.0 codecov pdbpp pylint diff --git a/test_util.py b/test_util.py index dd65f4a..1c813de 100644 --- a/test_util.py +++ b/test_util.py @@ -1,4 +1,5 @@ """Utility functions for testing""" + from contextlib import asynccontextmanager, contextmanager import gzip import os diff --git a/version.py b/version.py index d093a51..0a4a8ff 100644 --- a/version.py +++ b/version.py @@ -1,6 +1,7 @@ """ General versioning functions """ + import json import os from pathlib import Path diff --git a/version_test.py b/version_test.py index 8436db9..ca0e003 100644 --- a/version_test.py +++ b/version_test.py @@ -1,4 +1,5 @@ """Test version functions""" + import json import os from pathlib import Path diff --git a/wait_for_deploy.py b/wait_for_deploy.py index ba9d632..e87d29f 100644 --- a/wait_for_deploy.py +++ b/wait_for_deploy.py @@ -1,4 +1,5 @@ """Wait for hash on server to match with deployed code""" + import asyncio import time diff --git a/wait_for_deploy_test.py b/wait_for_deploy_test.py index fd5cd79..b90c608 100644 --- a/wait_for_deploy_test.py +++ b/wait_for_deploy_test.py @@ -1,4 +1,5 @@ """Tests for wait_for_deploy""" + import pytest from test_util import async_context_manager_yielder diff --git a/web.py b/web.py index 90bafe3..44fcf91 100644 --- a/web.py +++ b/web.py @@ -1,6 +1,7 @@ """ Web server for handling slack webhooks """ + import hmac import json diff --git a/web_test.py b/web_test.py index 5f0e031..e425184 100644 --- a/web_test.py +++ b/web_test.py @@ -1,4 +1,5 @@ """Tests for the web server""" + import asyncio import json from unittest.mock import patch