Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #13085 · python/mypy · GitHub
Open Graph Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #13085 · python/mypy
X Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #13085 · python/mypy
Description: This is very similar to #12232. However, I had to modify the minimum working example, because mypy==0.961 fixed the other one. Bug Report I have a project that imports things from google.cloud, which is a namespace package as far as I kn...
Open Graph Description: This is very similar to #12232. However, I had to modify the minimum working example, because mypy==0.961 fixed the other one. Bug Report I have a project that imports things from google.cloud, whi...
X Description: This is very similar to #12232. However, I had to modify the minimum working example, because mypy==0.961 fixed the other one. Bug Report I have a project that imports things from google.cloud, whi...
Opengraph URL: https://github.com/python/mypy/issues/13085
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cache causes mypy to fail every 2nd run for module importing from google.cloud","articleBody":"This is very similar to #12232. However, I had to modify the minimum working example, because `mypy==0.961` fixed the other one.\r\n\r\n**Bug Report**\r\nI have a project that imports things from `google.cloud`, which is a namespace package as far as I know. In a certain, very specific configuration mypy fails on every second run. This is very similar to #9852 and an almost duplicate of #12232. However, this bug affects the most recent mypy, 0.961. Since the reproducer of #9852 and #12232 are fixed, I open a new bug report.\r\n\r\n**To Reproduce**\r\n\r\nThe following script does reproduce the problem on Debian Stable and inside the Docker image `python:latest`.\r\n\r\n```bash\r\n#!/usr/bin/env bash\r\n\r\nVENV=$(mktemp -d)\r\n\r\nrm -rf \"$VENV\"\r\n\r\n# The order of the imports matters. If one imports datastore first, the error\r\n# does not occur. Also, one must suppress the type error on the import of\r\n# `storage`, otherwise the error does not appear neither.\r\ncat \u003c\u003cEOF >script.py\r\nfrom google.cloud import storage # type: ignore[attr-defined]\r\nfrom google.cloud.exceptions import NotFound\r\nEOF\r\n\r\npython3 -m venv \"$VENV\"\r\nsource \"$VENV/bin/activate\"\r\npython3 -m pip install mypy==0.961 google-cloud-storage==2.0.0 google-cloud-datastore==2.4.0\r\n\r\nmypy script.py\r\nmypy script.py\r\nmypy script.py\r\nmypy script.py\r\n```\r\n\r\n**Expected Behavior**\r\nPass or fail every time. I am not sure what would be correct in this case.\r\n\r\n**Actual Behavior**\r\nMypy accepts and rejects the code every 2nd run.\r\n\r\n**Your Environment**\r\n\r\nDebian Stable and `python:latest`. The reproducing script should cover all relevant details.","author":{"url":"https://github.com/MaxG87","@type":"Person","name":"MaxG87"},"datePublished":"2022-07-07T13:30:05Z","url":"https://github.com/python/mypy/issues/13085"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9ee189e9-f6a3-cae7-8cfc-2d7a38bf88d0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C720:2C0A92:2F99A8D:3EC80E0:6B002582 |
| html-safe-nonce | 1097463f8783a07246270cf0c83184c7eb4a1ce186fd29907296f9cf2ffa23b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzIwOjJDMEE5MjoyRjk5QThEOjNFQzgwRTA6NkIwMDI1ODIiLCJ2aXNpdG9yX2lkIjoiMjYzMjI2NzE3NDExNDIzOTg3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | efc00bc8e63072c12a5ec70a171e5b4ff9e1a286e60985be8c392a257292fb9f |
| hovercard-subject-tag | issue:1297447061 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/13085/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bd56ccb6345a82cc681e3fd61a155422dcd754823c34b4a40ea4f96c9bacdb3/python/mypy/issues/13085 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bd56ccb6345a82cc681e3fd61a155422dcd754823c34b4a40ea4f96c9bacdb3/python/mypy/issues/13085 |
| og:image:alt | This is very similar to #12232. However, I had to modify the minimum working example, because mypy==0.961 fixed the other one. Bug Report I have a project that imports things from google.cloud, whi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaxG87 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width