Skip to content

mypy crashes with arguments --ignore-missing-imports --follow-imports skip #2778

Closed

Description

@marcharper

mypy --ignore-missing-imports --follow-imports skip -m my_module

(py3) user@...$ mypy --ignore-missing-imports --follow-imports skip -m axelrod
Traceback (most recent call last):
  File "/home/user/anaconda2/envs/py3/bin/mypy", line 6, in <module>
    main(__file__)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/main.py", line 42, in main
    res = type_check_only(sources, bin_dir, options)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/main.py", line 87, in type_check_only
    options=options)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/build.py", line 183, in build
    dispatch(sources, manager)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/build.py", line 1526, in dispatch
    process_graph(graph, manager)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/build.py", line 1652, in process_graph
    sccs = sorted_components(graph)
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/build.py", line 1879, in sorted_components
    for ready in topsort(data):
  File "/home/user/anaconda2/envs/py3/lib/python3.5/site-packages/mypy/build.py", line 1988, in topsort
    for item in set.union(*data.values()) - set(data.keys()):
TypeError: descriptor 'union' of 'set' object needs an argument

Running the same command with individual files in the module works fine (no crash, type errors caught and reported as expected).

Activity

  1. JukkaL commented on Jan 31, 2017

    @JukkaL
    Collaborator

    I can reproduce this:

    $ touch b.py
    $ mypy --ignore-missing-imports --follow-imports skip -m b
    
  2. self-assigned this
    on Jan 31, 2017
  3. gvanrossum commented on Jan 31, 2017

    @gvanrossum
    Member

    Aha, the problem is that because of the --follow-imports=skip it doesn't want to load b so it ends with an entirely empty graph. The fix will have to involve ensuring that it does follow these kinds of "imports". Stay tuned.

  4. gvanrossum commented on Jan 31, 2017

    @gvanrossum
    Member

    I think I've got a fix, but I need to devise a test.

  5. gvanrossum commented on Feb 1, 2017

    @gvanrossum
    Member

    Closed by #2786.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions