mypy: Add backoff-stubs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-08-09 16:37:15 -07:00 committed by Tim Abbott
parent 09564e95ac
commit 05124737f7
6 changed files with 14 additions and 3 deletions

View File

@ -49,7 +49,6 @@ no_implicit_reexport = false
module = [
"ahocorasick.*",
"aioapns.*",
"backoff.*",
"bitfield.*",
"bmemcached.*",
"boto3.*",

View File

@ -80,6 +80,9 @@ backoff==1.10.0 \
--hash=sha256:5e73e2cbe780e1915a204799dba0a01896f45f4385e636bcca7a0614d879d0cd \
--hash=sha256:b8fba021fac74055ac05eb7c7bfce4723aedde6cd0a504e5326bcb0bdd6d19a4
# via -r requirements/common.in
backoff-stubs==1.10.0 \
--hash=sha256:03e995de0a70016c6fe758498e1ca811f1db517c00cbd06e3039c9e4f6ea2566
# via -r requirements/mypy.in
beautifulsoup4==4.9.3 \
--hash=sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35 \
--hash=sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25 \

View File

@ -4,6 +4,7 @@
# See requirements/README.md for more detail.
mypy
backoff-stubs
lxml-stubs
https://github.com/andersk/pika-stubs/archive/87c5795741449e37bdbd2ceceee853fd56462440.zip#egg=pika-stubs==0.1.3+git # https://github.com/hahow/pika-stubs/issues/1, https://github.com/hahow/pika-stubs/pull/4
sqlalchemy-stubs

View File

@ -7,6 +7,9 @@
#
# For details, see requirements/README.md .
#
backoff-stubs==1.10.0 \
--hash=sha256:03e995de0a70016c6fe758498e1ca811f1db517c00cbd06e3039c9e4f6ea2566
# via -r requirements/mypy.in
lxml-stubs==0.2.0 \
--hash=sha256:78f1bfb31b1f2af9a5c9e9a602ab1b589a64a5a3cc444931a39cdfd02d6864b0 \
--hash=sha256:f0b3621ec2a23bea4145f484490c8b27383ecb407b3f8b079199ad4a0af4180b

View File

@ -48,4 +48,4 @@ API_FEATURE_LEVEL = 92
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = "153.12"
PROVISION_VERSION = "153.13"

View File

@ -272,7 +272,12 @@ def send_email(
raise EmailNotDeliveredException
@backoff.on_exception(backoff.expo, OSError, max_tries=MAX_CONNECTION_TRIES, logger=None)
@backoff.on_exception(
backoff.expo,
OSError,
max_tries=MAX_CONNECTION_TRIES,
logger=None, # type: ignore[arg-type] # https://github.com/gleb-chipiga/backoff-stubs/pull/2
)
def initialize_connection(connection: Optional[BaseEmailBackend] = None) -> BaseEmailBackend:
if not connection:
connection = get_connection()