general: deprecate some old methods by hiding behind TYPE_CHECKING
This commit is contained in:
parent
79ce8e84ec
commit
d6786084ca
4 changed files with 17 additions and 8 deletions
|
@ -6,7 +6,7 @@ REQUIRES = [
|
||||||
]
|
]
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Iterator, Sequence
|
from typing import Iterator, Sequence, TYPE_CHECKING
|
||||||
|
|
||||||
from my.core import (
|
from my.core import (
|
||||||
get_files,
|
get_files,
|
||||||
|
@ -69,5 +69,7 @@ def stats() -> Stats:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get_highlights = highlights # todo deprecate
|
if not TYPE_CHECKING:
|
||||||
get_pages = pages # todo deprecate
|
# "deprecate" by hiding from mypy
|
||||||
|
get_highlights = highlights
|
||||||
|
get_pages = pages
|
||||||
|
|
|
@ -5,6 +5,7 @@ REQUIRES = [
|
||||||
'git+https://github.com/karlicoss/pockexport',
|
'git+https://github.com/karlicoss/pockexport',
|
||||||
]
|
]
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .core import Paths
|
from .core import Paths
|
||||||
|
|
||||||
|
@ -61,5 +62,7 @@ def stats() -> Stats:
|
||||||
|
|
||||||
|
|
||||||
# todo deprecate?
|
# todo deprecate?
|
||||||
|
if not TYPE_CHECKING:
|
||||||
|
# "deprecate" by hiding from mypy
|
||||||
def get_articles() -> Sequence[Article]:
|
def get_articles() -> Sequence[Article]:
|
||||||
return list(articles())
|
return list(articles())
|
||||||
|
|
|
@ -249,4 +249,6 @@ def get_entries() -> List[Result]:
|
||||||
|
|
||||||
|
|
||||||
## deprecated
|
## deprecated
|
||||||
|
if not TYPE_CHECKING:
|
||||||
|
# "deprecate" by hiding from mypy
|
||||||
Error = Exception # for backwards compat with Orger; can remove later
|
Error = Exception # for backwards compat with Orger; can remove later
|
||||||
|
|
|
@ -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 import datetime_aware, Res, LazyLogger
|
||||||
from ..core.compat import removeprefix
|
from ..core.compat import removeprefix
|
||||||
|
@ -99,6 +99,8 @@ def stats() -> Stats:
|
||||||
|
|
||||||
### deprecated stuff (keep in my.media.youtube)
|
### deprecated stuff (keep in my.media.youtube)
|
||||||
|
|
||||||
|
if not TYPE_CHECKING:
|
||||||
|
# "deprecate" by hiding from mypy
|
||||||
get_watched = watched
|
get_watched = watched
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue