From 80de0437974a0665e57ca84eb90a4cd87c9d1a58 Mon Sep 17 00:00:00 2001 From: tristanlatr Date: Fri, 13 Dec 2024 13:36:00 -0500 Subject: [PATCH] Remove unused imports --- pydoctor/epydoc/markup/_napoleon.py | 3 --- pydoctor/epydoc/markup/epytext.py | 2 +- pydoctor/epydoc/markup/plaintext.py | 5 +---- pydoctor/epydoc/markup/restructuredtext.py | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pydoctor/epydoc/markup/_napoleon.py b/pydoctor/epydoc/markup/_napoleon.py index 89d9638ed..d30758aaf 100644 --- a/pydoctor/epydoc/markup/_napoleon.py +++ b/pydoctor/epydoc/markup/_napoleon.py @@ -62,9 +62,6 @@ def _parse_docstring( errors: list[ParseError], docstring_cls: type[GoogleDocstring], ) -> ParsedDocstring: - # TODO: would be best to avoid this import - from pydoctor.model import Attribute - docstring_obj = docstring_cls( docstring, what=self.objclass, diff --git a/pydoctor/epydoc/markup/epytext.py b/pydoctor/epydoc/markup/epytext.py index 5bf37bcf3..414d8c75d 100644 --- a/pydoctor/epydoc/markup/epytext.py +++ b/pydoctor/epydoc/markup/epytext.py @@ -132,7 +132,7 @@ # 4. helpers # 5. testing -from typing import Any, Iterable, List, Optional, Sequence, Set, Union, cast, TYPE_CHECKING +from typing import Any, Iterable, List, Optional, Sequence, Set, Union, cast import re import unicodedata diff --git a/pydoctor/epydoc/markup/plaintext.py b/pydoctor/epydoc/markup/plaintext.py index 88067a1a9..8edef3135 100644 --- a/pydoctor/epydoc/markup/plaintext.py +++ b/pydoctor/epydoc/markup/plaintext.py @@ -12,7 +12,7 @@ __docformat__ = 'epytext en' -from typing import List, Optional, TYPE_CHECKING +from typing import List, Optional from docutils import nodes from twisted.web.template import Tag, tags @@ -21,9 +21,6 @@ from pydoctor.epydoc.docutils import set_node_attributes, new_document -if TYPE_CHECKING: - from pydoctor.model import Documentable - def parse_docstring(docstring: str, errors: List[ParseError]) -> ParsedDocstring: """ Parse the given docstring, which is formatted as plain text; and diff --git a/pydoctor/epydoc/markup/restructuredtext.py b/pydoctor/epydoc/markup/restructuredtext.py index c5b16b627..8e42a1924 100644 --- a/pydoctor/epydoc/markup/restructuredtext.py +++ b/pydoctor/epydoc/markup/restructuredtext.py @@ -45,7 +45,6 @@ from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Sequence, Set, cast if TYPE_CHECKING: from typing import TypeAlias - from pydoctor.model import Documentable import re from docutils import nodes