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

Fix caching of PEP 561 namespace packages #13124

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #13085. Hopefully more robust than previous fixes along these lines.

hauntsaninja added 2 commits July 14, 2022 18:18
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

ignite (https://github.com/pytorch/ignite)
- ignite/contrib/engines/common.py:6: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ ignite/contrib/engines/common.py:10: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

poetry (https://github.com/python-poetry/poetry)
- src/poetry/config/config.py:13: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ src/poetry/config/config.py:14: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

arviz (https://github.com/arviz-devs/arviz)
+ arviz/plots/backends/matplotlib/traceplot.py:5: error: Cannot find implementation or library stub for module named "matplotlib"
- arviz/plots/backends/matplotlib/traceplot.py:6: error: Cannot find implementation or library stub for module named "matplotlib"
+ arviz/plots/backends/matplotlib/kdeplot.py:3: error: Cannot find implementation or library stub for module named "matplotlib"
- arviz/plots/backends/matplotlib/kdeplot.py:5: error: Cannot find implementation or library stub for module named "matplotlib"
+ arviz/plots/backends/matplotlib/elpdplot.py:4: error: Cannot find implementation or library stub for module named "matplotlib"
- arviz/plots/backends/matplotlib/elpdplot.py:5: error: Cannot find implementation or library stub for module named "matplotlib"
+ arviz/plots/backends/bokeh/khatplot.py:4: error: Cannot find implementation or library stub for module named "matplotlib"
- arviz/plots/backends/bokeh/khatplot.py:5: error: Cannot find implementation or library stub for module named "matplotlib"

vision (https://github.com/pytorch/vision)
- torchvision/__init__.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ torchvision/__init__.py:15: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

jax (https://github.com/google/jax)
- jax/_src/lib/__init__.py:38: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ jax/_src/lib/__init__.py:48: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/vendor/appdirs.py:533: error: Cannot find implementation or library stub for module named "com.sun"
- pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or library stub for module named "com.sun"
- pyinstrument/magic/magic.py:6: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ pyinstrument/magic/magic.py:7: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

bokeh (https://github.com/bokeh/bokeh)
- bokeh/core/serialization.py:49:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ bokeh/core/serialization.py:53:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

@hauntsaninja hauntsaninja marked this pull request as ready for review July 15, 2022 03:27
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! The logic at least looks more straightforward now, so hopefully it fixes the issue for good.

@JukkaL JukkaL merged commit c0b3530 into python:master Jul 20, 2022
@hauntsaninja hauntsaninja deleted the fixincr branch July 20, 2022 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache causes mypy to fail every 2nd run for module importing from google.cloud
2 participants