]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update zimports
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Feb 2022 20:39:44 +0000 (15:39 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Feb 2022 22:24:08 +0000 (17:24 -0500)
includes new fix for formatting like black does.

also runs black on a few outliers.

Change-Id: I67446660a6bc10b73eb710389ae6d3f122af9302

.pre-commit-config.yaml
lib/sqlalchemy/__init__.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/testing/engines.py
pyproject.toml

index 015d80ecfc4d1052fbd708f1f6f3347a38befc1a..06939146842ca350b764ac3a7b4bcdc25261fc45 100644 (file)
@@ -7,11 +7,9 @@ repos:
     -   id: black
 
 -   repo: https://github.com/sqlalchemyorg/zimports
-    rev: v0.4.2
+    rev: v0.5.0
     hooks:
     -   id: zimports
-        args:
-            - --keep-unused-type-checking
 
 -   repo: https://github.com/pycqa/flake8
     rev: 4.0.1
index 7d402d44eceba69302eb08382016f1206fa7aa7c..c8ec1d82509e880fad5c3bed2442539c1e8db337 100644 (file)
@@ -55,8 +55,13 @@ from .sql import intersect_all as intersect_all
 from .sql import join as join
 from .sql import label as label
 from .sql import LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT
-from .sql import LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY
+from .sql import (
+    LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
+)
 from .sql import LABEL_STYLE_NONE as LABEL_STYLE_NONE
+from .sql import (
+    LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
+)
 from .sql import lambda_stmt as lambda_stmt
 from .sql import lateral as lateral
 from .sql import literal as literal
@@ -128,12 +133,6 @@ from .types import UnicodeText as UnicodeText
 from .types import VARBINARY as VARBINARY
 from .types import VARCHAR as VARCHAR
 
-if True:
-    # work around zimports bug
-    from .sql import (
-        LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
-    )
-
 
 __version__ = "2.0.0b1"
 
index b558f9bf56362987a112e47c311cc44cb5801907..2f84370aa245313c17c3e175a9d46612430833ff 100644 (file)
@@ -48,6 +48,13 @@ from .expression import Join as Join
 from .expression import join as join
 from .expression import label as label
 from .expression import LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT
+from .expression import (
+    LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
+)
+from .expression import LABEL_STYLE_NONE as LABEL_STYLE_NONE
+from .expression import (
+    LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
+)
 from .expression import lambda_stmt as lambda_stmt
 from .expression import LambdaElement as LambdaElement
 from .expression import lateral as lateral
@@ -88,16 +95,6 @@ from .expression import values as values
 from .expression import within_group as within_group
 from .visitors import ClauseVisitor as ClauseVisitor
 
-if True:
-    # work around zimports bug
-    from .expression import (
-        LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
-    )
-    from .expression import LABEL_STYLE_NONE as LABEL_STYLE_NONE
-    from .expression import (
-        LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
-    )
-
 
 def __go(lcls):
     from .. import util as _sa_util
index 680eae754d68c3c8876c5502404bde6985865818..0ed5bd986567557464790cee45a8cd91a663572e 100644 (file)
@@ -123,7 +123,13 @@ from .selectable import HasPrefixes as HasPrefixes
 from .selectable import HasSuffixes as HasSuffixes
 from .selectable import Join as Join
 from .selectable import LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT
+from .selectable import (
+    LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
+)
 from .selectable import LABEL_STYLE_NONE as LABEL_STYLE_NONE
+from .selectable import (
+    LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
+)
 from .selectable import Lateral as Lateral
 from .selectable import ReturnsRows as ReturnsRows
 from .selectable import ScalarSelect as ScalarSelect
@@ -139,14 +145,5 @@ from .selectable import TextualSelect as TextualSelect
 from .selectable import Values as Values
 from .visitors import Visitable as Visitable
 
-if True:
-    # work around zimports
-    from .selectable import (
-        LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
-    )
-    from .selectable import (
-        LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
-    )
-
 nullsfirst = nulls_first
 nullslast = nulls_last
index 0310825bcd30fe5a421942143cbfbfdf0b5e045a..1d337b28f9092986ec0f96dedd16cdf61d57fcaa 100644 (file)
@@ -306,7 +306,9 @@ def testing_engine(
     transfer_staticpool=False,
 ):
     if asyncio:
-        from sqlalchemy.ext.asyncio import create_async_engine as create_engine
+        from sqlalchemy.ext.asyncio import (
+            create_async_engine as create_engine,
+        )
     else:
         from sqlalchemy import create_engine
     from sqlalchemy.engine.url import make_url
index 1006ad78c082f29af4689b8ac365ce589e320336..3af6ea089cd1ad2cc7abc2712f75880d9e22dd4c 100644 (file)
 line-length = 79
 target-version = ['py37']
 
+[tool.zimports]
+black-line-length = 79
+keep-unused-type-checking = true
+
 [tool.slotscheck]
 exclude-modules = '^sqlalchemy\.testing'