Skip to content

Commit

Permalink
fix: Don't import stuff from mkdocstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 3, 2024
1 parent e38664b commit 1108a3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/insiders/changelog.md
Expand Up @@ -2,6 +2,10 @@

## griffe2md Insiders

### 1.2.2 <small>September 06, 2023</small> { id="1.2.2" }

- Don't import stuff from mkdocstrings

### 1.2.1 <small>September 06, 2023</small> { id="1.2.1" }

- Bump required Griffe version to 0.36
Expand Down
8 changes: 2 additions & 6 deletions src/griffe2md/rendering.py
Expand Up @@ -23,14 +23,10 @@
)
from jinja2 import pass_context
from markupsafe import Markup
from mkdocstrings.loggers import get_logger

if TYPE_CHECKING:
from griffe.dataclasses import Alias, Attribute, Class, Function, Module, Object
from jinja2.runtime import Context
from mkdocstrings.handlers.base import CollectorItem

logger = get_logger(__name__)


class Order(enum.Enum):
Expand Down Expand Up @@ -100,14 +96,14 @@ def do_any(seq: Sequence, attribute: str | None = None) -> bool:
return any(_[attribute] for _ in seq)


def _sort_key_alphabetical(item: CollectorItem) -> Any:
def _sort_key_alphabetical(item: Object) -> Any:
# chr(sys.maxunicode) is a string that contains the final unicode
# character, so if 'name' isn't found on the object, the item will go to
# the end of the list.
return item.name or chr(sys.maxunicode)


def _sort_key_source(item: CollectorItem) -> Any:
def _sort_key_source(item: Object) -> Any:
# if 'lineno' is none, the item will go to the start of the list.
return item.lineno if item.lineno is not None else -1

Expand Down

0 comments on commit 1108a3f

Please sign in to comment.