You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Run stubgen a
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)
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.
Activity
JelleZijlstra commentedon Oct 15, 2020
stubgen always ignores modules with these names:
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.noob8boi commentedon Nov 5, 2021
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.
SwagatSBhuyan commentedon Nov 6, 2021
I would also like to try to solve this issue. I'll be updating with the changes soon. Thanks!
feat: stubgen warn some modules are ignored
Add --include-vendored flag and warning for skipped vendor modules