Skip to content

Commit

Permalink
Updates to codebase from pyupgrade run
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Dec 11, 2023
1 parent 0ff6e8c commit d60e99f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion push_action/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING: # pragma: no cover
from typing import Any, Iterator
from typing import Any
from collections.abc import Iterator


class InMemoryCache:
Expand Down
2 changes: 1 addition & 1 deletion push_action/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def unprotect_reviews() -> None:
def protect_reviews() -> None:
"""Re-add pull request review protection for target branch"""
# Retrieve data
with open("tmp_protection_rules.json", "r", encoding="utf8") as handle:
with open("tmp_protection_rules.json", encoding="utf8") as handle:
data = json.load(handle)

# Add protection
Expand Down
3 changes: 2 additions & 1 deletion push_action/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
from push_action.validate import validate_rest_api_base_url

if TYPE_CHECKING: # pragma: no cover
from typing import Callable, List, Union
from typing import List, Union
from collections.abc import Callable


LOGGER = logging.getLogger("push_action.utils")
Expand Down
2 changes: 1 addition & 1 deletion push_action/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def validate_conclusions(conclusions: list[str]) -> list[str]:
)

# Remove redundant entries and conform to lowercase
conclusions = list(set(conclusion.lower() for conclusion in conclusions))
conclusions = list({conclusion.lower() for conclusion in conclusions})

for conclusion in conclusions:
invalid_conclusions: list[str] = []
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

TOP_DIR = Path(__file__).parent.resolve()

with open(TOP_DIR / "push_action" / "__init__.py", "r", encoding="utf8") as handle:
with open(TOP_DIR / "push_action" / "__init__.py", encoding="utf8") as handle:
for line in handle.readlines():
version = re.findall(r'__version__ = "(.*)"', line)
if version:
Expand Down

0 comments on commit d60e99f

Please sign in to comment.