From b2cf6467ad41119ce98c7aaae4032cb316680922 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 6 Sep 2023 10:09:17 +0200 Subject: [PATCH] pyi: remove workaround for missing variables in members this is fixed in pdoc 14 --- pdoc/doc_pyi.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pdoc/doc_pyi.py b/pdoc/doc_pyi.py index 2c8b10af..5d509ea8 100644 --- a/pdoc/doc_pyi.py +++ b/pdoc/doc_pyi.py @@ -73,13 +73,6 @@ def _patch_doc(target_doc: doc.Doc, stub_mod: doc.Module) -> None: elif isinstance(target_doc, doc.Variable) and isinstance(stub_doc, doc.Variable): target_doc.annotation = stub_doc.annotation elif isinstance(target_doc, doc.Namespace) and isinstance(stub_doc, doc.Namespace): - # pdoc currently does not include variables without docstring in .members (not ideal), - # so the regular patching won't work. We manually copy over type annotations instead. - for k, v in stub_doc._var_annotations.items(): - var = target_doc.members.get(k, None) - if isinstance(var, doc.Variable): - var.annotation = v - for m in target_doc.members.values(): _patch_doc(m, stub_mod) else: