From: Mike Bayer Date: Wed, 9 Feb 2022 20:39:44 +0000 (-0500) Subject: update zimports X-Git-Tag: rel_1_4_32~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6f6fe264b62539ededb44b3b1c1f4b5804b7d51;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update zimports includes new fix for formatting like black does. also runs black on a few outliers. Change-Id: I67446660a6bc10b73eb710389ae6d3f122af9302 (cherry picked from commit 2579ed2b8f295c7e0ad3d875bf57535623f8df0d) --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae35977b9d..f8512708ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,9 @@ repos: - id: black - repo: https://github.com/sqlalchemyorg/zimports - rev: v0.4.0 + rev: v0.5.0 hooks: - id: zimports - args: - - --keep-unused-type-checking - repo: https://github.com/pycqa/flake8 rev: 3.9.2 diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py index 97809f4b9c..a92d476ac5 100644 --- a/lib/sqlalchemy/testing/engines.py +++ b/lib/sqlalchemy/testing/engines.py @@ -280,7 +280,9 @@ def testing_engine( """Produce an engine configured by --options with optional overrides.""" if asyncio: - from sqlalchemy.ext.asyncio import create_async_engine as create_engine + from sqlalchemy.ext.asyncio import ( + create_async_engine as create_engine, + ) elif future or ( config.db and config.db._is_future and future is not False ): diff --git a/pyproject.toml b/pyproject.toml index 0f72578923..f82dbd468b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,9 @@ [tool.black] line-length = 79 target-version = ['py27', 'py36'] + +[tool.zimports] +black-line-length = 79 +keep-unused-type-checking = true + + diff --git a/test/ext/mypy/incremental/ticket_6435/enum_col_import2.py b/test/ext/mypy/incremental/ticket_6435/enum_col_import2.py index 4f29932e56..161dce0875 100644 --- a/test/ext/mypy/incremental/ticket_6435/enum_col_import2.py +++ b/test/ext/mypy/incremental/ticket_6435/enum_col_import2.py @@ -1,8 +1,10 @@ from sqlalchemy import Column from sqlalchemy import Enum -from sqlalchemy.orm import declarative_base, Mapped +from sqlalchemy.orm import declarative_base +from sqlalchemy.orm import Mapped from . import enum_col_import1 -from .enum_col_import1 import IntEnum, StrEnum +from .enum_col_import1 import IntEnum +from .enum_col_import1 import StrEnum Base = declarative_base()