Skip to content

bug: Wrong alias target path when inspecting class, causing stubs-merging to fail silently #296

Description

@tlambert03

Description of the bug

Hey @pawamoy. I'm back working on updating docs for one of my packages to work with the latest griffe. (I've been using a griffe fork for this specific package back since #115 and I'm trying to get off of it. This isn't exactly the same issue, but basically i'm still struggling to get griffe/mkdocstrings to find and inject the stubs provided in a pyi file. I just spent an hour or two trying to debug it, and i'm stumped. as best as I can tell, griffe does find all the members/methods, but mkdocs strings only shows 3 of them.

To Reproduce

mkdir example
cd example
python -m venv .venv
. .venv/bin/activate
pip install mkdocs-material mkdocstrings-python pymmcore
cat <<EOF > mkdocs.yml
site_name: My Docs
theme:
name: material
plugins:
- mkdocstrings:
handlers:
python:
options:
find_stubs_package: true
EOF
mkdir docs
echo "::: pymmcore.CMMCore" > docs/index.md
mkdocs serve

screenshot

This class has a ton of methods, all of which are documented in the stub file, but only a handful are found.

Screenshot 2024-06-22 at 7 02 11 PM

For what it's worth, the stubs i want it to find are at the top level __init__.pyi

➜ tree -L 3 .venv/lib/python3.12/site-packages/pymmcore
.venv/lib/python3.12/site-packages/pymmcore
├── __init__.py
├── __init__.pyi
├── _pymmcore_swig.cpython-312-darwin.so
├── _version.py
├── py.typed
├── pymmcore_swig.i
└── pymmcore_swig.py

(however, I have also tried moving them to other places including _pymmcore_swig.pyi, etc...
If you want to quickly see the stubs, they are here

Expected behavior

find all the methods

Environment information

➜ python -m mkdocstrings.debug
- __System__: macOS-14.5-arm64-arm-64bit
- __Python__: cpython 3.12.3 (/Users/talley/dev/self/example/.venv/bin/python)
- __Environment variables__:
- __Installed packages__:
- `mkdocstrings` v0.25.1

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions