Open frank101010 opened 2 years ago
@kernc: you might want to wait with the next review, I've discovered a problem regarding warnings being issued, which I've already resolved. But there are also cases where member types are not properly rendered as hyperlinks in html output. The latter problem is due to the usage of inspect.formatannotations()
, which does not format built-in container types like dict[str, int]
properly (works with typing.Dict[str. int]
, though); but I'm going to create a new pull request for this.
@kernc: I just pushed new changes which fix a problem nested classes being recognized as pdoc.External
instead of pdoc.Class
. This required adding the nested classes into pdoc.Module
's context. Unfortunately, this also breaks one unit test, namely ApiTest.test__all__
. Since I don't really understand how that test works, could you please have a look at it?
The test tries to ensure that only the identifiers in __all__
are exposed. Interestingly, I'm not sure where the value 'B.B.C'
comes from. I'd understand 'B.C'
since that's what's nested. :thinking:
https://github.com/pdoc3/pdoc/blob/2cce30a9b55eeeddc1ed826c8a2ada53777c3eea/pdoc/test/example_pkg/__init__.py#L111-L112
@frank101010 @kernc Is this good to go? I require this functionality and can work on the PR by reopening on my own fork if you don't have time.
Thanks, JP
Adds support for nested classes to pdoc3.
This is basically a newer version of angeloskath's commit 467350c12894e66d45151e274db79e2cb7df5906, https://github.com/pdoc3/pdoc/pull/176, but since I need support for nested classes, and the original merge request hasn't changed status since June 2020, I decided to apply most of angeloskath's changes into a branch derived from the most recent master.
(deleted section about unit test problems, which were resolved after running tests on an os supporting symbolic links)