Skip to content

py.typed file is not present in built distributions on pypi #531

Description

@sirosen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions