core: cleanup deprecations, exclude from type checking and show runtime warnings

among affected things:

- core.common.assert_never
- core.common.cproperty
- core.common.isoparse
- core.common.mcachew
- core.common.the
- core.common.tzdatetime
- core.compat.sqlite_backup
This commit is contained in:
Dima Gerasimov 2024-08-12 16:46:21 +03:00
parent 8834001fe7
commit 918e8ee551
24 changed files with 118 additions and 103 deletions

View file

@ -19,8 +19,8 @@ import re
# pip3 install geopy
import geopy # type: ignore
from ..core.common import LazyLogger, mcachew
from ..core.cachew import cache_dir
from my.core.common import LazyLogger
from my.core.cachew import cache_dir, mcachew
from my.core.warnings import high

View file

@ -9,7 +9,8 @@ from typing import Iterator
from my.google.takeout.parser import events, _cachew_depends_on
from google_takeout_parser.models import Location as GoogleLocation
from my.core.common import mcachew, LazyLogger, Stats
from my.core.cachew import mcachew
from my.core.common import LazyLogger, stat, Stats
from .common import Location
logger = LazyLogger(__name__)
@ -33,6 +34,4 @@ def locations() -> Iterator[Location]:
def stats() -> Stats:
from my.core import stat
return {**stat(locations)}
return stat(locations)

View file

@ -13,7 +13,8 @@ from my.google.takeout.parser import events, _cachew_depends_on as _parser_cache
from google_takeout_parser.models import PlaceVisit as SemanticLocation
from my.core import dataclass, make_config
from my.core.common import mcachew, LazyLogger, Stats
from my.core.cachew import mcachew
from my.core.common import LazyLogger, Stats, stat
from my.core.error import Res
from .common import Location
@ -72,6 +73,4 @@ def locations() -> Iterator[Res[Location]]:
def stats() -> Stats:
from my.core import stat
return {**stat(locations)}
return stat(locations)

View file

@ -27,7 +27,8 @@ from gpxpy.gpx import GPXXMLSyntaxException
from more_itertools import unique_everseen
from my.core import Stats, LazyLogger
from my.core.common import get_files, mcachew
from my.core.cachew import mcachew
from my.core.common import get_files
from .common import Location