Title: Errors depend on the existence of `.mypy_cache` · Issue #10906 · python/mypy · GitHub
Open Graph Title: Errors depend on the existence of `.mypy_cache` · Issue #10906 · python/mypy
X Title: Errors depend on the existence of `.mypy_cache` · Issue #10906 · python/mypy
Description: Bug Report Depending on the existence of the cache, mypy can produce different errors. To Reproduce This issue can be reproduced using the spacy library. docker run -it python:3.9-slim bash pip install spacy==3.1.1 mypy==0.910 Create a t...
Open Graph Description: Bug Report Depending on the existence of the cache, mypy can produce different errors. To Reproduce This issue can be reproduced using the spacy library. docker run -it python:3.9-slim bash pip ins...
X Description: Bug Report Depending on the existence of the cache, mypy can produce different errors. To Reproduce This issue can be reproduced using the spacy library. docker run -it python:3.9-slim bash pip ins...
Opengraph URL: https://github.com/python/mypy/issues/10906
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Errors depend on the existence of `.mypy_cache`","articleBody":"**Bug Report**\r\n\r\nDepending on the existence of the cache, mypy can produce different errors.\r\n\r\n**To Reproduce**\r\n\r\nThis issue can be reproduced using the `spacy` library.\r\n\r\n1. `docker run -it python:3.9-slim bash`\r\n2. `pip install spacy==3.1.1 mypy==0.910`\r\n3. Create a test file to check:\r\n```py\r\nimport spacy\r\n\r\nspacy.cli.download('en_core_web_sm')\r\n```\r\n4. Add `mypy` configs:\r\n```ini\r\n[mypy]\r\npython_version = 3.9\r\nstrict = True\r\nshow_error_codes = True\r\npretty = True\r\nwarn_unreachable = True\r\n```\r\n\r\n**Expected Behavior**\r\n\r\n\u003c!--\r\n How did you expect your project to behave?\r\n It’s fine if you’re not sure your understanding is correct.\r\n Write down what you thought would happen. If you just expected no errors, you can delete this section.\r\n-->\r\n\r\nOne would expect that mypy errors should not depend on the cache existence.\r\n\r\n**Actual Behavior**\r\n\r\n\u003c!--\r\n Did something go wrong?\r\n Is something broken, or not behaving as you expected?\r\n-->\r\n\r\nRun `mypy .`. This will produce the following report the first time:\r\n> test.py:3: error: Module not callable [operator]\r\n spacy.cli.download('en_core_web_sm')\r\n ^\r\nFound 1 error in 1 file (checked 1 source file)\r\n\r\nThe second time (when `.mypy_cache` exists) you'll get:\r\n> test.py:3: error: Module has no attribute \"cli\" [attr-defined]\r\n spacy.cli.download('en_core_web_sm')\r\n ^\r\nFound 1 error in 1 file (checked 1 source file)\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 0.910\r\n- Python version used: 3.9.6\r\n\r\n\u003c!--\r\nYou can freely edit this text, please remove all the lines\r\nyou believe are unnecessary.\r\n-->\r\n","author":{"url":"https://github.com/Vasniktel","@type":"Person","name":"Vasniktel"},"datePublished":"2021-08-01T19:27:45Z","url":"https://github.com/python/mypy/issues/10906"}
| 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:c3de80cd-3f0a-6b48-f652-8133f7600e7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AD0:1A1C04:1E8E3D3:299268B:6B001590 |
| html-safe-nonce | 275090ab3253d9070607c5a28c0b5a059e7634d3c08ea4bb3cc45b170e2b1f41 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUQwOjFBMUMwNDoxRThFM0QzOjI5OTI2OEI6NkIwMDE1OTAiLCJ2aXNpdG9yX2lkIjoiMjQyMjg0MTc0Njk2Nzc2MjMyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 487089146acd89a37b6eda7d4d8ed10794caec0382278737a149992fc6014727 |
| hovercard-subject-tag | issue:957567580 |
| 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/10906/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e484535f21838ccb2eeb653cd880e4f38e8d2cd7c3153d9b9342c1839554baea/python/mypy/issues/10906 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e484535f21838ccb2eeb653cd880e4f38e8d2cd7c3153d9b9342c1839554baea/python/mypy/issues/10906 |
| og:image:alt | Bug Report Depending on the existence of the cache, mypy can produce different errors. To Reproduce This issue can be reproduced using the spacy library. docker run -it python:3.9-slim bash pip ins... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Vasniktel |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width