From 2cb3e21191e97617f68478efe59fdfb15f521e5e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 16:37:03 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71f9e72b..c5e16e89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: args: ["--python-version=3.7", "--ignore-missing-imports", "--scripts-are-modules"] - repo: https://github.com/asottile/pyupgrade - rev: v2.7.4 + rev: v2.9.0 hooks: - id: pyupgrade args: ["--py36-plus"] From 08f72f276d419ba509ea7a5b614731a18817a203 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 16:37:49 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bin/inspect_all_known_projects.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/inspect_all_known_projects.py b/bin/inspect_all_known_projects.py index 5c654735..68b2b683 100755 --- a/bin/inspect_all_known_projects.py +++ b/bin/inspect_all_known_projects.py @@ -15,7 +15,7 @@ from cibuildwheel.projectfiles import Analyzer DIR = Path(__file__).parent.resolve() -def parse(contents: str) -> Optional[str]: +def parse(contents: str) -> str | None: try: tree = ast.parse(contents) analyzer = Analyzer() @@ -50,7 +50,7 @@ class MaybeRemote: def __init__(self, cached_file: Path | str, *, online: bool) -> None: self.online = online if self.online: - self.contents: dict[str, dict[str, Optional[str]]] = { + self.contents: dict[str, dict[str, str | None]] = { "setup.py": {}, "setup.cfg": {}, "pyproject.toml": {}, @@ -59,7 +59,7 @@ class MaybeRemote: with open(cached_file) as f: self.contents = yaml.safe_load(f) - def get(self, repo: str, filename: str) -> Optional[str]: + def get(self, repo: str, filename: str) -> str | None: if self.online: try: self.contents[filename][repo] = ( @@ -79,7 +79,7 @@ class MaybeRemote: with open(filename, "w") as f: yaml.safe_dump(self.contents, f, default_flow_style=False) - def on_each(self, repos: list[str]) -> Iterator[tuple[str, str, Optional[str]]]: + def on_each(self, repos: list[str]) -> Iterator[tuple[str, str, str | None]]: for repo in repos: print(f"[bold]{repo}:") for filename in sorted(self.contents, reverse=True): From 9119bf048c357fbcb7526ded408beebee30b881e Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Mon, 1 Feb 2021 17:55:28 +0100 Subject: [PATCH 3/3] Fix flake8 complaints about unused Optional --- bin/inspect_all_known_projects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/inspect_all_known_projects.py b/bin/inspect_all_known_projects.py index 68b2b683..faf3bab0 100755 --- a/bin/inspect_all_known_projects.py +++ b/bin/inspect_all_known_projects.py @@ -3,7 +3,7 @@ from __future__ import annotations import ast from pathlib import Path -from typing import Iterator, Optional +from typing import Iterator import click import yaml