Closed AlexWaygood closed 1 year ago
Sounds good to me. https://github.com/jazzband/dj-database-url/pull/215 implements this, and explicitly tests the mypy test case works. @mattseymour?
Fixed as of release 2.0.0
Thanks @palfrey and @mattseymour! Can confirm that the py.typed
file is now included in the PyPI release, which led to our typeshed automation successfully being triggered: https://github.com/python/typeshed/pull/10094
Hi!
I'm a maintainer over at typeshed, where we have stubs for
dj-database-url
. It looks like you recently added inline types and apy.typed
file, which is great! This means that we can hopefully soon remove our stubs from typeshed.Unfortunately, your
py.typed
file isn't properly exposing your inline types to users of the package. If I installdj-database-url==1.3.0
and run mypy on a file containing just this:Then this is the output from mypy:
The reason for this is that
dj-database-url
is currently a single-file project. Unfortunately, PEP 561 doesn't provide a way for single-file projects to add apy.typed
file to their project. In order for thepy.typed
file to be recognised by type checkers, you'd need to convert this project into a package (with thepy.typed
file inside the package). If you did that (and specifiedpackage_data
insetup.py
to ensure that the file was included in uploads to PyPI), then type checkers would see thepy.typed
file, and know to look for inline types indj-database-url
.Would you consider making
dj-database-url
into a package? Ifdj-database-url
remains a single-file project, then unfortunately thepy.typed
file you already have in this repo serves little purpose, and may as well be deleted :/Cc. @palfrey, who authored #198, and @XF-FW, who originally contributed the stubs to typeshed :)