Skip to content

mypy does not automatically install types-seaborn despite package being in typeshed #18485

Closed
@abulgher

Description

@abulgher

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

  1. Create a new virtual environment
  2. Install seaborn and mypy:
    pip install seaborn mypy
  3. Create a Python file that imports seaborn:
     import seaborn as sns
  4. 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",
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions