Skip to content

The "include-docstrings" option doesn't work #16114

Description

@lmbelo

After cloning the latest Mypy version available on GitHub, I see the "include-docstrings" option available, but running stubgen on an extension module that provides docstrings results in no docstrings at all.

To Reproduce

git clone https://github.com/python/mypy.git
python -m build
python -m pip install mypy-1.7.0+dev-py3-none-any.whl
stubgen --include-docstrings -p myextmodule[.pyd]
python -m mypy.stubgen --include-docstrings -p myextmodule[.pyd]

Expected Behavior

The .pyi file generated from stubgen should contain docstrings declared in the extension module, for classes and functions.

Actual Behavior

There is no docstrings at all, but they exist in the extension module. I have confirmed using help(myextmodule).

Your Environment

python 3.11 for Windows x64
myextmodule installed onto site-packages

  • Mypy version used: 1.7.0+dev
  • Mypy command-line flags: --include-docstrings -p myextmodule
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: cp3.11

I know this is a new feature, but it seems not to work out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions