Skip to content

'AssertionError: Neither id, path nor source given' when run inside package #3552

Closed
@refi64

Description

@refi64

Simple reproduction:

ryan@DevPC-LX ~/langtest/mypy/multi/c $ touch __init__.py
ryan@DevPC-LX ~/langtest/mypy/multi/c $ touch a.py
ryan@DevPC-LX ~/langtest/mypy/multi/c $ echo 'from .a import *' > b.py
ryan@DevPC-LX ~/langtest/mypy/multi/c $ mypy b.py
Traceback (most recent call last):
  File "/home/ryan/stuff/anaconda/bin/mypy", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/media/ryan/stuff/mypy/scripts/mypy", line 6, in <module>
    main(__file__)
  File "/media/ryan/stuff/mypy/mypy/main.py", line 50, in main
    res = type_check_only(sources, bin_dir, options)
  File "/media/ryan/stuff/mypy/mypy/main.py", line 97, in type_check_only
    options=options)
  File "/media/ryan/stuff/mypy/mypy/build.py", line 191, in build
    graph = dispatch(sources, manager)
  File "/media/ryan/stuff/mypy/mypy/build.py", line 1697, in dispatch
    graph = load_graph(sources, manager)
  File "/media/ryan/stuff/mypy/mypy/build.py", line 1806, in load_graph
    ancestor_for=st)
  File "/media/ryan/stuff/mypy/mypy/build.py", line 1275, in __init__
    assert id or path or source is not None, "Neither id, path nor source given"
AssertionError: Neither id, path nor source given
ryan@DevPC-LX ~/langtest/mypy/multi/c $ 

This seems kinda bad to me...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions