Skip to content

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

This PR addresses the issue where stubgen silently skips directories named 'vendor', 'vendored', '_vendor', etc., even when they are legitimate user packages rather than vendored third-party code.

Changes

  • Added --include-vendored flag to allow generating stubs for vendored packages
  • Modified remove_blacklisted_modules() to print a warning message when skipping vendored modules (unless --quiet is specified)
  • Updated Options class to include the include_vendored parameter

Behavior

Before

Running stubgen a on a project with structure:

a/
  __init__.py
  vendor/
    __init__.py

Would silently skip the vendor directory with no indication to the user.

After

Running stubgen a will now print:

Skipping vendored module: a.vendor

To generate stubs for the vendor directory, users can use:

stubgen --include-vendored a

Or suppress the warning with:

stubgen -q a

Test Plan

  1. Create test directory structure with a 'vendor' package
  2. Run stubgen without flags - verify warning is printed and vendor is skipped
  3. Run stubgen --include-vendored - verify vendor stubs are generated
  4. Run stubgen -q - verify no warning is printed

Fixes #9599

This change addresses the issue where stubgen silently skips directories
named 'vendor', 'vendored', '_vendor', etc., even when they are legitimate
user packages rather than vendored third-party code.

Changes:
- Added --include-vendored flag to allow generating stubs for vendored packages
- Modified remove_blacklisted_modules() to print a warning message when
  skipping vendored modules (unless --quiet is specified)
- Updated Options class to include the include_vendored parameter

Now users who have legitimate packages named 'vendor' can:
1. Use --include-vendored flag to generate stubs for them
2. See a clear warning message when modules are being skipped

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stubgen skips "vendor" directory

1 participant