core.common: move stats-related stuff to my.core.stats and add more thorough tests/docs

deprecate core.common.stat and core.common.Stats with backwards compatibility
This commit is contained in:
Dima Gerasimov 2024-08-15 17:51:46 +03:00 committed by karlicoss
parent 18529257e7
commit c45c51af22
14 changed files with 343 additions and 246 deletions

View file

@ -18,9 +18,9 @@ from contextlib import ExitStack
import os
from typing import List, Sequence, cast
from pathlib import Path
from my.core import make_config, dataclass
from my.core import make_config, dataclass, stat, Stats
from my.core.cachew import mcachew
from my.core.common import Stats, LazyLogger, get_files, Paths
from my.core.common import LazyLogger, get_files, Paths
from my.core.error import ErrorPolicy
from my.core.structure import match_structure
@ -133,8 +133,6 @@ def events(disable_takeout_cache: bool = DISABLE_TAKEOUT_CACHE) -> CacheResults:
def stats() -> Stats:
from my.core import stat
return {
**stat(events),
}