rework docs infrastructure

This commit is contained in:
Aran-Fey
2024-12-10 00:03:27 +01:00
parent 891d5bb715
commit fdce9be8f4
32 changed files with 388 additions and 446 deletions

View File

@@ -15,7 +15,7 @@ import rio.docs
ALIASES: dict[object, str] = {
obj: f"rio.{doc.name}"
for obj, doc in rio.docs.find_documented_objects().items()
for obj, doc in rio.docs.get_documented_objects().items()
}
ALIASES[pandas.DataFrame] = "pandas.DataFrame"
ALIASES[polars.DataFrame] = "polars.DataFrame"
@@ -27,7 +27,7 @@ def main():
with stub_file_path.open("w", encoding="utf8") as stub_file:
writer = StubWriter(stub_file)
for docs in rio.docs.find_documented_objects().values():
for docs in rio.docs.get_documented_objects().values():
writer.write(docs)
# Run the file through a linter to ensure its correctness
@@ -203,9 +203,9 @@ import rio
def _write_base_classes(self, docs: imy.docstrings.ClassDocs) -> None:
public_base_classes = [
rio.docs.find_documented_objects()[cls]
rio.docs.get_documented_objects()[cls]
for cls in docs.object.__bases__
if cls in rio.docs.find_documented_objects()
if cls in rio.docs.get_documented_objects()
]
if not public_base_classes: