omdev 0.0.0.dev103__py3-none-any.whl → 0.0.0.dev104__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/.manifests.json +1 -1
- omdev/scripts/execrss.py +11 -1
- omdev/scripts/exectime.py +11 -1
- omdev/scripts/pyproject.py +68 -27
- omdev/tools/git.py +36 -32
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/RECORD +11 -11
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev103.dist-info → omdev-0.0.0.dev104.dist-info}/top_level.txt +0 -0
omdev/.manifests.json
CHANGED
omdev/scripts/execrss.py
CHANGED
|
@@ -16,7 +16,17 @@ _CLI_MODULE = {'$omdev.cli.types.CliModule': {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def _main() -> None:
|
|
19
|
-
|
|
19
|
+
if len(sys.argv) == 2:
|
|
20
|
+
pre = None
|
|
21
|
+
[src] = sys.argv[1:]
|
|
22
|
+
elif len(sys.argv) == 3:
|
|
23
|
+
[pre, src] = sys.argv[1:]
|
|
24
|
+
else:
|
|
25
|
+
raise Exception('Invalid arguments')
|
|
26
|
+
|
|
27
|
+
if pre:
|
|
28
|
+
exec(pre)
|
|
29
|
+
|
|
20
30
|
start = _get_rss()
|
|
21
31
|
exec(src)
|
|
22
32
|
end = _get_rss()
|
omdev/scripts/exectime.py
CHANGED
|
@@ -12,7 +12,17 @@ _CLI_MODULE = {'$omdev.cli.types.CliModule': {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def _main() -> None:
|
|
15
|
-
|
|
15
|
+
if len(sys.argv) == 2:
|
|
16
|
+
pre = None
|
|
17
|
+
[src] = sys.argv[1:]
|
|
18
|
+
elif len(sys.argv) == 3:
|
|
19
|
+
[pre, src] = sys.argv[1:]
|
|
20
|
+
else:
|
|
21
|
+
raise Exception('Invalid arguments')
|
|
22
|
+
|
|
23
|
+
if pre:
|
|
24
|
+
exec(pre)
|
|
25
|
+
|
|
16
26
|
co = compile(src, '<string>', 'exec')
|
|
17
27
|
start = time.time_ns()
|
|
18
28
|
exec(co)
|
omdev/scripts/pyproject.py
CHANGED
|
@@ -3299,7 +3299,10 @@ class UuidObjMarshaler(ObjMarshaler):
|
|
|
3299
3299
|
return uuid.UUID(o)
|
|
3300
3300
|
|
|
3301
3301
|
|
|
3302
|
-
|
|
3302
|
+
##
|
|
3303
|
+
|
|
3304
|
+
|
|
3305
|
+
_DEFAULT_OBJ_MARSHALERS: ta.Dict[ta.Any, ObjMarshaler] = {
|
|
3303
3306
|
**{t: NopObjMarshaler() for t in (type(None),)},
|
|
3304
3307
|
**{t: CastObjMarshaler(t) for t in (int, float, str, bool)},
|
|
3305
3308
|
**{t: Base64ObjMarshaler(t) for t in (bytes, bytearray)},
|
|
@@ -3328,20 +3331,19 @@ _OBJ_MARSHALER_GENERIC_ITERABLE_TYPES: ta.Dict[ta.Any, type] = {
|
|
|
3328
3331
|
}
|
|
3329
3332
|
|
|
3330
3333
|
|
|
3331
|
-
def
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
def _make_obj_marshaler(ty: ta.Any) -> ObjMarshaler:
|
|
3334
|
+
def _make_obj_marshaler(
|
|
3335
|
+
ty: ta.Any,
|
|
3336
|
+
rec: ta.Callable[[ta.Any], ObjMarshaler],
|
|
3337
|
+
*,
|
|
3338
|
+
nonstrict_dataclasses: bool = False,
|
|
3339
|
+
) -> ObjMarshaler:
|
|
3338
3340
|
if isinstance(ty, type):
|
|
3339
3341
|
if abc.ABC in ty.__bases__:
|
|
3340
3342
|
impls = [ # type: ignore
|
|
3341
3343
|
PolymorphicObjMarshaler.Impl(
|
|
3342
3344
|
ity,
|
|
3343
3345
|
ity.__qualname__,
|
|
3344
|
-
|
|
3346
|
+
rec(ity),
|
|
3345
3347
|
)
|
|
3346
3348
|
for ity in deep_subclasses(ty)
|
|
3347
3349
|
if abc.ABC not in ity.__bases__
|
|
@@ -3357,7 +3359,8 @@ def _make_obj_marshaler(ty: ta.Any) -> ObjMarshaler:
|
|
|
3357
3359
|
if dc.is_dataclass(ty):
|
|
3358
3360
|
return DataclassObjMarshaler(
|
|
3359
3361
|
ty,
|
|
3360
|
-
{f.name:
|
|
3362
|
+
{f.name: rec(f.type) for f in dc.fields(ty)},
|
|
3363
|
+
nonstrict=nonstrict_dataclasses,
|
|
3361
3364
|
)
|
|
3362
3365
|
|
|
3363
3366
|
if is_generic_alias(ty):
|
|
@@ -3367,7 +3370,7 @@ def _make_obj_marshaler(ty: ta.Any) -> ObjMarshaler:
|
|
|
3367
3370
|
pass
|
|
3368
3371
|
else:
|
|
3369
3372
|
k, v = ta.get_args(ty)
|
|
3370
|
-
return MappingObjMarshaler(mt,
|
|
3373
|
+
return MappingObjMarshaler(mt, rec(k), rec(v))
|
|
3371
3374
|
|
|
3372
3375
|
try:
|
|
3373
3376
|
st = _OBJ_MARSHALER_GENERIC_ITERABLE_TYPES[ta.get_origin(ty)]
|
|
@@ -3375,33 +3378,71 @@ def _make_obj_marshaler(ty: ta.Any) -> ObjMarshaler:
|
|
|
3375
3378
|
pass
|
|
3376
3379
|
else:
|
|
3377
3380
|
[e] = ta.get_args(ty)
|
|
3378
|
-
return IterableObjMarshaler(st,
|
|
3381
|
+
return IterableObjMarshaler(st, rec(e))
|
|
3379
3382
|
|
|
3380
3383
|
if is_union_alias(ty):
|
|
3381
|
-
return OptionalObjMarshaler(
|
|
3384
|
+
return OptionalObjMarshaler(rec(get_optional_alias_arg(ty)))
|
|
3382
3385
|
|
|
3383
3386
|
raise TypeError(ty)
|
|
3384
3387
|
|
|
3385
3388
|
|
|
3386
|
-
|
|
3387
|
-
try:
|
|
3388
|
-
return _OBJ_MARSHALERS[ty]
|
|
3389
|
-
except KeyError:
|
|
3390
|
-
pass
|
|
3389
|
+
##
|
|
3391
3390
|
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3391
|
+
|
|
3392
|
+
_OBJ_MARSHALERS_LOCK = threading.RLock()
|
|
3393
|
+
|
|
3394
|
+
_OBJ_MARSHALERS: ta.Dict[ta.Any, ObjMarshaler] = dict(_DEFAULT_OBJ_MARSHALERS)
|
|
3395
|
+
|
|
3396
|
+
_OBJ_MARSHALER_PROXIES: ta.Dict[ta.Any, ProxyObjMarshaler] = {}
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
def register_opj_marshaler(ty: ta.Any, m: ObjMarshaler) -> None:
|
|
3400
|
+
with _OBJ_MARSHALERS_LOCK:
|
|
3401
|
+
if ty in _OBJ_MARSHALERS:
|
|
3402
|
+
raise KeyError(ty)
|
|
3401
3403
|
_OBJ_MARSHALERS[ty] = m
|
|
3404
|
+
|
|
3405
|
+
|
|
3406
|
+
def get_obj_marshaler(
|
|
3407
|
+
ty: ta.Any,
|
|
3408
|
+
*,
|
|
3409
|
+
no_cache: bool = False,
|
|
3410
|
+
**kwargs: ta.Any,
|
|
3411
|
+
) -> ObjMarshaler:
|
|
3412
|
+
with _OBJ_MARSHALERS_LOCK:
|
|
3413
|
+
if not no_cache:
|
|
3414
|
+
try:
|
|
3415
|
+
return _OBJ_MARSHALERS[ty]
|
|
3416
|
+
except KeyError:
|
|
3417
|
+
pass
|
|
3418
|
+
|
|
3419
|
+
try:
|
|
3420
|
+
return _OBJ_MARSHALER_PROXIES[ty]
|
|
3421
|
+
except KeyError:
|
|
3422
|
+
pass
|
|
3423
|
+
|
|
3424
|
+
rec = functools.partial(
|
|
3425
|
+
get_obj_marshaler,
|
|
3426
|
+
no_cache=no_cache,
|
|
3427
|
+
**kwargs,
|
|
3428
|
+
)
|
|
3429
|
+
|
|
3430
|
+
p = ProxyObjMarshaler()
|
|
3431
|
+
_OBJ_MARSHALER_PROXIES[ty] = p
|
|
3432
|
+
try:
|
|
3433
|
+
m = _make_obj_marshaler(ty, rec, **kwargs)
|
|
3434
|
+
finally:
|
|
3435
|
+
del _OBJ_MARSHALER_PROXIES[ty]
|
|
3436
|
+
p.m = m
|
|
3437
|
+
|
|
3438
|
+
if not no_cache:
|
|
3439
|
+
_OBJ_MARSHALERS[ty] = m
|
|
3402
3440
|
return m
|
|
3403
3441
|
|
|
3404
3442
|
|
|
3443
|
+
##
|
|
3444
|
+
|
|
3445
|
+
|
|
3405
3446
|
def marshal_obj(o: ta.Any, ty: ta.Any = None) -> ta.Any:
|
|
3406
3447
|
return get_obj_marshaler(ty if ty is not None else type(o)).marshal(o)
|
|
3407
3448
|
|
omdev/tools/git.py
CHANGED
|
@@ -61,38 +61,42 @@ class Cli(ap.Cli):
|
|
|
61
61
|
accepts_unknown=True,
|
|
62
62
|
)
|
|
63
63
|
def clone(self) -> None:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
# And expected usage is `cd $(om git clone foo/bar)` and an empty cd arg will return to the previous directory,
|
|
65
|
+
# so always output at least a . so it'll cd to the current dir at least lol - it still runs even if the proc
|
|
66
|
+
# fails.
|
|
67
|
+
out_dir = '.'
|
|
68
|
+
try:
|
|
69
|
+
if (m := self._GITHUB_PAT.fullmatch(self.args.repo)):
|
|
70
|
+
user = m.group('user')
|
|
71
|
+
repo = m.group('repo')
|
|
72
|
+
|
|
73
|
+
os.makedirs(user, 0o755, exist_ok=True)
|
|
74
|
+
|
|
75
|
+
subprocess.check_call([
|
|
76
|
+
'git',
|
|
77
|
+
'clone',
|
|
78
|
+
*self.unknown_args,
|
|
79
|
+
*self.args.args,
|
|
80
|
+
f'https://github.com/{user}/{repo}.git',
|
|
81
|
+
os.path.join(user, repo),
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
out_dir = os.path.join(user, repo)
|
|
85
|
+
|
|
86
|
+
else:
|
|
87
|
+
parsed = urllib.parse.urlparse(self.args.repo)
|
|
88
|
+
out_dir = parsed.path.split('/')[-1]
|
|
89
|
+
|
|
90
|
+
subprocess.check_call([
|
|
91
|
+
'git',
|
|
92
|
+
'clone',
|
|
93
|
+
*self.unknown_args,
|
|
94
|
+
*self.args.args,
|
|
95
|
+
self.args.repo,
|
|
96
|
+
])
|
|
97
|
+
|
|
98
|
+
finally:
|
|
99
|
+
print(out_dir)
|
|
96
100
|
|
|
97
101
|
@ap.command(
|
|
98
102
|
ap.arg('rev', nargs='?', default='HEAD'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev104
|
|
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.dev104
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: black ~=24.10 ; extra == 'all'
|
|
18
18
|
Requires-Dist: pycparser ~=2.22 ; extra == 'all'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
omdev/.manifests.json,sha256=
|
|
1
|
+
omdev/.manifests.json,sha256=NReQmZbfvIWhaZlNmNErHDMVSd0GHVu5otKRNIV1ayA,6713
|
|
2
2
|
omdev/__about__.py,sha256=ON7EnhbxbwLsMj60wkd9OEYPloXZ7jmnMMzeLg44LXY,1225
|
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
omdev/bracepy.py,sha256=I8EdqtDvxzAi3I8TuMEW-RBfwXfqKbwp06CfOdj3L1o,2743
|
|
@@ -114,11 +114,11 @@ omdev/pyproject/pkg.py,sha256=WB9k3zEpHSAR24H09kikgAnLMWUz-bk9f0aB-2L_ITw,14560
|
|
|
114
114
|
omdev/pyproject/reqs.py,sha256=8feZ71YnGzwKbLK4zO28CDQeNcZIIuq6cnkBhs6M-7E,2406
|
|
115
115
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
|
116
116
|
omdev/scripts/bumpversion.py,sha256=Kn7fo73Hs8uJh3Hi3EIyLOlzLPWAC6dwuD_lZ3cIzuY,1064
|
|
117
|
-
omdev/scripts/execrss.py,sha256=
|
|
118
|
-
omdev/scripts/exectime.py,sha256=
|
|
117
|
+
omdev/scripts/execrss.py,sha256=mR0G0wERBYtQmVIn63lCIIFb5zkCM6X_XOENDFYDBKc,651
|
|
118
|
+
omdev/scripts/exectime.py,sha256=sFb376GflU6s9gNX-2-we8hgH6w5MuQNS9g6i4SqJIo,610
|
|
119
119
|
omdev/scripts/importtrace.py,sha256=Jbo3Yk2RAbE8_tJ97iTcVNpoxCJxrRb2tl1W_CV3NG0,14067
|
|
120
120
|
omdev/scripts/interp.py,sha256=U6mU2RPZjwcBhn4Vl4SrAyDUFcf7bBxBnPY5FHCxosw,72496
|
|
121
|
-
omdev/scripts/pyproject.py,sha256=
|
|
121
|
+
omdev/scripts/pyproject.py,sha256=RNWsO9-cu6MUXuWFT1Y200euUu6WcAC4orwGEUoGVWA,165526
|
|
122
122
|
omdev/scripts/slowcat.py,sha256=lssv4yrgJHiWfOiHkUut2p8E8Tq32zB-ujXESQxFFHY,2728
|
|
123
123
|
omdev/toml/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
|
124
124
|
omdev/toml/parser.py,sha256=84bn09uhYHwQGyfww6Rw6y1RxPAE_HDltODOSakcqDM,29186
|
|
@@ -126,7 +126,7 @@ omdev/toml/writer.py,sha256=lk3on3YXVbWuLJa-xsOzOhs1bBAT1vXqw4mBbluZl_w,3040
|
|
|
126
126
|
omdev/tools/__init__.py,sha256=iVJAOQ0viGTQOm0DLX4uZLro-9jOioYJGLg9s0kDx1A,78
|
|
127
127
|
omdev/tools/doc.py,sha256=mv9XfitzqXl3vFHSenv01xHCxWf8g03rUAb_sqoty98,2556
|
|
128
128
|
omdev/tools/docker.py,sha256=k2BrVvFYwyGov064CPHd_HWo9aqR1zHc2UeEsVwPth4,6827
|
|
129
|
-
omdev/tools/git.py,sha256=
|
|
129
|
+
omdev/tools/git.py,sha256=87DrMPtMLVPJ0R6yazX8JkKe8KIQyfEAcI0tYIQgKjU,4188
|
|
130
130
|
omdev/tools/importscan.py,sha256=QeGjR3UGcuuuDUiisFuAXWHlcKJScGxGEcU6tfOh2CM,4069
|
|
131
131
|
omdev/tools/mkrelimp.py,sha256=wsJAjTIf3nqcSfnT9TkDpS1VUOoM9W2Az5tZdWuzyLM,4054
|
|
132
132
|
omdev/tools/notebook.py,sha256=M8Xi_gfZdlahnyFLtp0RBgYZPSHWQStMMDYZc71Zync,3494
|
|
@@ -136,9 +136,9 @@ omdev/tools/sqlrepl.py,sha256=tmFZh80-xsGM62dyQ7_UGLebChrj7IHbIPYBWDJMgVk,5741
|
|
|
136
136
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
137
137
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
|
138
138
|
omdev/tools/pawk/pawk.py,sha256=Eckymn22GfychCQcQi96BFqRo_LmiJ-EPhC8TTUJdB4,11446
|
|
139
|
-
omdev-0.0.0.
|
|
140
|
-
omdev-0.0.0.
|
|
141
|
-
omdev-0.0.0.
|
|
142
|
-
omdev-0.0.0.
|
|
143
|
-
omdev-0.0.0.
|
|
144
|
-
omdev-0.0.0.
|
|
139
|
+
omdev-0.0.0.dev104.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
|
140
|
+
omdev-0.0.0.dev104.dist-info/METADATA,sha256=89pRHK2yBo2fCmrRk02C7ZptErZfrEfIYpyZedWax-Y,1704
|
|
141
|
+
omdev-0.0.0.dev104.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
142
|
+
omdev-0.0.0.dev104.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
|
143
|
+
omdev-0.0.0.dev104.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
|
144
|
+
omdev-0.0.0.dev104.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|