Skip to content
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

Merged
merged 6 commits into from
Dec 6, 2021
Merged

Update mypy #103

merged 6 commits into from
Dec 6, 2021

Conversation

PeterJCLaw
Copy link
Contributor

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.

@coveralls

This comment has been minimized.

@PeterJCLaw PeterJCLaw removed the request for review from alexivanov July 24, 2021 17:16
@PeterJCLaw PeterJCLaw marked this pull request as draft July 24, 2021 17:16
@PeterJCLaw PeterJCLaw changed the base branch from master to improve-middleware-correctness July 24, 2021 17:19
Base automatically changed from improve-middleware-correctness to master September 22, 2021 15:55
@PeterJCLaw PeterJCLaw force-pushed the update-mypy branch 2 times, most recently from 9611fdb to 1d40ec6 Compare December 1, 2021 13:31
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.
@PeterJCLaw PeterJCLaw changed the base branch from master to update-yaml December 1, 2021 15:00
@PeterJCLaw
Copy link
Contributor Author

PeterJCLaw commented Dec 1, 2021

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
Comment on lines 43 to 46
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

Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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?

Copy link
Contributor Author

@PeterJCLaw PeterJCLaw Dec 6, 2021

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.

@PeterJCLaw PeterJCLaw merged commit c1ee655 into master Dec 6, 2021
@PeterJCLaw PeterJCLaw deleted the update-mypy branch December 6, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants