Description
Bug Report
Description
When running mypy on a project that uses seaborn, mypy automatically installs type stubs for other dependencies from typeshed, but does not install types-seaborn
. Manual installation of types-seaborn
resolves the typing errors, suggesting the stubs work correctly but there's an issue with the automatic installation process.
Environment
- mypy version: 1.14.0
- seaborn version: 0.13.2
- Python version: 3.12
- Operating Systems tested: Windows and Linux (same behavior on both)
Steps to Reproduce
- Create a new virtual environment
- Install seaborn and mypy:
pip install seaborn mypy
- Create a Python file that imports seaborn:
import seaborn as sns
- Run mypy with automatic stub installation:
mypy --install-types --non-interactive your_file.py
Expected Behavior
mypy should automatically install types-seaborn as it does for other packages with stubs in typeshed.
Actual Behavior
mypy does not install types-seaborn, leading to typing errors. Manual installation via pip install types-seaborn is required.
Additional Information
Confirmed that seaborn is present in typeshed with METADATA.toml for version 0.13.2
Confirmed seaborn does not include a py.typed file
Other dependencies' type stubs are installed automatically as expected
Manual installation of types-seaborn resolves all typing issues
Current Workaround
Adding types-seaborn explicitly to project dependencies:
[project.optional-dependencies]
dev = [
"mypy>=1.14.0",
"types-seaborn",
]