From d70cde726d29194cbbcb635116a0bf9a343c500f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 11 Oct 2024 19:12:03 -0400 Subject: [PATCH] py39+ Committed via https://github.com/asottile/all-repos --- .github/workflows/main.yml | 8 ++++---- .pre-commit-config.yaml | 4 ++-- git_code_debt/discovery.py | 2 +- git_code_debt/generate.py | 10 +++++----- git_code_debt/generate_config.py | 2 +- git_code_debt/list_metrics.py | 2 +- git_code_debt/metrics/base.py | 2 +- git_code_debt/metrics/binary_file_count.py | 2 +- git_code_debt/metrics/curse.py | 2 +- git_code_debt/metrics/lines.py | 2 +- git_code_debt/metrics/submodule_count.py | 2 +- git_code_debt/metrics/symlink_count.py | 2 +- git_code_debt/repo_parser.py | 2 +- git_code_debt/server/app.py | 2 +- git_code_debt/server/metric_config.py | 2 +- git_code_debt/util/iter.py | 4 ++-- setup.cfg | 2 +- tests/generate_test.py | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e97a39..cd6067d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,10 +8,10 @@ on: jobs: main-latest-git: - uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0 with: - env: '["py38"]' + env: '["py39"]' main: - uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0 with: - env: '["py38", "py39", "py310"]' + env: '["py39", "py310", "py311"]' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3e6ab9..2334468 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: rev: v3.13.0 hooks: - id: reorder-python-imports - args: [--py38-plus, --add-import, 'from __future__ import annotations'] + args: [--py39-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/add-trailing-comma rev: v3.1.0 hooks: @@ -26,7 +26,7 @@ repos: rev: v3.17.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/hhatto/autopep8 rev: v2.3.1 hooks: diff --git a/git_code_debt/discovery.py b/git_code_debt/discovery.py index 2b33335..e301e98 100644 --- a/git_code_debt/discovery.py +++ b/git_code_debt/discovery.py @@ -1,8 +1,8 @@ from __future__ import annotations +from collections.abc import Sequence from types import ModuleType from typing import Any -from typing import Sequence from git_code_debt.metrics.base import DiffParserBase from git_code_debt.util.discovery import discover diff --git a/git_code_debt/generate.py b/git_code_debt/generate.py index 95469eb..97a9d2d 100644 --- a/git_code_debt/generate.py +++ b/git_code_debt/generate.py @@ -7,12 +7,12 @@ import multiprocessing.pool import os.path import sqlite3 +from collections import Counter +from collections.abc import Generator +from collections.abc import Iterable +from collections.abc import Sequence +from re import Pattern from typing import Callable -from typing import Counter -from typing import Generator -from typing import Iterable -from typing import Pattern -from typing import Sequence from typing import TypeVar import pkg_resources diff --git a/git_code_debt/generate_config.py b/git_code_debt/generate_config.py index 701fad7..6f0371b 100644 --- a/git_code_debt/generate_config.py +++ b/git_code_debt/generate_config.py @@ -1,9 +1,9 @@ from __future__ import annotations import re +from re import Pattern from typing import Any from typing import NamedTuple -from typing import Pattern import cfgv diff --git a/git_code_debt/list_metrics.py b/git_code_debt/list_metrics.py index e185e49..5e5492d 100644 --- a/git_code_debt/list_metrics.py +++ b/git_code_debt/list_metrics.py @@ -1,7 +1,7 @@ from __future__ import annotations import argparse -from typing import Sequence +from collections.abc import Sequence from git_code_debt import options from git_code_debt.discovery import get_metric_parsers_from_args diff --git a/git_code_debt/metrics/base.py b/git_code_debt/metrics/base.py index 37bcae3..ba86cb1 100644 --- a/git_code_debt/metrics/base.py +++ b/git_code_debt/metrics/base.py @@ -1,7 +1,7 @@ from __future__ import annotations import inspect -from typing import Generator +from collections.abc import Generator from typing import NamedTuple from git_code_debt.file_diff_stat import FileDiffStat diff --git a/git_code_debt/metrics/binary_file_count.py b/git_code_debt/metrics/binary_file_count.py index b658a2c..335bd78 100644 --- a/git_code_debt/metrics/binary_file_count.py +++ b/git_code_debt/metrics/binary_file_count.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Generator +from collections.abc import Generator from git_code_debt.file_diff_stat import FileDiffStat from git_code_debt.file_diff_stat import SpecialFileType diff --git a/git_code_debt/metrics/curse.py b/git_code_debt/metrics/curse.py index d1a982e..22badd1 100644 --- a/git_code_debt/metrics/curse.py +++ b/git_code_debt/metrics/curse.py @@ -1,7 +1,7 @@ from __future__ import annotations import collections -from typing import Generator +from collections.abc import Generator from identify import identify diff --git a/git_code_debt/metrics/lines.py b/git_code_debt/metrics/lines.py index a4ed85a..48b447d 100644 --- a/git_code_debt/metrics/lines.py +++ b/git_code_debt/metrics/lines.py @@ -1,7 +1,7 @@ from __future__ import annotations import collections -from typing import Generator +from collections.abc import Generator from identify import identify diff --git a/git_code_debt/metrics/submodule_count.py b/git_code_debt/metrics/submodule_count.py index e2f8d62..1eca868 100644 --- a/git_code_debt/metrics/submodule_count.py +++ b/git_code_debt/metrics/submodule_count.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Generator +from collections.abc import Generator from git_code_debt.file_diff_stat import FileDiffStat from git_code_debt.file_diff_stat import SpecialFileType diff --git a/git_code_debt/metrics/symlink_count.py b/git_code_debt/metrics/symlink_count.py index 57902ed..9e1373c 100644 --- a/git_code_debt/metrics/symlink_count.py +++ b/git_code_debt/metrics/symlink_count.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Generator +from collections.abc import Generator from git_code_debt.file_diff_stat import FileDiffStat from git_code_debt.file_diff_stat import SpecialFileType diff --git a/git_code_debt/repo_parser.py b/git_code_debt/repo_parser.py index f1fb121..2d1b1de 100644 --- a/git_code_debt/repo_parser.py +++ b/git_code_debt/repo_parser.py @@ -3,7 +3,7 @@ import contextlib import subprocess import tempfile -from typing import Generator +from collections.abc import Generator from typing import NamedTuple from git_code_debt.util.iter import chunk_iter diff --git a/git_code_debt/server/app.py b/git_code_debt/server/app.py index a299af1..11e6f8c 100644 --- a/git_code_debt/server/app.py +++ b/git_code_debt/server/app.py @@ -4,8 +4,8 @@ import os.path import shutil import sqlite3 +from collections.abc import Sequence from typing import NoReturn -from typing import Sequence import flask import pkg_resources diff --git a/git_code_debt/server/metric_config.py b/git_code_debt/server/metric_config.py index 16638e8..f4060ee 100644 --- a/git_code_debt/server/metric_config.py +++ b/git_code_debt/server/metric_config.py @@ -1,9 +1,9 @@ from __future__ import annotations import re +from re import Pattern from typing import Any from typing import NamedTuple -from typing import Pattern class Group(NamedTuple): diff --git a/git_code_debt/util/iter.py b/git_code_debt/util/iter.py index 0e76523..2a7453c 100644 --- a/git_code_debt/util/iter.py +++ b/git_code_debt/util/iter.py @@ -1,8 +1,8 @@ from __future__ import annotations import itertools -from typing import Generator -from typing import Iterable +from collections.abc import Generator +from collections.abc import Iterable from typing import TypeVar T = TypeVar('T') diff --git a/setup.cfg b/setup.cfg index c0c8b81..73d223f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ install_requires = mako markdown-code-blocks pyyaml -python_requires = >=3.8 +python_requires = >=3.9 [options.packages.find] exclude = diff --git a/tests/generate_test.py b/tests/generate_test.py index 1d672c7..63a4004 100644 --- a/tests/generate_test.py +++ b/tests/generate_test.py @@ -4,7 +4,7 @@ import os.path import re import sqlite3 -from typing import Counter +from collections import Counter import pytest