-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline types are not exposed to users #214
Comments
Sounds good to me. #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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 :)
The text was updated successfully, but these errors were encountered: