Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abulgher opened this issue Jan 18, 2025 · 1 comment
Labels
bug mypy got something wrong

Comments

@abulgher
Copy link

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",
]

@abulgher abulgher added the bug mypy got something wrong label Jan 18, 2025
@hauntsaninja
Copy link
Collaborator

Fixed in #18366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants