omdev 0.0.0.dev29__py3-none-any.whl → 0.0.0.dev31__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omdev/cache/compute/cache.py +120 -0
- omdev/cache/compute/contexts.py +137 -0
- omdev/cache/compute/currents.py +78 -0
- omdev/cache/compute/fns.py +157 -0
- omdev/cache/compute/resolvers.py +23 -0
- omdev/cache/compute/storage.py +39 -0
- omdev/cache/compute/types.py +144 -0
- omdev/cache/data/__init__.py +9 -5
- omdev/cache/data/actions.py +8 -2
- omdev/cache/data/cache.py +66 -31
- omdev/cache/data/manifests.py +3 -3
- omdev/cache/data/specs.py +9 -6
- omdev/interp/pyenv.py +8 -1
- omdev/manifests.py +112 -18
- omdev/pyproject/cli.py +6 -2
- omdev/scripts/interp.py +28 -6
- omdev/scripts/pyproject.py +34 -8
- omdev/secrets.py +12 -0
- omdev/tools/piptools.py +24 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev31.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev31.dist-info}/RECORD +25 -22
- omdev/cache/comp/cache.py +0 -137
- omdev/cache/comp/contexts.py +0 -136
- omdev/cache/comp/fns.py +0 -115
- omdev/cache/comp/resolvers.py +0 -23
- omdev/cache/comp/types.py +0 -92
- /omdev/cache/{comp → compute}/__init__.py +0 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev31.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev31.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev31.dist-info}/top_level.txt +0 -0
omdev/cache/comp/types.py
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import abc
|
|
2
|
-
import typing as ta
|
|
3
|
-
|
|
4
|
-
from omlish import cached
|
|
5
|
-
from omlish import collections as col
|
|
6
|
-
from omlish import dataclasses as dc
|
|
7
|
-
from omlish import lang
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
T = ta.TypeVar('T')
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
CacheableNameT = ta.TypeVar('CacheableNameT', bound='CacheableName')
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class CacheableName(lang.Abstract):
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
CacheableVersion: ta.TypeAlias = ta.Hashable
|
|
27
|
-
CacheableVersionMap: ta.TypeAlias = col.frozendict['CacheableName', CacheableVersion]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def merge_version_maps(
|
|
31
|
-
*dcts: ta.Mapping[CacheableName, CacheableVersion],
|
|
32
|
-
) -> CacheableVersionMap:
|
|
33
|
-
out: dict[CacheableName, CacheableVersion] = {}
|
|
34
|
-
for dct in dcts:
|
|
35
|
-
for name, version in dct.items():
|
|
36
|
-
try:
|
|
37
|
-
ex = out[name]
|
|
38
|
-
except KeyError:
|
|
39
|
-
out[name] = version
|
|
40
|
-
else:
|
|
41
|
-
if ex != version:
|
|
42
|
-
raise Exception(f'Version mismatch: {ex} {version}')
|
|
43
|
-
return col.frozendict(out)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class Cacheable(lang.Abstract):
|
|
50
|
-
@property
|
|
51
|
-
@abc.abstractmethod
|
|
52
|
-
def name(self) -> CacheableName:
|
|
53
|
-
raise NotImplementedError
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
@abc.abstractmethod
|
|
57
|
-
def version(self) -> CacheableVersion:
|
|
58
|
-
raise NotImplementedError
|
|
59
|
-
|
|
60
|
-
@cached.property
|
|
61
|
-
def as_version_map(self) -> CacheableVersionMap:
|
|
62
|
-
return col.frozendict({self.name: self.version})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
##
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
@dc.dataclass(frozen=True)
|
|
69
|
-
@dc.extra_params(cache_hash=True)
|
|
70
|
-
class CacheKey(lang.Abstract, ta.Generic[CacheableNameT]):
|
|
71
|
-
name: CacheableNameT
|
|
72
|
-
|
|
73
|
-
@dc.validate
|
|
74
|
-
def _check_types(self) -> bool:
|
|
75
|
-
hash(self)
|
|
76
|
-
return isinstance(self.name, CacheableName)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@dc.dataclass(frozen=True)
|
|
80
|
-
class CacheResult(ta.Generic[T], lang.Final):
|
|
81
|
-
hit: bool
|
|
82
|
-
versions: CacheableVersionMap
|
|
83
|
-
value: T
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
class CacheableResolver(lang.Abstract):
|
|
90
|
-
@abc.abstractmethod
|
|
91
|
-
def resolve(self, name: CacheableName) -> Cacheable:
|
|
92
|
-
raise NotImplementedError
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|