Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #12232 · python/mypy · GitHub
Open Graph Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #12232 · python/mypy
X Title: Cache causes mypy to fail every 2nd run for module importing from google.cloud · Issue #12232 · python/mypy
Description: Bug Report I 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. However, this bug ...
Open Graph Description: Bug Report I 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 v...
X Description: Bug Report I 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 v...
Opengraph URL: https://github.com/python/mypy/issues/12232
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":"**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. However, this bug affects the most recent mypy, 0.931. Since the reproducer of #9852 is fixed, I was asked to open a bug report here.\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\nrm -rf env\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 import datastore\r\nEOF\r\n\r\npython3 -m venv env\r\nsource env/bin/activate\r\npython3 -m pip install mypy==0.931 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-02-22T09:37:27Z","url":"https://github.com/python/mypy/issues/12232"}
| 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:e5bf0ada-8bb6-7c2a-deb7-66d3a2287c68 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B58A:1A3D7F:2FE3CE8:3F478E6:6B0023EC |
| html-safe-nonce | 7b2f4bd27d39ab7bdb0c948543ed88e5a688d2dc2f8369172559fa967a9c3f21 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNThBOjFBM0Q3RjoyRkUzQ0U4OjNGNDc4RTY6NkIwMDIzRUMiLCJ2aXNpdG9yX2lkIjoiNjg5ODMxODk3MjE2MTEwNjkyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a9e715b55a6f44bc718d2dc9ae64e7839d3a5fa46e272af36422de72c881ecd6 |
| hovercard-subject-tag | issue:1146669988 |
| 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/12232/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87723fc1af9b332b87c8597818b3ffab280361e3b873b04d1070077c14fcaad7/python/mypy/issues/12232 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87723fc1af9b332b87c8597818b3ffab280361e3b873b04d1070077c14fcaad7/python/mypy/issues/12232 |
| og:image:alt | Bug Report I 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 v... |
| 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