-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add typing stubs to pre-commit mypy run #3266
Conversation
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.
Lint (accidentally added via web editor)
additional_dependencies: [types-pytz==2022.4.0.0, | ||
types-ujson==5.5.0, | ||
types-python-dateutil==2.8.19, | ||
types-requests==2.28.11.2, | ||
types-attrs==19.1.0, | ||
types-PyYAML==6.0.12] |
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.
These are actually duplicates of values from requirements.in which is not great.
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.
I did notice types-attrs
does not seem to be in the requirements
file. I will try and see if adding it there is enough.
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 like we need to specify the additional_dependencies...
Integration report for "Lint"
|
Integration report for "Lint"
|
I can confirm using this config solves the errors on my machine |
This is a follow-up to https://mozilla.slack.com/archives/C01E8GDG80N/p1665434432654689
We've seen mypy pre-commit hook failing and complaining about missing library stubs for some of the dependencies. Per pre-commit mirror docs it runs in an isolated environment so it seems to be making sense.
The issue might be related to #3248.
Changes proposed here do fix the mypy hook run for me on Python 3.10.7. However since I don't understand why we're seeing these errors I am not entirely sure if the local environment (mine and @kik-kik ) isn't at fault here.
Checklist for reviewer:
<username>:<branch>
of the fork as parameter. The parameter will also show upin the logs of the
manual-trigger-required-for-fork
CI task together with more detailed instructions.For modifications to schemas in restricted namespaces (see
CODEOWNERS
):