Issue
At $WORK, we found that mypy type checking didn't work with dramatiq, which surprised us because of the presence of the py.typed in the repo here.
Investigating, the setuptools config seems fine, and I'm not able to reproduce a build which omits this file using a modern version of setuptools or using pypa's build to run python -m build ..
What version of Dramatiq are you using?
1.14.0
What did you do?
Install dramatiq and mypy into a virtualenv, write a file which runs reveal_type(dramatiq.set_encoder), and run mypy on that file.
# foo.py
import dramatiq
reveal_type(dramatiq.set_encoder)
What did you expect would happen?
$ mypy foo.py
foo.py:3: note: Revealed type is "def (encoder: dramatiq.encoder.Encoder)"
What happened?
$ mypy foo.py
foo.py:3: note: Revealed type is "Any"
Fixing this
It's not clear how to submit a code change which could fix this because it's not clear what the publishing workflow for dramatiq is. I believe this can be handled with some codified workflow which uses python -m build. e.g. I've put this into tox in many of my projects as tox r -e build.
I'm happy to contribute a fix which adds some canonical build workflow, but don't know that it's necessary or desirable.
Issue
At
$WORK, we found thatmypytype checking didn't work withdramatiq, which surprised us because of the presence of thepy.typedin the repo here.Investigating, the setuptools config seems fine, and I'm not able to reproduce a build which omits this file using a modern version of setuptools or using pypa's
buildto runpython -m build ..What version of Dramatiq are you using?
1.14.0
What did you do?
Install
dramatiqandmypyinto a virtualenv, write a file which runsreveal_type(dramatiq.set_encoder), and runmypyon that file.What did you expect would happen?
What happened?
Fixing this
It's not clear how to submit a code change which could fix this because it's not clear what the publishing workflow for
dramatiqis. I believe this can be handled with some codified workflow which usespython -m build. e.g. I've put this intotoxin many of my projects astox r -e build.I'm happy to contribute a fix which adds some canonical build workflow, but don't know that it's necessary or desirable.