Closed sh-at-cs closed 2 months ago
Hello--As of now, we cannot add this functionality since we still support Python 2.7 (which we will be dropping support for in the near future). I will close this ticket for now and re-open it to add it as a feature request once we officially drop 2.7 support.
If you ship the types as stub files, it won't affect Python 2.7 users whatsoever.
Reopening this feature request
Work has been completed on this issue.
Work has been completed on this issue.
Is your feature request related to a problem? Please describe.
As far as I'm aware, the New Relic Python package (I hope this is the right repository?) doesn't currently have any type hints and naturally also no
py.typed
marker. As a consequence, when users try to typecheck code which imports it using static type checkers like Mypy or Pyright, they get errors like (this is for Mypy, it'll look similar for other checkers):Feature Description
It would be great if there were type hints (either inline or as separate stub files) for the parts of the New Relic Python package that constitute its public interface, so that users can typecheck the parts of their code that call New Relic explicitly.
Describe Alternatives
Users can currently work around the type checking errors themselves by adding
# type: ignore
comments for the imports, but that is not ideal, as static type checking is really useful and standard for modern Python.Additional context
Being able to type check calls into New Relic is especially important when breaking API changes are introduced - without types, there is no way to notice these unless your tests happen to catch them (which is not a given, considering instrumentation like New Relic's is not usually enabled for tests, let alone tested explicitly).
Priority
Really Want (IMHO)