Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
# silently goes back to emitting unresolvable annotations.
from sphinx_autodoc_typehints._resolver import resolve_type_guarded_imports

# NB: this must precede ``import pcapkit``. ``pcapkit.utilities.logging`` reads
# ``PCAPKIT_SPHINX`` at *import* time to compute ``SPHINX_TYPE_CHECKING``, and
# importing ``pcapkit`` already pulls in the schema modules -- so setting it any
# later leaves every ``if SPHINX_TYPE_CHECKING:`` TypedDict undefined and autodoc
# cannot document them.
os.environ['PCAPKIT_SPHINX'] = '1'

import pcapkit

if TYPE_CHECKING:
from typing import Any, Dict, List, Optional
from sphinx.application import Sphinx

os.environ['PCAPKIT_SPHINX'] = '1'

logger = logging.getLogger('pcapkit-sphinx')
logger.setLevel(logging.INFO)

Expand Down
Loading