Skip to content

Commit

Permalink
Fix warnings in sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 2, 2024
1 parent 3dcdc4c commit 99ef61a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@
('py:class', '_T'),
# Other workarounds
('py:class', 'importlib_metadata.DeprecatedNonAbstract'),
# importlib.metadata in stdlib does not have detailed API docs
('py:class', 'importlib.metadata.Distribution'),
('py:class', 'importlib.metadata.PackagePath'),
('py:class', 'importlib.metadata._meta.PackageMetadata'),
]
25 changes: 6 additions & 19 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,15 @@

from contextlib import suppress
from importlib import import_module
from importlib import metadata as _legacy
from importlib.abc import MetaPathFinder
from itertools import starmap
from typing import (
TYPE_CHECKING,
Any,
Iterable,
List,
Mapping,
Match,
Optional,
Set,
cast,
)


if TYPE_CHECKING:
from importlib import metadata as _legacy
from typing import Any, Iterable, List, Mapping, Match, Optional, Set, cast

if sys.version_info >= (3, 10):
from importlib.metadata import PackageMetadata as _legacy_Metadata
else:
from email.message import Message as _legacy_Metadata
if sys.version_info >= (3, 10):
from importlib.metadata import PackageMetadata as _legacy_Metadata
else:
from email.message import Message as _legacy_Metadata


__all__ = [
Expand Down

0 comments on commit 99ef61a

Please sign in to comment.