omdev 0.0.0.dev29__py3-none-any.whl → 0.0.0.dev30__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.
Potentially problematic release.
This version of omdev might be problematic. Click here for more details.
- 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/manifests.py +1 -1
- omdev/pyproject/cli.py +5 -1
- omdev/scripts/interp.py +20 -5
- omdev/scripts/pyproject.py +25 -6
- omdev/tools/piptools.py +24 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev30.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev30.dist-info}/RECORD +23 -21
- 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.dev30.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev30.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev29.dist-info → omdev-0.0.0.dev30.dist-info}/top_level.txt +0 -0
omdev/cache/data/__init__.py
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from .actions import ( # noqa
|
|
2
|
+
ExtractAction,
|
|
3
|
+
)
|
|
4
|
+
|
|
1
5
|
from .cache import ( # noqa
|
|
2
6
|
Cache,
|
|
3
7
|
)
|
|
@@ -8,12 +12,12 @@ from .defaults import ( # noqa
|
|
|
8
12
|
)
|
|
9
13
|
|
|
10
14
|
from .manifests import ( # noqa
|
|
11
|
-
|
|
15
|
+
Manifest,
|
|
12
16
|
)
|
|
13
17
|
|
|
14
18
|
from .specs import ( # noqa
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
Spec,
|
|
20
|
+
GitSpec,
|
|
21
|
+
GithubContentSpec,
|
|
22
|
+
UrlSpec,
|
|
19
23
|
)
|
omdev/cache/data/actions.py
CHANGED
|
@@ -6,6 +6,7 @@ TODO:
|
|
|
6
6
|
"""
|
|
7
7
|
import typing as ta
|
|
8
8
|
|
|
9
|
+
from omlish import check
|
|
9
10
|
from omlish import dataclasses as dc
|
|
10
11
|
from omlish import lang
|
|
11
12
|
from omlish import marshal as msh
|
|
@@ -24,9 +25,14 @@ class Action(lang.Abstract, lang.Sealed):
|
|
|
24
25
|
##
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
def _non_empty_strs(v: ta.Sequence[str]) -> ta.Sequence[str]:
|
|
29
|
+
return [check.non_empty_str(s) for s in ([v] if isinstance(v, str) else v)]
|
|
30
|
+
|
|
31
|
+
|
|
27
32
|
@dc.dataclass(frozen=True)
|
|
28
33
|
class ExtractAction(Action, lang.Final):
|
|
29
|
-
files: ta.Sequence[str]
|
|
34
|
+
files: ta.Sequence[str] = dc.xfield(coerce=_non_empty_strs)
|
|
35
|
+
keep_archive: bool = False
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
##
|
|
@@ -34,7 +40,7 @@ class ExtractAction(Action, lang.Final):
|
|
|
34
40
|
|
|
35
41
|
@lang.cached_function
|
|
36
42
|
def _install_standard_marshalling() -> None:
|
|
37
|
-
actions_poly = msh.polymorphism_from_subclasses(Action)
|
|
43
|
+
actions_poly = msh.polymorphism_from_subclasses(Action, naming=msh.Naming.SNAKE, strip_suffix=True)
|
|
38
44
|
msh.STANDARD_MARSHALER_FACTORIES[0:0] = [msh.PolymorphismMarshalerFactory(actions_poly)]
|
|
39
45
|
msh.STANDARD_UNMARSHALER_FACTORIES[0:0] = [msh.PolymorphismUnmarshalerFactory(actions_poly)]
|
|
40
46
|
|
omdev/cache/data/cache.py
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
TODO:
|
|
3
3
|
- mirrors
|
|
4
4
|
- huggingface_hub
|
|
5
|
+
- datasets
|
|
6
|
+
- verify md5 (action)
|
|
5
7
|
- stupid little progress bars
|
|
6
8
|
- groups of multiple files downloaded - 'spec set'? idk
|
|
7
9
|
- torchvision.datasets.FashionMNIST
|
|
10
|
+
- chaining? or is this compcache..
|
|
11
|
+
- download resume ala hf_hub
|
|
8
12
|
"""
|
|
9
13
|
import logging
|
|
10
14
|
import os.path
|
|
11
15
|
import shutil
|
|
16
|
+
import subprocess
|
|
12
17
|
import tempfile
|
|
13
18
|
import urllib.parse
|
|
14
19
|
import urllib.request
|
|
@@ -16,14 +21,17 @@ import urllib.request
|
|
|
16
21
|
from omlish import check
|
|
17
22
|
from omlish import lang
|
|
18
23
|
from omlish import marshal as msh
|
|
24
|
+
from omlish import os as osu
|
|
19
25
|
from omlish.formats import json
|
|
20
26
|
|
|
21
27
|
from ... import git
|
|
22
|
-
from .
|
|
23
|
-
from .
|
|
24
|
-
from .
|
|
25
|
-
from .specs import
|
|
26
|
-
from .specs import
|
|
28
|
+
from .actions import Action
|
|
29
|
+
from .actions import ExtractAction
|
|
30
|
+
from .manifests import Manifest
|
|
31
|
+
from .specs import GithubContentSpec
|
|
32
|
+
from .specs import GitSpec
|
|
33
|
+
from .specs import Spec
|
|
34
|
+
from .specs import UrlSpec
|
|
27
35
|
|
|
28
36
|
|
|
29
37
|
log = logging.getLogger(__name__)
|
|
@@ -39,18 +47,20 @@ class Cache:
|
|
|
39
47
|
|
|
40
48
|
self._items_dir = os.path.join(base_dir, 'items')
|
|
41
49
|
|
|
50
|
+
#
|
|
51
|
+
|
|
42
52
|
def _fetch_url(self, url: str, out_file: str) -> None:
|
|
43
53
|
log.info('Fetching url: %s -> %s', url, out_file)
|
|
44
54
|
|
|
45
55
|
urllib.request.urlretrieve(url, out_file) # noqa
|
|
46
56
|
|
|
47
|
-
def _fetch_into(self, spec:
|
|
57
|
+
def _fetch_into(self, spec: Spec, data_dir: str) -> None:
|
|
48
58
|
log.info('Fetching spec: %s %r -> %s', spec.digest, spec, data_dir)
|
|
49
59
|
|
|
50
|
-
if isinstance(spec,
|
|
60
|
+
if isinstance(spec, UrlSpec):
|
|
51
61
|
self._fetch_url(spec.url, os.path.join(data_dir, spec.file_name_or_default))
|
|
52
62
|
|
|
53
|
-
elif isinstance(spec,
|
|
63
|
+
elif isinstance(spec, GithubContentSpec):
|
|
54
64
|
for repo_file in spec.files:
|
|
55
65
|
out_file = os.path.join(data_dir, repo_file)
|
|
56
66
|
if not os.path.abspath(out_file).startswith(os.path.abspath(data_dir)):
|
|
@@ -60,7 +70,7 @@ class Cache:
|
|
|
60
70
|
os.makedirs(os.path.dirname(out_file), exist_ok=True)
|
|
61
71
|
self._fetch_url(url, os.path.join(data_dir, out_file))
|
|
62
72
|
|
|
63
|
-
elif isinstance(spec,
|
|
73
|
+
elif isinstance(spec, GitSpec):
|
|
64
74
|
if not spec.subtrees:
|
|
65
75
|
raise NotImplementedError
|
|
66
76
|
|
|
@@ -92,38 +102,52 @@ class Cache:
|
|
|
92
102
|
else:
|
|
93
103
|
raise TypeError(spec)
|
|
94
104
|
|
|
95
|
-
def
|
|
105
|
+
def _perform_action(self, action: Action, data_dir: str) -> None:
|
|
106
|
+
if isinstance(action, ExtractAction):
|
|
107
|
+
for f in action.files:
|
|
108
|
+
file = os.path.join(data_dir, f)
|
|
109
|
+
if not os.path.isfile(file):
|
|
110
|
+
raise Exception(f'Not file: {file}')
|
|
111
|
+
|
|
112
|
+
if file.endswith('.tar.gz'):
|
|
113
|
+
subprocess.check_call(['tar', 'xzf', file], cwd=data_dir)
|
|
114
|
+
|
|
115
|
+
elif file.endswith('.zip'):
|
|
116
|
+
subprocess.check_call(['unzip', file], cwd=data_dir)
|
|
117
|
+
|
|
118
|
+
else:
|
|
119
|
+
raise Exception(f'Unhandled archive extension: {file}')
|
|
120
|
+
|
|
121
|
+
if not action.keep_archive:
|
|
122
|
+
os.unlink(file)
|
|
123
|
+
|
|
124
|
+
else:
|
|
125
|
+
raise TypeError(action)
|
|
126
|
+
|
|
127
|
+
def _return_val(self, spec: Spec, data_dir: str) -> str:
|
|
96
128
|
check.state(os.path.isdir(data_dir))
|
|
97
129
|
|
|
98
|
-
if isinstance(
|
|
99
|
-
|
|
100
|
-
if not os.path.isfile(data_file):
|
|
101
|
-
raise RuntimeError(data_file) # noqa
|
|
102
|
-
return data_file
|
|
130
|
+
if any(isinstance(a, ExtractAction) for a in spec.actions):
|
|
131
|
+
return data_dir
|
|
103
132
|
|
|
104
|
-
|
|
133
|
+
single_file: str
|
|
134
|
+
if isinstance(spec, UrlSpec):
|
|
135
|
+
single_file = os.path.join(data_dir, spec.file_name_or_default)
|
|
136
|
+
|
|
137
|
+
elif isinstance(spec, GithubContentSpec):
|
|
105
138
|
if len(spec.files) != 1:
|
|
106
139
|
return data_dir
|
|
107
|
-
|
|
108
|
-
if not os.path.isfile(data_file):
|
|
109
|
-
raise RuntimeError(data_file) # noqa
|
|
110
|
-
return data_file
|
|
140
|
+
single_file = os.path.join(data_dir, check.single(spec.files))
|
|
111
141
|
|
|
112
142
|
else:
|
|
113
143
|
return data_dir
|
|
114
144
|
|
|
115
|
-
|
|
116
|
-
|
|
145
|
+
if not os.path.isfile(single_file):
|
|
146
|
+
raise RuntimeError(single_file) # noqa
|
|
117
147
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
item_dir = os.path.join(self._items_dir, spec.digest)
|
|
121
|
-
if os.path.isdir(item_dir):
|
|
122
|
-
data_dir = os.path.join(item_dir, 'data')
|
|
123
|
-
return self._return_val(spec, data_dir)
|
|
124
|
-
|
|
125
|
-
#
|
|
148
|
+
return single_file
|
|
126
149
|
|
|
150
|
+
def _fetch_item(self, spec: Spec, item_dir: str) -> None:
|
|
127
151
|
tmp_dir = tempfile.mkdtemp()
|
|
128
152
|
|
|
129
153
|
#
|
|
@@ -133,11 +157,13 @@ class Cache:
|
|
|
133
157
|
|
|
134
158
|
start_at = lang.utcnow()
|
|
135
159
|
self._fetch_into(spec, fetch_dir)
|
|
160
|
+
for action in spec.actions:
|
|
161
|
+
self._perform_action(action, fetch_dir)
|
|
136
162
|
end_at = lang.utcnow()
|
|
137
163
|
|
|
138
164
|
#
|
|
139
165
|
|
|
140
|
-
manifest =
|
|
166
|
+
manifest = Manifest(
|
|
141
167
|
spec,
|
|
142
168
|
start_at=start_at,
|
|
143
169
|
end_at=end_at,
|
|
@@ -159,5 +185,14 @@ class Cache:
|
|
|
159
185
|
|
|
160
186
|
shutil.move(tmp_dir, item_dir)
|
|
161
187
|
|
|
188
|
+
def get(self, spec: Spec) -> str:
|
|
189
|
+
os.makedirs(self._items_dir, exist_ok=True)
|
|
190
|
+
|
|
191
|
+
item_dir = os.path.join(self._items_dir, spec.digest)
|
|
192
|
+
if not os.path.isdir(item_dir):
|
|
193
|
+
self._fetch_item(spec, item_dir)
|
|
194
|
+
|
|
195
|
+
osu.touch(os.path.join(item_dir, 'accessed'))
|
|
196
|
+
|
|
162
197
|
data_dir = os.path.join(item_dir, 'data')
|
|
163
198
|
return self._return_val(spec, data_dir)
|
omdev/cache/data/manifests.py
CHANGED
|
@@ -6,7 +6,7 @@ from omlish import dataclasses as dc
|
|
|
6
6
|
|
|
7
7
|
from ...git import get_git_revision
|
|
8
8
|
from .consts import SERIALIZATION_VERSION
|
|
9
|
-
from .specs import
|
|
9
|
+
from .specs import Spec
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
##
|
|
@@ -24,8 +24,8 @@ def _lib_revision() -> str | None:
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
@dc.dataclass(frozen=True)
|
|
27
|
-
class
|
|
28
|
-
spec:
|
|
27
|
+
class Manifest:
|
|
28
|
+
spec: Spec
|
|
29
29
|
|
|
30
30
|
start_at: datetime.datetime = dc.field(kw_only=True)
|
|
31
31
|
end_at: datetime.datetime = dc.field(kw_only=True)
|
omdev/cache/data/specs.py
CHANGED
|
@@ -10,6 +10,7 @@ from omlish import lang
|
|
|
10
10
|
from omlish import marshal as msh
|
|
11
11
|
from omlish.formats import json
|
|
12
12
|
|
|
13
|
+
from .actions import Action
|
|
13
14
|
from .consts import SERIALIZATION_VERSION
|
|
14
15
|
|
|
15
16
|
|
|
@@ -17,12 +18,14 @@ from .consts import SERIALIZATION_VERSION
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
@dc.dataclass(frozen=True)
|
|
20
|
-
class
|
|
21
|
+
class Spec(lang.Abstract, lang.Sealed):
|
|
21
22
|
serialization_version: int = dc.field(default=SERIALIZATION_VERSION, kw_only=True)
|
|
22
23
|
|
|
24
|
+
actions: ta.Sequence[Action] = dc.field(default=(), kw_only=True)
|
|
25
|
+
|
|
23
26
|
@cached.property
|
|
24
27
|
def json(self) -> str:
|
|
25
|
-
return json.dumps_compact(msh.marshal(self,
|
|
28
|
+
return json.dumps_compact(msh.marshal(self, Spec), sort_keys=True)
|
|
26
29
|
|
|
27
30
|
@cached.property
|
|
28
31
|
def digest(self) -> str:
|
|
@@ -39,7 +42,7 @@ def _maybe_sorted_strs(v: ta.Iterable[str] | None) -> ta.Sequence[str] | None:
|
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
@dc.dataclass(frozen=True)
|
|
42
|
-
class
|
|
45
|
+
class GitSpec(Spec):
|
|
43
46
|
url: str
|
|
44
47
|
|
|
45
48
|
branch: str | None = dc.field(default=None, kw_only=True)
|
|
@@ -52,7 +55,7 @@ class GitCacheDataSpec(CacheDataSpec):
|
|
|
52
55
|
|
|
53
56
|
|
|
54
57
|
@dc.dataclass(frozen=True)
|
|
55
|
-
class
|
|
58
|
+
class UrlSpec(Spec):
|
|
56
59
|
url: str = dc.xfield(validate=lambda u: bool(urllib.parse.urlparse(u)))
|
|
57
60
|
file_name: str | None = None
|
|
58
61
|
|
|
@@ -74,7 +77,7 @@ def _repo_str(s: str) -> str:
|
|
|
74
77
|
|
|
75
78
|
|
|
76
79
|
@dc.dataclass(frozen=True)
|
|
77
|
-
class
|
|
80
|
+
class GithubContentSpec(Spec):
|
|
78
81
|
repo: str = dc.field(validate=_repo_str) # type: ignore
|
|
79
82
|
rev: str
|
|
80
83
|
files: lang.SequenceNotStr[str]
|
|
@@ -85,7 +88,7 @@ class GithubContentCacheDataSpec(CacheDataSpec):
|
|
|
85
88
|
|
|
86
89
|
@lang.cached_function
|
|
87
90
|
def _install_standard_marshalling() -> None:
|
|
88
|
-
specs_poly = msh.polymorphism_from_subclasses(
|
|
91
|
+
specs_poly = msh.polymorphism_from_subclasses(Spec, naming=msh.Naming.SNAKE, strip_suffix=True)
|
|
89
92
|
msh.STANDARD_MARSHALER_FACTORIES[0:0] = [msh.PolymorphismMarshalerFactory(specs_poly)]
|
|
90
93
|
msh.STANDARD_UNMARSHALER_FACTORIES[0:0] = [msh.PolymorphismUnmarshalerFactory(specs_poly)]
|
|
91
94
|
|
omdev/manifests.py
CHANGED
omdev/pyproject/cli.py
CHANGED
|
@@ -8,7 +8,6 @@ TODO:
|
|
|
8
8
|
- build / package / publish / version roll
|
|
9
9
|
- {pkg_name: [src_dirs]}, default excludes, generate MANIFST.in, ...
|
|
10
10
|
- env vars - PYTHONPATH
|
|
11
|
-
- optional uv backend
|
|
12
11
|
|
|
13
12
|
lookit:
|
|
14
13
|
- https://pdm-project.org/en/latest/
|
|
@@ -158,6 +157,11 @@ class Venv:
|
|
|
158
157
|
if (sr := self._cfg.requires):
|
|
159
158
|
rr = RequirementsRewriter(self._name)
|
|
160
159
|
reqs = [rr.rewrite(req) for req in sr]
|
|
160
|
+
|
|
161
|
+
# TODO: automatically try slower uv download when it fails? lol
|
|
162
|
+
# Caused by: Failed to download distribution due to network timeout. Try increasing UV_HTTP_TIMEOUT (current value: 30s). # noqa
|
|
163
|
+
# UV_CONCURRENT_DOWNLOADS=4 UV_HTTP_TIMEOUT=3600
|
|
164
|
+
|
|
161
165
|
subprocess_check_call(
|
|
162
166
|
ve,
|
|
163
167
|
'-m',
|
omdev/scripts/interp.py
CHANGED
|
@@ -13,6 +13,7 @@ TODO:
|
|
|
13
13
|
import abc
|
|
14
14
|
import argparse
|
|
15
15
|
import collections
|
|
16
|
+
import contextlib
|
|
16
17
|
import dataclasses as dc
|
|
17
18
|
import datetime
|
|
18
19
|
import functools
|
|
@@ -1352,6 +1353,24 @@ class StandardLogHandler(ProxyLogHandler):
|
|
|
1352
1353
|
##
|
|
1353
1354
|
|
|
1354
1355
|
|
|
1356
|
+
@contextlib.contextmanager
|
|
1357
|
+
def _locking_logging_module_lock() -> ta.Iterator[None]:
|
|
1358
|
+
if hasattr(logging, '_acquireLock'):
|
|
1359
|
+
logging._acquireLock() # noqa
|
|
1360
|
+
try:
|
|
1361
|
+
yield
|
|
1362
|
+
finally:
|
|
1363
|
+
logging._releaseLock() # type: ignore # noqa
|
|
1364
|
+
|
|
1365
|
+
elif hasattr(logging, '_lock'):
|
|
1366
|
+
# https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96
|
|
1367
|
+
with logging._lock: # noqa
|
|
1368
|
+
yield
|
|
1369
|
+
|
|
1370
|
+
else:
|
|
1371
|
+
raise Exception("Can't find lock in logging module")
|
|
1372
|
+
|
|
1373
|
+
|
|
1355
1374
|
def configure_standard_logging(
|
|
1356
1375
|
level: ta.Union[int, str] = logging.INFO,
|
|
1357
1376
|
*,
|
|
@@ -1359,8 +1378,7 @@ def configure_standard_logging(
|
|
|
1359
1378
|
target: ta.Optional[logging.Logger] = None,
|
|
1360
1379
|
force: bool = False,
|
|
1361
1380
|
) -> ta.Optional[StandardLogHandler]:
|
|
1362
|
-
|
|
1363
|
-
try:
|
|
1381
|
+
with _locking_logging_module_lock():
|
|
1364
1382
|
if target is None:
|
|
1365
1383
|
target = logging.root
|
|
1366
1384
|
|
|
@@ -1400,9 +1418,6 @@ def configure_standard_logging(
|
|
|
1400
1418
|
|
|
1401
1419
|
return StandardLogHandler(handler)
|
|
1402
1420
|
|
|
1403
|
-
finally:
|
|
1404
|
-
logging._releaseLock() # type: ignore # noqa
|
|
1405
|
-
|
|
1406
1421
|
|
|
1407
1422
|
########################################
|
|
1408
1423
|
# ../../../omlish/lite/runtime.py
|
omdev/scripts/pyproject.py
CHANGED
|
@@ -11,7 +11,6 @@ TODO:
|
|
|
11
11
|
- build / package / publish / version roll
|
|
12
12
|
- {pkg_name: [src_dirs]}, default excludes, generate MANIFST.in, ...
|
|
13
13
|
- env vars - PYTHONPATH
|
|
14
|
-
- optional uv backend
|
|
15
14
|
|
|
16
15
|
lookit:
|
|
17
16
|
- https://pdm-project.org/en/latest/
|
|
@@ -30,6 +29,7 @@ import base64
|
|
|
30
29
|
import collections
|
|
31
30
|
import collections.abc
|
|
32
31
|
import concurrent.futures as cf
|
|
32
|
+
import contextlib
|
|
33
33
|
import csv
|
|
34
34
|
import dataclasses as dc
|
|
35
35
|
import datetime
|
|
@@ -2800,6 +2800,24 @@ class StandardLogHandler(ProxyLogHandler):
|
|
|
2800
2800
|
##
|
|
2801
2801
|
|
|
2802
2802
|
|
|
2803
|
+
@contextlib.contextmanager
|
|
2804
|
+
def _locking_logging_module_lock() -> ta.Iterator[None]:
|
|
2805
|
+
if hasattr(logging, '_acquireLock'):
|
|
2806
|
+
logging._acquireLock() # noqa
|
|
2807
|
+
try:
|
|
2808
|
+
yield
|
|
2809
|
+
finally:
|
|
2810
|
+
logging._releaseLock() # type: ignore # noqa
|
|
2811
|
+
|
|
2812
|
+
elif hasattr(logging, '_lock'):
|
|
2813
|
+
# https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96
|
|
2814
|
+
with logging._lock: # noqa
|
|
2815
|
+
yield
|
|
2816
|
+
|
|
2817
|
+
else:
|
|
2818
|
+
raise Exception("Can't find lock in logging module")
|
|
2819
|
+
|
|
2820
|
+
|
|
2803
2821
|
def configure_standard_logging(
|
|
2804
2822
|
level: ta.Union[int, str] = logging.INFO,
|
|
2805
2823
|
*,
|
|
@@ -2807,8 +2825,7 @@ def configure_standard_logging(
|
|
|
2807
2825
|
target: ta.Optional[logging.Logger] = None,
|
|
2808
2826
|
force: bool = False,
|
|
2809
2827
|
) -> ta.Optional[StandardLogHandler]:
|
|
2810
|
-
|
|
2811
|
-
try:
|
|
2828
|
+
with _locking_logging_module_lock():
|
|
2812
2829
|
if target is None:
|
|
2813
2830
|
target = logging.root
|
|
2814
2831
|
|
|
@@ -2848,9 +2865,6 @@ def configure_standard_logging(
|
|
|
2848
2865
|
|
|
2849
2866
|
return StandardLogHandler(handler)
|
|
2850
2867
|
|
|
2851
|
-
finally:
|
|
2852
|
-
logging._releaseLock() # type: ignore # noqa
|
|
2853
|
-
|
|
2854
2868
|
|
|
2855
2869
|
########################################
|
|
2856
2870
|
# ../../../omlish/lite/marshal.py
|
|
@@ -4929,6 +4943,11 @@ class Venv:
|
|
|
4929
4943
|
if (sr := self._cfg.requires):
|
|
4930
4944
|
rr = RequirementsRewriter(self._name)
|
|
4931
4945
|
reqs = [rr.rewrite(req) for req in sr]
|
|
4946
|
+
|
|
4947
|
+
# TODO: automatically try slower uv download when it fails? lol
|
|
4948
|
+
# Caused by: Failed to download distribution due to network timeout. Try increasing UV_HTTP_TIMEOUT (current value: 30s). # noqa
|
|
4949
|
+
# UV_CONCURRENT_DOWNLOADS=4 UV_HTTP_TIMEOUT=3600
|
|
4950
|
+
|
|
4932
4951
|
subprocess_check_call(
|
|
4933
4952
|
ve,
|
|
4934
4953
|
'-m',
|
omdev/tools/piptools.py
CHANGED
|
@@ -21,6 +21,30 @@ class Cli(ap.Cli):
|
|
|
21
21
|
latest = check.not_none(doc.find('./channel/item/title')).text
|
|
22
22
|
print(latest)
|
|
23
23
|
|
|
24
|
+
@ap.command(
|
|
25
|
+
ap.arg('file'),
|
|
26
|
+
ap.arg('-w', '--write', action='store_true'),
|
|
27
|
+
ap.arg('-q', '--quiet', action='store_true'),
|
|
28
|
+
)
|
|
29
|
+
def filter_dev_deps(self) -> None:
|
|
30
|
+
with open(self.args.file) as f:
|
|
31
|
+
src = f.read()
|
|
32
|
+
|
|
33
|
+
out = []
|
|
34
|
+
for l in src.splitlines(keepends=True):
|
|
35
|
+
if l.startswith('-e'):
|
|
36
|
+
continue
|
|
37
|
+
out.append(l)
|
|
38
|
+
|
|
39
|
+
new_src = ''.join(out)
|
|
40
|
+
|
|
41
|
+
if not self.args.quiet:
|
|
42
|
+
print(new_src)
|
|
43
|
+
|
|
44
|
+
if self.args.write:
|
|
45
|
+
with open(self.args.file, 'w') as f:
|
|
46
|
+
f.write(new_src)
|
|
47
|
+
|
|
24
48
|
|
|
25
49
|
if __name__ == '__main__':
|
|
26
50
|
Cli()()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev30
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: ~=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omlish ==0.0.0.
|
|
15
|
+
Requires-Dist: omlish ==0.0.0.dev30
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser ~=2.22 ; extra == 'all'
|
|
18
18
|
Requires-Dist: cffi ~=1.17 ; extra == 'all'
|
|
@@ -7,7 +7,7 @@ omdev/cmake.py,sha256=Diy2ry65806dQP125DAstD3w46z_wszMH7PwC2-6iik,4578
|
|
|
7
7
|
omdev/findimports.py,sha256=P8v4I1tm6g-PEWJiNwAKxErvWwL-Nop83vAuwq1kR5A,2246
|
|
8
8
|
omdev/findmagic.py,sha256=DhBYHHP_dzwM5pIh21xnQPnkZ2YmAXCjithsr7X0ScU,2357
|
|
9
9
|
omdev/git.py,sha256=OzP4xHVboaa7GhS-mg4F3lYWf3HLa5aMm6V6PtIw_3U,2137
|
|
10
|
-
omdev/manifests.py,sha256=
|
|
10
|
+
omdev/manifests.py,sha256=jGqG3u8AQwaGUga449SA1-HwfWyEbrj2MCHQP5jqpO4,6580
|
|
11
11
|
omdev/revisions.py,sha256=U657hf4zeEN32y3g4CzqCAodx_HlfkHj2cIIKALNFDo,5009
|
|
12
12
|
omdev/tokens.py,sha256=GusxQ1Cd_eiScuR8XTTtc9QFhOgYviYGBZmFnn3Hj7s,756
|
|
13
13
|
omdev/wheelfile.py,sha256=yfupGcGkbFlmzGzKU64k_vmOKpaKnUlDWxeGn2KdekU,10005
|
|
@@ -15,19 +15,21 @@ omdev/amalg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
15
15
|
omdev/amalg/__main__.py,sha256=OE1udULO1g4McUbeg1CoHbSm4hbQ2kcE3ffEGxlnPh4,69
|
|
16
16
|
omdev/amalg/amalg.py,sha256=g7wwcPE2G9qmzh8M9eZAscOYWKo3ldI8bNxEXFnmzLE,14064
|
|
17
17
|
omdev/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
omdev/cache/
|
|
19
|
-
omdev/cache/
|
|
20
|
-
omdev/cache/
|
|
21
|
-
omdev/cache/
|
|
22
|
-
omdev/cache/
|
|
23
|
-
omdev/cache/
|
|
24
|
-
omdev/cache/
|
|
25
|
-
omdev/cache/
|
|
26
|
-
omdev/cache/data/
|
|
18
|
+
omdev/cache/compute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
omdev/cache/compute/cache.py,sha256=pEbcTSQavhX7M0olzR8AOCtHx7tMnMnEDEfTPQVY5uE,3602
|
|
20
|
+
omdev/cache/compute/contexts.py,sha256=OKOHOIj8JSEHmCKMY9G_zpKkLAkGuXcFXvzY5SXqCMA,3231
|
|
21
|
+
omdev/cache/compute/currents.py,sha256=D1Ls5Sd7FX2aPO5wpyEwTSmkz50sxkwCs37Amb0urH8,1425
|
|
22
|
+
omdev/cache/compute/fns.py,sha256=_1xU7qw1O57OsTp17RFjFTBO1M2t54RL-CGdl-0cTBk,4175
|
|
23
|
+
omdev/cache/compute/resolvers.py,sha256=9dq0mt__emp8CdNDWPVUr_dCkTOn7ar6nw0F2QH6XpQ,566
|
|
24
|
+
omdev/cache/compute/storage.py,sha256=woCUqHg8ZrwLEejRG3zu1L5ZXxGNNXveh3E8FnlEkjc,941
|
|
25
|
+
omdev/cache/compute/types.py,sha256=NpCTTJHDmpERjrbO6dh9TEzHuP6-vOuoX3ym9sA0ukc,2639
|
|
26
|
+
omdev/cache/data/__init__.py,sha256=SQXtugLceRif463rcoklpQ33pxYLgEIm0xiI6NvOI6M,301
|
|
27
|
+
omdev/cache/data/actions.py,sha256=TX6DPbOzQY6S2MSTPnsG53BQ61NNPWuLeCXa-MF-W2g,1109
|
|
28
|
+
omdev/cache/data/cache.py,sha256=WSsbFyFRT_IQFYQCrmUpaTvs9DRglLmCnhguOzdJ6p4,5753
|
|
27
29
|
omdev/cache/data/consts.py,sha256=d6W_aeMqgah6PmPYi9RA8Be54oQ4BcNCy8kDQ7FlB_Q,26
|
|
28
30
|
omdev/cache/data/defaults.py,sha256=HrapVUIf9Ozu3qSfRPyQj-vx-dz6Yyedjb-k3yV4CW8,277
|
|
29
|
-
omdev/cache/data/manifests.py,sha256=
|
|
30
|
-
omdev/cache/data/specs.py,sha256=
|
|
31
|
+
omdev/cache/data/manifests.py,sha256=CupK71fL3_PnDzUqjrWLNt64KfGKF-K4ycMkT5p0gPA,979
|
|
32
|
+
omdev/cache/data/specs.py,sha256=EB_JLIFe47ETCtAk8BD6oY6qhM7U_nOkILJfnLaVafI,2351
|
|
31
33
|
omdev/cexts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
34
|
omdev/cexts/_boilerplate.cc,sha256=aOWF_5C2pqnIrkT1ykEaL7N2pIpamW6pdXriRbd3lvs,1725
|
|
33
35
|
omdev/cexts/build.py,sha256=F3z1-CjDlEM-Gzi5IunKUBO52qdH_pMsFylobTdGJnI,2654
|
|
@@ -73,15 +75,15 @@ omdev/precheck/scripts.py,sha256=qq6MXkxgrYngPg5pWnXH4uRSuRkP3mFqbeml1UmvGBc,126
|
|
|
73
75
|
omdev/pyproject/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
74
76
|
omdev/pyproject/__main__.py,sha256=gFhR9DikwDZk0LqgdR3qq_aXQHThUOPllDmHDOfnFAU,67
|
|
75
77
|
omdev/pyproject/cexts.py,sha256=x13piOOnNrYbA17qZLDVuR0p1sqhgEwpk4FtImX-klM,4281
|
|
76
|
-
omdev/pyproject/cli.py,sha256=
|
|
78
|
+
omdev/pyproject/cli.py,sha256=UKheeQ8E1vZpR2My3ykelDxD_Mcu3O0zA1HqkkAH0cs,10911
|
|
77
79
|
omdev/pyproject/configs.py,sha256=K9H5cGwVLgHi8wKwtYvlXHZ9ThtmnI4jo8JAb-t1-70,2859
|
|
78
80
|
omdev/pyproject/pkg.py,sha256=GlZvDcLbo7HmiV2SgQnJdgAswr9IoJpy5gOeTRXG2RM,12576
|
|
79
81
|
omdev/pyproject/reqs.py,sha256=coq21cdWQIPs06-iuRnwc6F2Sf-IxpqoT6DEMhol2kA,2298
|
|
80
82
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
|
81
83
|
omdev/scripts/bumpversion.py,sha256=Kn7fo73Hs8uJh3Hi3EIyLOlzLPWAC6dwuD_lZ3cIzuY,1064
|
|
82
84
|
omdev/scripts/execrss.py,sha256=HzDNmwXOO8fMwIRXw9q8CUnVfLFCQASyU2tfY_y2Vf8,324
|
|
83
|
-
omdev/scripts/interp.py,sha256=
|
|
84
|
-
omdev/scripts/pyproject.py,sha256=
|
|
85
|
+
omdev/scripts/interp.py,sha256=cJ1iprqgMZONNTJeXQ3gvyp7-UQqKiRstdRw-jR3xFI,69254
|
|
86
|
+
omdev/scripts/pyproject.py,sha256=01U-hNp4NTU-OnNOYE8UK_2T_1Ai3-fbyOvOdCbzdsw,153367
|
|
85
87
|
omdev/toml/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
86
88
|
omdev/toml/parser.py,sha256=84bn09uhYHwQGyfww6Rw6y1RxPAE_HDltODOSakcqDM,29186
|
|
87
89
|
omdev/toml/writer.py,sha256=dwz_Qw8z5Z_nmWpXqch63W6S_j6n256erb7AGFTVzB4,2872
|
|
@@ -90,14 +92,14 @@ omdev/tools/dockertools.py,sha256=0RoUThTqv4ySJZX0aufYeQWD2bp-BMplQ8Y4WvDpguA,52
|
|
|
90
92
|
omdev/tools/gittools.py,sha256=zPy2D5WDs-CbwT86_T_hbaq5yCuss5e-ouUccXC6xlg,578
|
|
91
93
|
omdev/tools/importscan.py,sha256=XRLiasVSaTIp-jnO0-Nfhi0t6gnv_hVy5j2nVfEvuMI,3831
|
|
92
94
|
omdev/tools/importtrace.py,sha256=oDry9CwIv5h96wSaTVKJ0qQ5vMGxYE5oBtfF-GYNLJs,13430
|
|
93
|
-
omdev/tools/piptools.py,sha256=
|
|
95
|
+
omdev/tools/piptools.py,sha256=P2Nq8OzRuLxay1uQgqaWf3Iz6PFVhFKmVaBwxNbbzwU,1274
|
|
94
96
|
omdev/tools/rst.py,sha256=6dWk8QZHoGiLSuBw3TKsXZjjFK6wWBEtPi9krdCLKKg,977
|
|
95
97
|
omdev/tools/sqlrepl.py,sha256=v9uVQ4nvquSXcQVYIFq34ikumSILvKqzD6lUKLcncCE,5646
|
|
96
98
|
omdev/versioning/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
97
99
|
omdev/versioning/specifiers.py,sha256=6Odf9e6farwlPRsD_YqwTfYKG-BXn_dIcKtqfkhfodI,17432
|
|
98
100
|
omdev/versioning/versions.py,sha256=ei2eopEsJq3zSMJmezK1nzZgikgCdxFtnF3f69nCRZQ,12246
|
|
99
|
-
omdev-0.0.0.
|
|
100
|
-
omdev-0.0.0.
|
|
101
|
-
omdev-0.0.0.
|
|
102
|
-
omdev-0.0.0.
|
|
103
|
-
omdev-0.0.0.
|
|
101
|
+
omdev-0.0.0.dev30.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
|
102
|
+
omdev-0.0.0.dev30.dist-info/METADATA,sha256=D_vc3bQN6-PBXjlDMj_rVGwp8a_XeyCDGtcJVLihokw,1252
|
|
103
|
+
omdev-0.0.0.dev30.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
104
|
+
omdev-0.0.0.dev30.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
|
105
|
+
omdev-0.0.0.dev30.dist-info/RECORD,,
|