-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update mypy #103
Update mypy #103
Conversation
This comment has been minimized.
This comment has been minimized.
2b8ead0
to
a6ae075
Compare
ad5c20a
to
55c7ec7
Compare
9611fdb
to
1d40ec6
Compare
The only fix needed is to change our Feed dataclass so that it doesn't abuse the InitVar mechanism. Instead we declare 'data' as an instance variable explicitly as part of __post_init__, which mypy does understand and correctly allows.
mypy is now aware of implicit namespace packaging, so we need to be more explicit about what layer constitutes a package.
1d40ec6
to
64c37bd
Compare
Current dependencies on/for this PR:
This comment was auto-generated by Graphite and will continue to be automatically updated while this PR remains open. |
tox.ini
Outdated
mypy -p routemaster --junit-xml build/results/typechecking.xml --exclude plugins | ||
mypy plugins/routemaster-prometheus/routemaster_prometheus --junit-xml build/results/typechecking-plugins-prometheus.xml | ||
mypy plugins/routemaster-sentry/routemaster_sentry --junit-xml build/results/typechecking-plugins-sentry.xml | ||
|
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.
There's also a statsd plugin now.
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.
@@ -1 +1,2 @@ | |||
mypy==v0.560 | |||
# 0.900 moves typeshed packages out, which we're not ready to switch to yet. |
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.
Can we not just install typeshed independently?
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.
Not the typeshed itself, no. This is about things like the types-dateutil
package which now need to be installed separately. This is very solvable, I just hadn't included them here. Since this is now reviewed I'll leave this as is, but will pick up a separate PR which does this.
The only fix needed is to change our
Feed
dataclass so that it doesn't abuse theInitVar
mechanism. Instead we declaredata
as an instance variable explicitly as part of__post_init__
, which mypy does understand and correctly allows.