Skip to content

Commit 835adad

Browse files
committed
docs(conf): Add sphinx-autodoc-typehints config, fix pathlib import
why: Improve documentation type hint handling and fix forward reference what: - Add always_document_param_types = True for consistent param docs - Move pathlib import outside TYPE_CHECKING block in pytest_plugin.py to make it available at doc build time
1 parent 35842c8 commit 835adad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
autodoc_class_signature = "separated"
119119
toc_object_entries_show_parents = "hide"
120120

121+
# sphinx-autodoc-typehints
122+
always_document_param_types = True
123+
121124
# sphinx-copybutton
122125
copybutton_prompt_text = (
123126
r">>> |\.\.\. |> |\$ |\# | In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "

src/libtmux/pytest_plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import getpass
88
import logging
99
import os
10+
import pathlib
1011
import typing as t
1112

1213
import pytest
@@ -17,8 +18,6 @@
1718
from libtmux.test.random import get_test_session_name, namer
1819

1920
if t.TYPE_CHECKING:
20-
import pathlib
21-
2221
from libtmux.session import Session
2322

2423
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)