question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing py.typed declaration?

See original GitHub issue

mypy is complaining about not being able to find type annotations for httpx:

error: Cannot find module named 'httpx'

I’m somewhat new to using type annotations/static type checking in Python, but from the mypy documentation here it looks like there may be a missing declaration in setup.py?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

6reactions
tomchristiecommented, Oct 4, 2019

Related: It’s a bit of a gross hack that we need a py.typed file to indicate that we’re a well typed package. I don’t really dig it.

Is there anything productive that we could do to push for a nicer alternative to become adopted in whichever of Python/MyPy/PyPI this is relevant too? (Eg. A top-level __typed__ = True variable in packages? A setting in PyPI package info?)

2reactions
kylebebakcommented, Sep 25, 2019

Right on, thanks all!

@sethmlarson @florimondmanca This library is excellent btw

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running mypy and managing imports
Missing library stubs or py.typed marker# · To suppress a single missing import error, add a # type: ignore at the end of...
Read more >
PEP 655 – Marking individual TypedDict items as required or ...
Having to declare two different TypedDict types for this purpose is cumbersome. This PEP introduces two new type qualifiers, typing.Required and typing.
Read more >
Type Annotation in Python | Towards Data Science
Type annotations — also known as type signatures — are used to indicate the datatypes of variables and input/outputs of functions and methods....
Read more >
Understanding type annotation in Python - LogRocket Blog
In this extensive post with specific examples, learn how to use Python type annotation to your advantage using the mypy library.
Read more >
The Comprehensive Guide to mypy - Tushar's Blog
mypy --strict test.py test.py:1: error: Function is missing a ... BTW, since this function has no return statement, its return type is None ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found