Title: Option "install-types" breaks project version dependencies. · Issue #17852 · python/mypy · GitHub
Open Graph Title: Option "install-types" breaks project version dependencies. · Issue #17852 · python/mypy
X Title: Option "install-types" breaks project version dependencies. · Issue #17852 · python/mypy
Description: Bug Report When running mypy with the "install-types" option and the project includes pandas, the pandas-stubs package is installed into the project, causing the installation of the latest version of numpy (numpy 2.1.1). This breaks my p...
Open Graph Description: Bug Report When running mypy with the "install-types" option and the project includes pandas, the pandas-stubs package is installed into the project, causing the installation of the latest version ...
X Description: Bug Report When running mypy with the "install-types" option and the project includes pandas, the pandas-stubs package is installed into the project, causing the installation of the lates...
Opengraph URL: https://github.com/python/mypy/issues/17852
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Option \"install-types\" breaks project version dependencies.","articleBody":"**Bug Report**\r\n\r\nWhen running mypy with the \"install-types\" option and the project includes pandas, the pandas-stubs package is installed into the project, causing the installation of the latest version of numpy (numpy 2.1.1). This breaks my project's dependency on numpy version 1.21.6.\r\n\r\n**To Reproduce**\r\n\r\nI have provided the minimum environment to reproduce the issue.\r\n\r\n+ pyproject.toml\r\n```pyproject.toml\r\n[project]\r\nname = \"mypy-debug\"\r\nversion = \"0.1.0\"\r\ndependencies = [\r\n \"numpy==1.21.6\",\r\n \"pandas==1.4.4\",\r\n]\r\nrequires-python = \">=3.10, \u003c3.11\"\r\n\r\n[project.optional-dependencies]\r\ndev = [\r\n \"mypy>=1.11.2\",\r\n]\r\n```\r\n\r\n+ mypy.ini\r\n```mypy.ini\r\n[mypy]\r\nstrict_optional = True\r\ndisallow_any_generics = True\r\ndisallow_untyped_defs = True\r\ninstall_types = True\r\n\r\n[mypy.overrides]\r\nmodule = [\"scipy.*\", \"sklearn.*\"]\r\nignore_missing_imports = True\r\n```\r\n\r\n+ \\_\\_init__.py\r\n```__init__.py\r\nimport pandas as pd\r\n\r\n```\r\n\r\n+ Folder Structure\r\n```\r\n.\r\n├── src/\r\n│ └── mypy_debug/\r\n│ └── __ini__.py\r\n├── mypy.ini\r\n└── pyproject.toml\r\n```\r\n\r\n+ Environment\r\n + OS: Windows 11\r\n + Python: 3.10.11\r\n + Mypy\r\n ```\r\n > mypy -V\r\n mypy 1.11.2 (compiled: yes)\r\n ```\r\n\r\n\r\n+ Running Command\r\n```sh\r\n> pip install -e ./[dev]\r\n> mypy .\\src\\\r\nsrc\\mypy_debug\\__init__.py:1: error: Library stubs not installed for \"pandas\" [import-untyped]\r\nsrc\\mypy_debug\\__init__.py:1: note: Hint: \"python3 -m pip install pandas-stubs\"\r\nsrc\\mypy_debug\\__init__.py:1: note: (or run \"mypy --install-types\" to install all missing stub packages)\r\nsrc\\mypy_debug\\__init__.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\r\nFound 1 error in 1 file (checked 1 source file)\r\n\r\nInstalling missing stub packages:\r\nD:\\mypy_debug\\.venv\\Scripts\\python.exe -m pip install pandas-stubs\r\n\r\nCollecting pandas-stubs\r\n Using cached pandas_stubs-2.2.2.240909-py3-none-any.whl (157 kB)\r\nCollecting numpy>=1.23.5\r\n Using cached numpy-2.1.1-cp310-cp310-win_amd64.whl (12.9 MB)\r\nCollecting types-pytz>=2022.1.1\r\n Using cached types_pytz-2024.2.0.20240913-py3-none-any.whl (5.3 kB)\r\nInstalling collected packages: types-pytz, numpy, pandas-stubs\r\n Attempting uninstall: numpy\r\n Found existing installation: numpy 1.21.6\r\n Uninstalling numpy-1.21.6:\r\n Successfully uninstalled numpy-1.21.6\r\nERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\r\nmypy-debug 0.1.0 requires numpy==1.21.6, but you have numpy 2.1.1 which is incompatible.\r\nSuccessfully installed numpy-2.1.1 pandas-stubs-2.2.2.240909 types-pytz-2024.2.0.20240913\r\n\r\n[notice] A new release of pip is available: 23.0.1 -> 24.2\r\n[notice] To update, run: python.exe -m pip install --upgrade pip\r\n\r\nnote: Run mypy again for up-to-date results with installed types\r\n```\r\n\r\n**Expected Behavior**\r\n\r\nThe installation process should recognize the installed version of pandas and install the matching pandas-stubs package accordingly.\r\n\r\n**Actual Behavior**\r\n\r\nThe installation process installs the latest version of pandas-stubs, which forces an update of numpy and breaks the project's dependencies.\r\n","author":{"url":"https://github.com/kubotty","@type":"Person","name":"kubotty"},"datePublished":"2024-09-30T02:24:22Z","url":"https://github.com/python/mypy/issues/17852"}
| 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:001b1cb2-bb1c-4600-2856-2fac673f699c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C936:14B836:9CF913:D18516:6B004477 |
| html-safe-nonce | 1cc6cf2ba065cb7e335d351361d3028415b0e1c833e25ddda62fed931cc537be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTM2OjE0QjgzNjo5Q0Y5MTM6RDE4NTE2OjZCMDA0NDc3IiwidmlzaXRvcl9pZCI6IjkxOTIwOTI4MDExNTA1MDIwMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b41b8114f6fc1644b42cbe9a7c6fd79c408016d82d76698f11700ea0359520d6 |
| hovercard-subject-tag | issue:2555383789 |
| 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/17852/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9cc66a6f6c352bb36ace04d28143a8b0f144617f6db6a6023f37a7f4aaa10e2c/python/mypy/issues/17852 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9cc66a6f6c352bb36ace04d28143a8b0f144617f6db6a6023f37a7f4aaa10e2c/python/mypy/issues/17852 |
| og:image:alt | Bug Report When running mypy with the "install-types" option and the project includes pandas, the pandas-stubs package is installed into the project, causing the installation of the latest version ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kubotty |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width