stubgen builds stubs for private modules
Open
Nobody has claimed this yet.
bug
topic-stubgen
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
In a Python package consisting of only one file
foobar/_main.py
# _main.py
def f(x: int) -> int:
return x + 1
the function f can only be reached via a private path, namely _main.f. Still, when running
stubgen foobar/
the corresponding stub is created in
out/_main.pyi
without specifying --include-private.
This is with mypy 1.8.0 [Python 3.11.6].
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the shown foobar/_main.py package and the stubgen foobar/ command. Trace how stubgen handles private modules and compare the result with the --include-private option. Done means the private module is not emitted without that option, while the documented inclusion behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100