diff --git a/my/hypothesis.py b/my/hypothesis.py index 257e739..55fff64 100644 --- a/my/hypothesis.py +++ b/my/hypothesis.py @@ -6,7 +6,7 @@ REQUIRES = [ ] from dataclasses import dataclass from pathlib import Path -from typing import Iterator, Sequence +from typing import Iterator, Sequence, TYPE_CHECKING from my.core import ( get_files, @@ -69,5 +69,7 @@ def stats() -> Stats: } -get_highlights = highlights # todo deprecate -get_pages = pages # todo deprecate +if not TYPE_CHECKING: + # "deprecate" by hiding from mypy + get_highlights = highlights + get_pages = pages diff --git a/my/pocket.py b/my/pocket.py index 2a7bdcb..b638fba 100644 --- a/my/pocket.py +++ b/my/pocket.py @@ -5,6 +5,7 @@ REQUIRES = [ 'git+https://github.com/karlicoss/pockexport', ] from dataclasses import dataclass +from typing import TYPE_CHECKING from .core import Paths @@ -61,5 +62,7 @@ def stats() -> Stats: # todo deprecate? -def get_articles() -> Sequence[Article]: - return list(articles()) +if not TYPE_CHECKING: + # "deprecate" by hiding from mypy + def get_articles() -> Sequence[Article]: + return list(articles()) diff --git a/my/polar.py b/my/polar.py index 0f2ee82..fe59d00 100644 --- a/my/polar.py +++ b/my/polar.py @@ -249,4 +249,6 @@ def get_entries() -> List[Result]: ## deprecated -Error = Exception # for backwards compat with Orger; can remove later +if not TYPE_CHECKING: + # "deprecate" by hiding from mypy + Error = Exception # for backwards compat with Orger; can remove later diff --git a/my/youtube/takeout.py b/my/youtube/takeout.py index a3a2dda..79b4549 100644 --- a/my/youtube/takeout.py +++ b/my/youtube/takeout.py @@ -1,4 +1,4 @@ -from typing import NamedTuple, List, Iterable +from typing import NamedTuple, List, Iterable, TYPE_CHECKING from ..core import datetime_aware, Res, LazyLogger from ..core.compat import removeprefix @@ -99,7 +99,9 @@ def stats() -> Stats: ### deprecated stuff (keep in my.media.youtube) -get_watched = watched +if not TYPE_CHECKING: + # "deprecate" by hiding from mypy + get_watched = watched def _watched_legacy() -> Iterable[Watched]: