Title: Inconsistent results after 0.960 -> 0.971 migration · Issue #13422 · python/mypy · GitHub
Open Graph Title: Inconsistent results after 0.960 -> 0.971 migration · Issue #13422 · python/mypy
X Title: Inconsistent results after 0.960 -> 0.971 migration · Issue #13422 · python/mypy
Description: I am trying to migrate our huge code base from mypy 0.960 to 0.971, but odd things are happening. For example, our CI fails with: Run mypy --strict mypy_django_plugin mypy_django_plugin/django/context.py:61: error: Unused "type: ignore" ...
Open Graph Description: I am trying to migrate our huge code base from mypy 0.960 to 0.971, but odd things are happening. For example, our CI fails with: Run mypy --strict mypy_django_plugin mypy_django_plugin/django/cont...
X Description: I am trying to migrate our huge code base from mypy 0.960 to 0.971, but odd things are happening. For example, our CI fails with: Run mypy --strict mypy_django_plugin mypy_django_plugin/django/cont...
Opengraph URL: https://github.com/python/mypy/issues/13422
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent results after 0.960 -> 0.971 migration","articleBody":"I am trying to migrate our huge code base from mypy 0.960 to 0.971, but odd things are happening.\r\n\r\nFor example, our CI fails with:\r\n\r\n```\r\nRun mypy --strict mypy_django_plugin\r\nmypy_django_plugin/django/context.py:61: error: Unused \"type: ignore\" comment\r\nmypy_django_plugin/django/context.py:62: error: Unused \"type: ignore\" comment\r\nmypy_django_plugin/django/context.py:87: error: Untyped decorator makes function \"model_modules\" untyped\r\nmypy_django_plugin/django/context.py:113: error: Returning Any from function declared to return \"Optional[Type[Any]]\"\r\nmypy_django_plugin/django/context.py:233: error: Untyped decorator makes function \"all_registered_model_classes\" untyped\r\nmypy_django_plugin/django/context.py:245: error: Untyped decorator makes function \"all_registered_model_class_fullnames\" untyped\r\nmypy_django_plugin/django/context.py:251: error: Returning Any from function declared to return \"str\"\r\nmypy_django_plugin/django/context.py:255: error: Returning Any from function declared to return \"bool\"\r\nmypy_django_plugin/django/context.py:268: error: Returning Any from function declared to return \"bool\"\r\nmypy_django_plugin/django/context.py:325: error: Unused \"type: ignore\" comment\r\nmypy_django_plugin/django/context.py:335: error: Returning Any from function declared to return \"Optional[Type[Any]]\"\r\n```\r\n\r\nLink: https://github.com/typeddjango/django-stubs/runs/7838309248?check_suite_focus=true\r\n\r\nLocally it works as expected (python and mypy versions do match):\r\n\r\n```\r\n(.venv) ~/Documents/github/django-stubs fix-ci ✗ \r\n» python --version\r\nPython 3.9.9\r\n\r\n(.venv) ~/Documents/github/django-stubs fix-ci ✗ \r\n» mypy --version \r\nmypy 0.971 (compiled: yes)\r\n\r\n(.venv) ~/Documents/github/django-stubs fix-ci ✗ \r\n» mypy --strict mypy_django_plugin\r\nSuccess: no issues found in 20 source files\r\n```\r\n\r\nSince we have quite a complex structure, it might be something on our side.\r\nSo, what do we do?\r\n\r\nWe store all stubs for django in `django-stubs` folder.\r\nAt the same level we have `mypy_django_plugin` that does fancy stuff with ORM / etc.\r\nOur plugin imports a lot of things from django itself (settings, `.setup()`, etc). \r\n\r\nHere's the tricky part: 0.960 recognised these imports and their types.\r\nRight now my local setup with 0.971 does the same thing.\r\n\r\nBut, 0.971 in our CI does not see our stubs. So, all types are just `Any`s. This is unexpected!\r\n\r\nLink: https://github.com/typeddjango/django-stubs\r\nOriginal PR: https://github.com/typeddjango/django-stubs/pull/1108","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2022-08-15T13:28:28Z","url":"https://github.com/python/mypy/issues/13422"}
| 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:5060355f-8591-d553-fde5-99430c8fc061 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5FA:36D598:C7B08D:10A91F8:6B004E55 |
| html-safe-nonce | 4c77441d147519af7b5b0dcf4e5c10bfc2293cb6b502dbb3ae42a86a8818a34e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUZBOjM2RDU5ODpDN0IwOEQ6MTBBOTFGODo2QjAwNEU1NSIsInZpc2l0b3JfaWQiOiI2MTEyNDUyMzA0NzQ3NjQ2NTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1a9152fbb27051b2d785cf4bdd1edaa310e41572ee25dfedac9841fffac9ac14 |
| hovercard-subject-tag | issue:1339007658 |
| 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/13422/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8201b359502c3b21acfcbadbfb8abfe3ff4356d92c88ec455955d6177e2b7163/python/mypy/issues/13422 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8201b359502c3b21acfcbadbfb8abfe3ff4356d92c88ec455955d6177e2b7163/python/mypy/issues/13422 |
| og:image:alt | I am trying to migrate our huge code base from mypy 0.960 to 0.971, but odd things are happening. For example, our CI fails with: Run mypy --strict mypy_django_plugin mypy_django_plugin/django/cont... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width