From: Mike Bayer Date: Tue, 24 Jun 2025 18:04:56 +0000 (-0400) Subject: try flake8-import-order 0.19.2 X-Git-Tag: rel_1_16_3~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10da367a914fe9bb8e448ff71753412b35199de3;p=thirdparty%2Fsqlalchemy%2Falembic.git try flake8-import-order 0.19.2 the big new thang is that it is doing import order checks inside of TYPE_CHECKING blocks. Introduces some new codes that we enthusiastically add to our ignore list. Change-Id: I4e844408a8b218f9b92c43ad5e2a5c16781100be --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 304ef3a4..b99f3bff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: black - repo: https://github.com/sqlalchemyorg/zimports - rev: v0.6.0 + rev: v0.6.2 hooks: - id: zimports args: @@ -18,7 +18,7 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-import-order!=0.19.0 + - flake8-import-order>=0.19.2 - flake8-import-single==0.1.5 - flake8-builtins - flake8-docstrings diff --git a/alembic/util/sqla_compat.py b/alembic/util/sqla_compat.py index a427d3c8..a909ead7 100644 --- a/alembic/util/sqla_compat.py +++ b/alembic/util/sqla_compat.py @@ -31,12 +31,10 @@ from sqlalchemy.sql.elements import BindParameter from sqlalchemy.sql.elements import ColumnClause from sqlalchemy.sql.elements import TextClause from sqlalchemy.sql.elements import UnaryExpression +from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME # type: ignore[attr-defined] # noqa: E501 from sqlalchemy.sql.visitors import traverse from typing_extensions import TypeGuard -if True: - from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME # type: ignore[attr-defined] # noqa: E501 - if TYPE_CHECKING: from sqlalchemy import ClauseElement from sqlalchemy import Identity @@ -81,7 +79,7 @@ if TYPE_CHECKING: ) -> Callable[[_CompilerProtocol], _CompilerProtocol]: ... else: - from sqlalchemy.ext.compiler import compiles + from sqlalchemy.ext.compiler import compiles # noqa: I100,I202 identity_has_dialect_kwargs = issubclass(schema.Identity, DialectKWArgs) diff --git a/setup.cfg b/setup.cfg index f3aaa9aa..3191a664 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,7 @@ ignore = A003,A005 D, E203,E305,E704,E711,E712,E721,E722,E741, + I300, N801,N802,N806, RST304,RST303,RST299,RST399, W503,W504 diff --git a/tox.ini b/tox.ini index 57afd796..cc254c33 100644 --- a/tox.ini +++ b/tox.ini @@ -87,7 +87,7 @@ commands = {[testenv:pep484]commands} basepython = python3 deps= flake8 - flake8-import-order!=0.19.0 + flake8-import-order>=0.19.2 flake8-import-single==0.1.5 flake8-builtins flake8-docstrings