]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
try flake8-import-order 0.19.2
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Jun 2025 18:04:56 +0000 (14:04 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Jun 2025 18:13:15 +0000 (14:13 -0400)
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

.pre-commit-config.yaml
alembic/util/sqla_compat.py
setup.cfg
tox.ini

index 304ef3a4c6c51b9cb99ced6e79921499e460d003..b99f3bff806dfd2b444f271514d7951e8b6f3304 100644 (file)
@@ -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
index a427d3c8cbc48854c3dab13063df262962c7fc5f..a909ead7f4a5a84728a355685fe417e6c304d5aa 100644 (file)
@@ -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)
index f3aaa9aaf0f6e0932a7a96d570a0594b066c9a56..3191a6646dfe88730e5317eba9ea3a522a89fa98 100644 (file)
--- 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 57afd7969612ab49bed570239c8d77c97ce96a52..cc254c334b97e4104e2a1efc98927cba8a1add7d 100644 (file)
--- 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