mirror of https://github.com/zulip/zulip.git
mypy: Add backoff-stubs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
09564e95ac
commit
05124737f7
|
@ -49,7 +49,6 @@ no_implicit_reexport = false
|
||||||
module = [
|
module = [
|
||||||
"ahocorasick.*",
|
"ahocorasick.*",
|
||||||
"aioapns.*",
|
"aioapns.*",
|
||||||
"backoff.*",
|
|
||||||
"bitfield.*",
|
"bitfield.*",
|
||||||
"bmemcached.*",
|
"bmemcached.*",
|
||||||
"boto3.*",
|
"boto3.*",
|
||||||
|
|
|
@ -80,6 +80,9 @@ backoff==1.10.0 \
|
||||||
--hash=sha256:5e73e2cbe780e1915a204799dba0a01896f45f4385e636bcca7a0614d879d0cd \
|
--hash=sha256:5e73e2cbe780e1915a204799dba0a01896f45f4385e636bcca7a0614d879d0cd \
|
||||||
--hash=sha256:b8fba021fac74055ac05eb7c7bfce4723aedde6cd0a504e5326bcb0bdd6d19a4
|
--hash=sha256:b8fba021fac74055ac05eb7c7bfce4723aedde6cd0a504e5326bcb0bdd6d19a4
|
||||||
# via -r requirements/common.in
|
# via -r requirements/common.in
|
||||||
|
backoff-stubs==1.10.0 \
|
||||||
|
--hash=sha256:03e995de0a70016c6fe758498e1ca811f1db517c00cbd06e3039c9e4f6ea2566
|
||||||
|
# via -r requirements/mypy.in
|
||||||
beautifulsoup4==4.9.3 \
|
beautifulsoup4==4.9.3 \
|
||||||
--hash=sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35 \
|
--hash=sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35 \
|
||||||
--hash=sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25 \
|
--hash=sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25 \
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
# See requirements/README.md for more detail.
|
# See requirements/README.md for more detail.
|
||||||
mypy
|
mypy
|
||||||
|
|
||||||
|
backoff-stubs
|
||||||
lxml-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
|
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
|
sqlalchemy-stubs
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
#
|
#
|
||||||
# For details, see requirements/README.md .
|
# For details, see requirements/README.md .
|
||||||
#
|
#
|
||||||
|
backoff-stubs==1.10.0 \
|
||||||
|
--hash=sha256:03e995de0a70016c6fe758498e1ca811f1db517c00cbd06e3039c9e4f6ea2566
|
||||||
|
# via -r requirements/mypy.in
|
||||||
lxml-stubs==0.2.0 \
|
lxml-stubs==0.2.0 \
|
||||||
--hash=sha256:78f1bfb31b1f2af9a5c9e9a602ab1b589a64a5a3cc444931a39cdfd02d6864b0 \
|
--hash=sha256:78f1bfb31b1f2af9a5c9e9a602ab1b589a64a5a3cc444931a39cdfd02d6864b0 \
|
||||||
--hash=sha256:f0b3621ec2a23bea4145f484490c8b27383ecb407b3f8b079199ad4a0af4180b
|
--hash=sha256:f0b3621ec2a23bea4145f484490c8b27383ecb407b3f8b079199ad4a0af4180b
|
||||||
|
|
|
@ -48,4 +48,4 @@ API_FEATURE_LEVEL = 92
|
||||||
# historical commits sharing the same major version, in which case a
|
# historical commits sharing the same major version, in which case a
|
||||||
# minor version bump suffices.
|
# minor version bump suffices.
|
||||||
|
|
||||||
PROVISION_VERSION = "153.12"
|
PROVISION_VERSION = "153.13"
|
||||||
|
|
|
@ -272,7 +272,12 @@ def send_email(
|
||||||
raise EmailNotDeliveredException
|
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:
|
def initialize_connection(connection: Optional[BaseEmailBackend] = None) -> BaseEmailBackend:
|
||||||
if not connection:
|
if not connection:
|
||||||
connection = get_connection()
|
connection = get_connection()
|
||||||
|
|
Loading…
Reference in New Issue