Skip to content

Commit

Permalink
add mypy to [dev] deps and run it during the lint phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Apr 28, 2024
1 parent 8d66de2 commit 99cf789
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dramatiq/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def send_with_options(
Message: The enqueued message.
"""
if isinstance(delay, timedelta):
delay = delay.total_seconds() * 1000
delay = int(delay.total_seconds() * 1000)

message = self.message_with_options(args=args, kwargs=kwargs, **options)
return self.broker.enqueue(message, delay=delay)
Expand Down
3 changes: 2 additions & 1 deletion dramatiq/middleware/current_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import contextvars
from typing import Optional

from .middleware import Middleware

Expand All @@ -37,7 +38,7 @@ class CurrentMessage(Middleware):
"""

_MESSAGE: contextvars.ContextVar[
dict
Optional[dict]
] = contextvars.ContextVar("_MESSAGE", default=None)

@classmethod
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def rel(*xs):
"flake8-bugbear",
"flake8-quotes",
"isort",
"mypy",

# Misc
"bumpversion",
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ deps =
flake8
flake8-bugbear
flake8-quotes
mypy
commands=
flake8 {toxinidir}/dramatiq {toxinidir}/examples {toxinidir}/tests
isort -c dramatiq
mypy dramatiq/ tests/

0 comments on commit 99cf789

Please sign in to comment.