-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: mkdocstrings filters option doesn't work anymore after upgrade to griffe 0.46.0 #294
Comments
Thanks for the fast report. Looking into it right now. |
OK, found the issue. In the Python handler templates, we first filter objects according to the The issue is that previously, we would tweak the I think the easiest and most correct way to fix this is to update Griffe's "public" logic to consider dunder attributes and methods to be public, because even if we don't access them directly, we still use them publicly through different syntax or means. I'll do just that! |
OK, v0.46.1 is on PyPI, let me know if you still encounter issues! |
WORKSFORME ❤️ |
does not work for me, 0.46.1 only fixed #295 |
Ah, right, I read it as "special" instead of protected, my bad. Essentially I think the Python handler should stop doing this second filtering pass. But that would be a breaking change, so I'll simply change it to filter out imported objects, not private/protected ones. |
… after applying filters Issue-mkdocstrings/griffe-294: mkdocstrings/griffe#294
@vulli321 could you try latest mkdocstrings-python (1.10.4) and tell me if this issue is fixed? |
Upgrade to mkdocstrings-python (1.10.4) fixed our issue. Thanks! |
can confirm, fixed now 👍 |
Thanks @kkpattern, @vulli321! Closing :) |
Whoops, it seems like this issue doesn't want to go away. The new release broke my use case again 😬 |
@pawamoy Not sure what the problem is now, but with griffe 0.47 I'm getting these errors:
While 0.45.3 and 0.46.1 work fine. Instructions to reproduce are the same as in #295. |
Sorry for the trouble, let me look into it 👍 |
@llucax what version of mkdocstrings-python do you have? |
OK, keeping only public objects was wrong, filtering out imported objects is wrong, the solution is to filter out imported objects unless they are public 🥵 Sorry for the confusion, the template logic is sometimes hard to get right. I'll prioritize the end-to-end tests PR next: mkdocstrings/python#157. |
Released v1.8.5, it should behave correctly now. |
Yup, it is working again now. Thanks a lot for the super fast responses and fixes! 🎉 |
Thanks for testing new releases super early and sending bug reports 😄 |
Description of the bug
I don't know it's a griffe bug or the mkdocstrings's bug. After upgrade to griffe 0.46.0, the filters option doesn't work anymore. We have the filters option set to a empty list. After upgrade to griffe 0.46.0, the protected methods are no longer collected. Revert back to 0.45.3 fixed the issue.
To Reproduce
With the following setting:
Protected methods are no longer collected.
Expected behavior
Projected methods can be collected.
Environment information
griffe --debug-info # | xclip -selection clipboard
- __System__: Linux-4.19.0-10-amd64-x86_64-with-glibc2.31 - __Python__: cpython 3.11.3 (/tmp/.venv/bin/python3) - __Environment variables__: - __Installed packages__: - `griffe` v0.46.0
Additional context
The text was updated successfully, but these errors were encountered: