From 96d4981faf29f87342041352e884f2f28b72158f Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Wed, 15 Sep 2021 11:42:05 -0700 Subject: [PATCH 1/3] updating __all__ statements to a simpler form thats supported by static type checkers like pyright/pylance https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface --- asyncpg/__init__.py | 6 ++---- asyncpg/exceptions/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asyncpg/__init__.py b/asyncpg/__init__.py index 01af7904..08596207 100644 --- a/asyncpg/__init__.py +++ b/asyncpg/__init__.py @@ -15,7 +15,5 @@ from ._version import __version__ # NOQA -__all__ = ( - ('connect', 'create_pool', 'Pool', 'Record', 'Connection') - + exceptions.__all__ # NOQA -) +__all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection') +__all__ += exceptions.__all__ diff --git a/asyncpg/exceptions/__init__.py b/asyncpg/exceptions/__init__.py index 446a71a8..af46a754 100644 --- a/asyncpg/exceptions/__init__.py +++ b/asyncpg/exceptions/__init__.py @@ -1040,7 +1040,7 @@ class IndexCorruptedError(InternalServerError): sqlstate = 'XX002' -__all__ = _base.__all__ + ( +__all__ = ( 'ActiveSQLTransactionError', 'AdminShutdownError', 'AmbiguousAliasError', 'AmbiguousColumnError', 'AmbiguousFunctionError', 'AmbiguousParameterError', @@ -1180,3 +1180,5 @@ class IndexCorruptedError(InternalServerError): 'WindowingError', 'WithCheckOptionViolationError', 'WrongObjectTypeError', 'ZeroLengthCharacterStringError' ) + +__all__ += _base.__all__ From 2349eaf96c70a0ee17eded107e8903ec612a837f Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Wed, 15 Sep 2021 13:40:38 -0700 Subject: [PATCH 2/3] ignore flake8 import * warning --- asyncpg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncpg/__init__.py b/asyncpg/__init__.py index 08596207..c92871b3 100644 --- a/asyncpg/__init__.py +++ b/asyncpg/__init__.py @@ -16,4 +16,4 @@ __all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection') -__all__ += exceptions.__all__ +__all__ += exceptions.__all__ # noqa: E405 From 44cd367b77bfcd2a916789016adde7f07c4c815f Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Thu, 16 Sep 2021 15:07:28 -0700 Subject: [PATCH 3/3] change `# noqa: E405` back to `# NOQA` --- asyncpg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncpg/__init__.py b/asyncpg/__init__.py index c92871b3..e8cd11eb 100644 --- a/asyncpg/__init__.py +++ b/asyncpg/__init__.py @@ -16,4 +16,4 @@ __all__ = ('connect', 'create_pool', 'Pool', 'Record', 'Connection') -__all__ += exceptions.__all__ # noqa: E405 +__all__ += exceptions.__all__ # NOQA