Merge pull request #5817 from jdufresne/inventory-typing

Define a common Inventory type for reuse across modules
This commit is contained in:
Takeshi KOMIYA 2018-12-17 20:53:12 +09:00 committed by GitHub
commit 1ef7b1a080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -32,7 +32,6 @@ from urllib.parse import urlsplit, urlunsplit
from docutils import nodes
from docutils.utils import relative_path
from six import text_type
import sphinx
from sphinx.builders.html import INVENTORY_FILENAME
@ -46,8 +45,7 @@ if False:
from sphinx.application import Sphinx # NOQA
from sphinx.config import Config # NOQA
from sphinx.environment import BuildEnvironment # NOQA
Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA
from sphinx.util.typing import Inventory # NOQA
logger = logging.getLogger(__name__)

View File

@ -11,8 +11,6 @@ import os
import re
import zlib
from six import text_type
from sphinx.util import logging
if False:
@ -20,8 +18,7 @@ if False:
from typing import Callable, Dict, IO, Iterator, Tuple # NOQA
from sphinx.builders import Builder # NOQA
from sphinx.environment import BuildEnvironment # NOQA
Inventory = Dict[text_type, Dict[text_type, Tuple[text_type, text_type, text_type, text_type]]] # NOQA
from sphinx.util.typing import Inventory # NOQA
BUFSIZE = 16 * 1024

View File

@ -27,3 +27,5 @@ RoleFunction = Callable[[text_type, text_type, text_type, int, Inliner, Dict, Li
# title getter functions for enumerable nodes (see sphinx.domains.std)
TitleGetter = Callable[[nodes.Node], text_type]
Inventory = Dict[str, Dict[str, Tuple[str, str, str, str]]]