summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2022-02-10 03:56:04 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2022-02-10 03:56:04 +0000
commitf1da1623b800cd4de3b71fd1b2ad5ccfde286780 (patch)
treea3c5437002919b2c42961cc49b9746862098a804
parent449389a45f358300ba95f7d03c7b94b64703e31a (diff)
parent5a6a475e14f09a36061b7422534b073e1041fe44 (diff)
downloadsqlalchemy-f1da1623b800cd4de3b71fd1b2ad5ccfde286780.tar.gz
Merge "update zimports" into main
-rw-r--r--.pre-commit-config.yaml4
-rw-r--r--lib/sqlalchemy/__init__.py13
-rw-r--r--lib/sqlalchemy/sql/__init__.py17
-rw-r--r--lib/sqlalchemy/sql/expression.py15
-rw-r--r--lib/sqlalchemy/testing/engines.py4
-rw-r--r--pyproject.toml4
6 files changed, 27 insertions, 30 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 015d80ecf..069391468 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.2
+ rev: v0.5.0
hooks:
- id: zimports
- args:
- - --keep-unused-type-checking
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py
index 7d402d44e..c8ec1d825 100644
--- a/lib/sqlalchemy/__init__.py
+++ b/lib/sqlalchemy/__init__.py
@@ -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"
diff --git a/lib/sqlalchemy/sql/__init__.py b/lib/sqlalchemy/sql/__init__.py
index b558f9bf5..2f84370aa 100644
--- a/lib/sqlalchemy/sql/__init__.py
+++ b/lib/sqlalchemy/sql/__init__.py
@@ -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
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index 680eae754..0ed5bd986 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -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
diff --git a/lib/sqlalchemy/testing/engines.py b/lib/sqlalchemy/testing/engines.py
index 0310825bc..1d337b28f 100644
--- a/lib/sqlalchemy/testing/engines.py
+++ b/lib/sqlalchemy/testing/engines.py
@@ -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
diff --git a/pyproject.toml b/pyproject.toml
index 1006ad78c..3af6ea089 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,6 +10,10 @@
line-length = 79
target-version = ['py37']
+[tool.zimports]
+black-line-length = 79
+keep-unused-type-checking = true
+
[tool.slotscheck]
exclude-modules = '^sqlalchemy\.testing'