diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94bc9ec..7686f81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: install dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d4f875..16918c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_schedule: monthly repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -15,35 +15,33 @@ repos: - id: requirements-txt-fixer - id: double-quote-string-fixer - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 7.3.0 hooks: - id: flake8 additional_dependencies: [flake8-typing-imports==1.14.0] - args: [--min-python-version=3.8] -- repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v2.0.2 + args: [--min-python-version=3.9] +- repo: https://github.com/hhatto/autopep8 + rev: v2.3.2 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder-python-imports - rev: v3.10.0 + rev: v3.15.0 hooks: - id: reorder-python-imports - args: [--py3-plus] - repo: https://github.com/asottile/add-trailing-comma - rev: v3.0.0 + rev: v3.2.0 hooks: - id: add-trailing-comma - args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.8.0 + rev: v3.20.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.4.0 + rev: v2.8.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 + rev: v1.18.2 hooks: - id: mypy diff --git a/flake8_timeout.py b/flake8_timeout.py index 4009bee..ac792e7 100644 --- a/flake8_timeout.py +++ b/flake8_timeout.py @@ -1,10 +1,7 @@ import ast import importlib.metadata as importlib_metadata +from collections.abc import Generator from typing import Any -from typing import Generator -from typing import List -from typing import Tuple -from typing import Type MSG = 'TIM100 request call has no timeout' @@ -16,7 +13,7 @@ class Visitor(ast.NodeVisitor): def __init__(self) -> None: - self.assignments: List[Tuple[int, int]] = [] + self.assignments: list[tuple[int, int]] = [] def visit_Call(self, node: ast.Call) -> None: if ( @@ -67,7 +64,7 @@ class Plugin: def __init__(self, tree: ast.AST): self._tree = tree - def run(self) -> Generator[Tuple[int, int, str, Type[Any]], None, None]: + def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: visitor = Visitor() visitor.visit(self._tree) for line, col in visitor.assignments: diff --git a/setup.cfg b/setup.cfg index 4ebf782..4f37f70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,6 @@ author_email = jkittner@users.noreply.github.com license = MIT license_files = LICENCE classifiers = - License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython @@ -19,7 +18,7 @@ classifiers = py_modules = flake8_timeout install_requires = flake8 -python_requires = >=3.8 +python_requires = >=3.9 [options.packages.find] exclude = diff --git a/tox.ini b/tox.ini index f36ec48..7ddf0d9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, py39, py310, py311, pre-commit +envlist = py39, py310, py311, py312, py313, pre-commit skip_missing_interpreters = true [testenv]