Skip to content

Follow imports still true even when mypy.ini ignores imports #17271

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
Ryang20718 opened this issue May 20, 2024 · 1 comment
Closed

Follow imports still true even when mypy.ini ignores imports #17271

Ryang20718 opened this issue May 20, 2024 · 1 comment
Labels
bug mypy got something wrong

Comments

@Ryang20718
Copy link

Bug Report

Mypy follows imports when typechecking even when disabled in mypy.ini

To Reproduce

git clone https://github.com/Ryang20718/mypy-repro
cd mypy-repro
python3 -m venv .venv
pip install -r requirements.txt
mypy --timing-stats=out.txt --no-incremental example/c.py

view output file and see time is spent on following numpy imports 

Expected Behavior

I'd expect numpy imports to not be followed?

Actual Behavior

based on the timing file, we see time spent on numpy

numpy 64081
numpy._pytesttester 320
numpy._typing._callable 5586
numpy.core 127
numpy.core._asarray 722
numpy.core._internal 710
numpy.core._type_aliases 428
numpy.core._ufunc_config 504
numpy.core.arrayprint 1504
numpy.core.defchararray 3521

Your Environment

@Ryang20718 Ryang20718 added the bug mypy got something wrong label May 20, 2024
@hauntsaninja
Copy link
Collaborator

numpy provides stubs, I think you need another option to make follow imports apply to stubs as well. See: #8545 (comment)

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