Title: Restrictions on MYPYPATH · Issue #7604 · python/mypy · GitHub
Open Graph Title: Restrictions on MYPYPATH · Issue #7604 · python/mypy
X Title: Restrictions on MYPYPATH · Issue #7604 · python/mypy
Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Open Graph Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
X Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Opengraph URL: https://github.com/python/mypy
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Restrictions on MYPYPATH","articleBody":"Given that `PYTHONPATH` contains `.../pythonX.Y/site-packages`\r\nAnd a package that contains some private 3rd party stubs under `.../pythonX.Y/site-packages/foo/some_stubs`\r\n\r\nWhen setting `MYPYPATH` to `.../pythonX.Y/site-packages/foo/some_stubs`\r\n\r\nThen `mypy` gives the error `.../pythonX.Y/site-packages is in the MYPYPATH. Please remove it.`.\r\n\r\nThis is wrong because:\r\n\r\n1. `MYPYPATH` does *not* include `../pythonX.Y/site-packages`. It *does* include `.../pythonX.Y/site-packages/foo/some_stubs` but that is a very different directory.\r\n\r\n2. Due to this error `mypy` refuses to use the stubs listed in `MYPYPATH` in this case.\r\n\r\nThis probably isn't intentional? The relevant [PEP](https://www.python.org/dev/peps/pep-0561) explicitly allows for `MYPYPATH` and does not seem to mention any restriction on the location of stubs added via `MYPYPATH`.\r\n\r\nIt is possible to work around the problem by copying (or linking) the stubs to a directory which is *not* under `../pythonX.Y/site-packages`, say into `~/.foo-stubs` and adding this path to `MYPYPATH`.","author":{"url":"https://github.com/orenbenkiki","@type":"Person","name":"orenbenkiki"},"datePublished":"2019-10-02T15:46:16Z","url":"https://github.com/python/mypy/issues/7604"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:ad64903d-faf4-e6d9-56bc-14b4e3579029 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8A6:14B836:50A9C5:6C6C35:6B002FB6 |
| html-safe-nonce | e7f238027698353841d122b44e21f2ed36badbd605f83c2fb2bd138b14f10134 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEE2OjE0QjgzNjo1MEE5QzU6NkM2QzM1OjZCMDAyRkI2IiwidmlzaXRvcl9pZCI6IjcyMjE3NDYxMzI4NTcxMzkxMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d86fd0bb3f7ac8ac407b105ff01c6d7823eabbe0d096ed4669981559f5edea44 |
| hovercard-subject-tag | repository:7053637 |
| 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/python/mypy/issues/7604 |
| twitter:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| og:image:alt | Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-cache |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width