-
Notifications
You must be signed in to change notification settings - Fork 705
Add type check to travis #31
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
Conversation
A potential way around this that I can see is using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly straightforward. The only thing that irks me is the #type: ignore
in the __init__.py
s. I wonder why mypy has problems with __path__
. A mypy bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I don't know that it's worth it to add the extra boilerplate, and it looks like
It sounds like we've got two options: either install the def start_span(self, name: str, parent: 'Span') -> typing.Iterator[Span]: to: def start_span(self, name: str, parent: 'Span') -> 'typing.Iterator[Span]': The second option seems like overkill and doesn't let us use e.g. |
Luckily this is fixed -- for now -- because of the package move. It does look like this is an open bug in mypy: python/mypy#1422. |
I added |
* Add initial span interface * Add object type attribute * return this and add optional endTime * Use any and add TODO * Update TraceState with examples and add TODO * specify traceId and spanId format * use unknown instead of any * Add TraceOptions and TraceState empty class * Add Link and Attributes interfaces * update index.ts * Change Link:attributes as optional property * Fix review comments
Piling onto #30, this PR adds type checks via
mypy
to travis for the API package.These are pretty strict defaults; I followed @Oberon00's approach in #24 and enabled every available option that wasn't already incompatible with our code. I had to omit
--disallow-any-expr
because ofcontextmanager
, but there may still be a way around this.See https://mypy.readthedocs.io/en/latest/config_file.html for details on these options.