Skip to content

mypy 0.990 shows no errors when passing source directory as absolute path #14042

@intgr

Description

@intgr

Bug Report

I noticed that after upgrading to 0.990, mypy in djangorestframework-stubs CI no longer finds any errors.

It seems this happens when the source folder is passed as a full path, instead of relative path. $PWD is the full path of the current working directory:

% mypy --config-file $PWD/mypy.ini --show-traceback --hide-error-context ./drf_source/tests |tail -n1
Found 569 errors in 48 files (checked 83 source files)
% mypy --config-file $PWD/mypy.ini --show-traceback --hide-error-context $PWD/drf_source/tests |tail -n1
Success: no issues found in 83 source files

Maybe, just maybe, this is related to #13768? EDIT: seems not to be, various --follow-imports= options have no effect.

To Reproduce

  1. Check out https://github.com/intgr/djangorestframework-stubs branch update-to-mypy-0.990
  2. Install dependencies from requirements.txt in a virtualenv
  3. Upgrade to mypy 0.990
  4. Run python scripts/typecheck_tests.py, which populates the drf_source directory
  5. Try running the commands above

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions