Skip to content

stub packages not detected with only __init__.pyi #650

Closed

Description

@rbtcollins

I have:
stubs/
stubs/six/
stubs/six/init.pyi
stubs/six/moves.pyi

and I get errors from the real six.py

If I then
touch stubs/six/init.py

and repeat the mypy run, the stubs suddenly take effect.

Activity

  1. rockneurotiko commented on Apr 20, 2015

    @rockneurotiko
    Contributor

    Probably changing this line:

    https://github.com/JukkaL/mypy/blob/master/mypy/build.py#L886

    to something like:

    path = os.path.join(pathitem, os.sep.join(comp), '__init__{}'.format(extension)
    

    and changing the function "verify_module" (https://github.com/JukkaL/mypy/blob/master/mypy/build.py#L892) to accept init.pyi (maybe with a flag passed by optional parameter to not break other code).

    I think that with this two changes will work :)

  2. rbtcollins commented on Apr 20, 2015

    @rbtcollins
    MemberAuthor

    I'm confused. init.py would be different to __init__.pyi. Why should it be accepted?

  3. rbtcollins commented on Apr 20, 2015

    @rbtcollins
    MemberAuthor

    Ah, markdown forrmatting. now I understand :)

  4. JukkaL commented on Apr 29, 2015

    @JukkaL
    Collaborator

    This is a bug. Thanks for reporting it!

    @rockneurotiko Yup, those should do the trick. Can you send a PR?

  5. added a commit that references this issue on May 31, 2015
    b2b5f3c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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