From: Mike Bayer Date: Tue, 24 Jun 2025 17:57:17 +0000 (-0400) Subject: try flake8-import-order 0.19.2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c8343576188940268de467b2537e5f838464690;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.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. update to the latest and greatest zimports 0.6.2 as well Change-Id: I4e844408a8b218f9b92c43ad5e2a5c16781100be --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06a3ef6366..688ff050ef 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 @@ -16,7 +16,7 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-import-order<0.19 + - flake8-import-order>=0.19.2 - flake8-import-single==0.1.5 - flake8-builtins - flake8-future-annotations>=0.0.5 diff --git a/doc/build/changelog/unreleased_21/10816.rst b/doc/build/changelog/unreleased_21/10816.rst index 1b037bcb31..e5084cdfa7 100644 --- a/doc/build/changelog/unreleased_21/10816.rst +++ b/doc/build/changelog/unreleased_21/10816.rst @@ -3,4 +3,4 @@ :tickets: 10816 The :paramref:`_orm.Session.flush.objects` parameter is now - deprecated. \ No newline at end of file + deprecated. diff --git a/doc/build/index.rst b/doc/build/index.rst index 6846a00e89..add84a51e2 100644 --- a/doc/build/index.rst +++ b/doc/build/index.rst @@ -193,4 +193,4 @@ SQLAlchemy Documentation errors * :doc:`Complete table of of contents ` - Full list of available documentation - * :ref:`Index ` - Index for easy lookup of documentation topics \ No newline at end of file + * :ref:`Index ` - Index for easy lookup of documentation topics diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 5b992269a5..a46fcca2d9 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2302,10 +2302,7 @@ class SQLCompiler(Compiled): @util.memoized_property @util.preload_module("sqlalchemy.engine.result") def _inserted_primary_key_from_returning_getter(self): - if typing.TYPE_CHECKING: - from ..engine import result - else: - result = util.preloaded.engine_result + result = util.preloaded.engine_result assert self.compile_state is not None statement = self.compile_state.statement diff --git a/setup.cfg b/setup.cfg index bdcb3fd8db..d66134a10f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,7 @@ ignore = A003,A005 D, E203,E305,E701,E704,E711,E712,E721,E722,E741, + I300, N801,N802,N806, RST304,RST303,RST299,RST399, W503,W504,W601 diff --git a/tox.ini b/tox.ini index 2160a4a3ba..dc9626730e 100644 --- a/tox.ini +++ b/tox.ini @@ -236,7 +236,7 @@ extras= deps= flake8==7.2.0 - flake8-import-order<0.19 + flake8-import-order>=0.19.2 flake8-builtins flake8-future-annotations>=0.0.5 flake8-docstrings>=1.6.0