diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0e5b35..c4ab7c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ on: jobs: main-windows: - 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"]' os: windows-latest main-linux: - uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0 + uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0 with: - env: '["py38", "py39"]' + env: '["py39", "py310"]' os: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 315c420..fedfab3 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/setup.cfg b/setup.cfg index de3387d..3c13edf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ py_modules = yesqa install_requires = flake8>=3.9 tokenize-rt>=2.1 -python_requires = >=3.8 +python_requires = >=3.9 [options.entry_points] console_scripts = diff --git a/yesqa.py b/yesqa.py index 22b4008..b5dc401 100644 --- a/yesqa.py +++ b/yesqa.py @@ -7,13 +7,12 @@ import subprocess import sys import tempfile -from typing import List -from typing import Match -from typing import Sequence +from collections.abc import Sequence +from re import Match import tokenize_rt -Tokens = List[tokenize_rt.Token] +Tokens = list[tokenize_rt.Token] NOQA_FILE_RE = re.compile(r'^# flake8[:=]\s*noqa', re.I) _code = '[a-z]{1,3}[0-9]+'