Skip to content

Stubgen skips "vendor" directory #9599

Description

@ericstarr

Bug Report

Stubgen skips over a directory called vendor without any error message.

To Reproduce

Create a project with this structure

a
  __init__.py
  vendor
    __init__.py
  1. Run stubgen a

  2. All that gets generated is out/a/__init__.pyi

I would expect the output to include out/a/vendor/__init__.pyi

Running stubgen a/vendor also fails to generate out/a/vendor/__init__.pyi, but cd'ing into a and then running stubgen vendor creates a/out/vendor/__init__.pyi

Your Environment

  • Mypy version used: 0.790
  • Mypy command-line flags: Included in problem description
  • Mypy configuration options from mypy.ini (and other config files): Not sure where my config file is, but I haven't modified it.
  • Python version used: 3.7
  • Operating system and version: Debian DNU/Linux 9 (stretch)

Activity

  1. JelleZijlstra commented on Oct 15, 2020

    @JelleZijlstra
    Member

    stubgen always ignores modules with these names:

    BLACKLIST = [
        '/six.py\n',  # Likely vendored six; too dynamic for us to handle
        '/vendored/',  # Vendored packages
        '/vendor/',  # Vendored packages
        '/_vendor/',
        '/_vendored_packages/',
    ]  # type: Final
    

    I feel like it would be good to print a message like "ignoring module vendor" when we hit this codepath. We could also add a command-line option to stubgen to generate stubs for blacklisted modules too. Both of these should be pretty easy changes to mypy/stubgen.py; feel free to submit a PR.

  2. noob8boi commented on Nov 5, 2021

    @noob8boi
    Contributor

    Hello I will be creating a PR and I am very new to open source contribution so I am really sorry if my PR isnt helpful.

  3. SwagatSBhuyan commented on Nov 6, 2021

    @SwagatSBhuyan

    I would also like to try to solve this issue. I'll be updating with the changes soon. Thanks!

  4. added a commit that references this issue on Feb 8, 2026
    8328e46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions