Skip to content

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

Closed
@Ryang20718

Description

@Ryang20718

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

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