omdev 0.0.0.dev432__py3-none-any.whl → 0.0.0.dev433__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/.omlish-manifests.json +1 -1
- omdev/__about__.py +1 -1
- omdev/py/scripts/execstat.py +20 -20
- omdev/scripts/ci.py +33 -22
- omdev/scripts/pyproject.py +33 -22
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/METADATA +4 -4
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/RECORD +11 -11
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev432.dist-info → omdev-0.0.0.dev433.dist-info}/top_level.txt +0 -0
omdev/.omlish-manifests.json
CHANGED
omdev/__about__.py
CHANGED
omdev/py/scripts/execstat.py
CHANGED
@@ -17,13 +17,14 @@ import typing as ta
|
|
17
17
|
|
18
18
|
|
19
19
|
def _run(
|
20
|
+
report: 'ta.Callable[[dict], None]',
|
20
21
|
src: str,
|
21
22
|
*,
|
22
23
|
setup: 'ta.Optional[str]' = None,
|
23
24
|
time: bool = False,
|
24
25
|
rss: bool = False,
|
25
26
|
modules: bool = False,
|
26
|
-
) ->
|
27
|
+
) -> None:
|
27
28
|
if rss:
|
28
29
|
import resource # noqa
|
29
30
|
|
@@ -61,26 +62,28 @@ def _run(
|
|
61
62
|
|
62
63
|
#
|
63
64
|
|
64
|
-
|
65
|
+
try:
|
66
|
+
exec(code, globals(), ns)
|
65
67
|
|
66
|
-
|
68
|
+
finally:
|
69
|
+
#
|
67
70
|
|
68
|
-
|
69
|
-
|
71
|
+
if time:
|
72
|
+
end_time = get_time()
|
70
73
|
|
71
|
-
|
72
|
-
|
74
|
+
if rss:
|
75
|
+
end_rss = get_rss()
|
73
76
|
|
74
|
-
|
75
|
-
|
77
|
+
if modules:
|
78
|
+
end_modules = get_modules()
|
76
79
|
|
77
|
-
|
80
|
+
#
|
78
81
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
82
|
+
report({
|
83
|
+
**({'time': (end_time - start_time)} if time else {}), # noqa
|
84
|
+
**({'rss': (end_rss - start_rss)} if rss else {}), # noqa
|
85
|
+
**({'modules': [m for m in end_modules if m not in start_modules]} if modules else {}), # noqa
|
86
|
+
})
|
84
87
|
|
85
88
|
|
86
89
|
#
|
@@ -145,13 +148,10 @@ def _main() -> None:
|
|
145
148
|
|
146
149
|
payload = '\n'.join([
|
147
150
|
inspect.getsource(_run),
|
148
|
-
f'
|
149
|
-
f'import json',
|
150
|
-
f'with open({out_file!r}, "w") as f:', # noqa
|
151
|
-
f' f.write(json.dumps(dct))',
|
151
|
+
f'with open({out_file!r}, "w") as f: _run(lambda dct: f.write(__import__("json").dumps(dct)), **{run_kw!r})', # noqa
|
152
152
|
])
|
153
153
|
|
154
|
-
subprocess.
|
154
|
+
subprocess.call([exe, '-c', payload])
|
155
155
|
|
156
156
|
with open(out_file) as f:
|
157
157
|
result = json.load(f)
|
omdev/scripts/ci.py
CHANGED
@@ -7713,16 +7713,17 @@ class CaptureLoggingContextImpl(CaptureLoggingContext):
|
|
7713
7713
|
stack_offset: int = 0,
|
7714
7714
|
stack_info: bool = False,
|
7715
7715
|
) -> None:
|
7716
|
-
# TODO: Name, Msg, Extra
|
7717
|
-
|
7718
7716
|
if time_ns is None:
|
7719
7717
|
time_ns = time.time_ns()
|
7720
7718
|
|
7719
|
+
# Done early to not trample on sys.exc_info()
|
7720
|
+
exc = LoggingContextInfos.Exc.build(exc_info)
|
7721
|
+
|
7721
7722
|
self._infos: ta.Dict[ta.Type[LoggingContextInfo], LoggingContextInfo] = {}
|
7722
7723
|
self._set_info(
|
7723
7724
|
LoggingContextInfos.Level.build(level),
|
7725
|
+
exc,
|
7724
7726
|
LoggingContextInfos.Time.build(time_ns),
|
7725
|
-
LoggingContextInfos.Exc.build(exc_info),
|
7726
7727
|
)
|
7727
7728
|
|
7728
7729
|
if caller is not CaptureLoggingContextImpl.NOT_SET:
|
@@ -9869,22 +9870,6 @@ class LoggingContextInfoRecordAdapters:
|
|
9869
9870
|
args=rec.args,
|
9870
9871
|
)
|
9871
9872
|
|
9872
|
-
# FIXME: handled specially - all unknown attrs on LogRecord
|
9873
|
-
# class Extra(Adapter[LoggingContextInfos.Extra]):
|
9874
|
-
# _record_attrs: ta.ClassVar[ta.Mapping[str, ta.Union[ta.Any, ta.Tuple[ta.Any, ta.Any]]]] = dict()
|
9875
|
-
#
|
9876
|
-
# def info_to_record(self, info: ta.Optional[LoggingContextInfos.Extra]) -> ta.Mapping[str, ta.Any]:
|
9877
|
-
# # FIXME:
|
9878
|
-
# # if extra is not None:
|
9879
|
-
# # for key in extra:
|
9880
|
-
# # if (key in ["message", "asctime"]) or (key in rv.__dict__):
|
9881
|
-
# # raise KeyError("Attempt to overwrite %r in LogRecord" % key)
|
9882
|
-
# # rv.__dict__[key] = extra[key]
|
9883
|
-
# return dict()
|
9884
|
-
#
|
9885
|
-
# def record_to_info(self, rec: logging.LogRecord) -> ta.Optional[LoggingContextInfos.Extra]:
|
9886
|
-
# return None
|
9887
|
-
|
9888
9873
|
class Time(RequiredAdapter[LoggingContextInfos.Time]):
|
9889
9874
|
info_cls: ta.ClassVar[ta.Type[LoggingContextInfos.Time]] = LoggingContextInfos.Time
|
9890
9875
|
|
@@ -10265,13 +10250,20 @@ class LoggingContextLogRecord(logging.LogRecord):
|
|
10265
10250
|
# - exc_info: LoggingExcInfoTuple | None
|
10266
10251
|
# - func: str | None = None -> funcName
|
10267
10252
|
# - sinfo: str | None = None -> stack_info
|
10253
|
+
#
|
10268
10254
|
|
10269
10255
|
def __init__(self, *, _logging_context: LoggingContext) -> None: # noqa
|
10270
|
-
self._logging_context
|
10256
|
+
self.__dict__.update(_logging_context=_logging_context)
|
10271
10257
|
|
10272
10258
|
for ad in _LOGGING_CONTEXT_INFO_RECORD_ADAPTERS_:
|
10273
10259
|
self.__dict__.update(ad.context_to_record(_logging_context))
|
10274
10260
|
|
10261
|
+
_logging_context: LoggingContext
|
10262
|
+
|
10263
|
+
# FIXME: track extra
|
10264
|
+
# def __setattr__(self, key, value):
|
10265
|
+
# super().__setattr__(key, value)
|
10266
|
+
|
10275
10267
|
|
10276
10268
|
##
|
10277
10269
|
|
@@ -10284,10 +10276,29 @@ class LogRecordLoggingContext(LoggingContext):
|
|
10284
10276
|
|
10285
10277
|
self._rec = rec
|
10286
10278
|
|
10287
|
-
|
10288
|
-
|
10279
|
+
infos: ta.List[LoggingContextInfo] = [
|
10280
|
+
info
|
10289
10281
|
for ad in _LOGGING_CONTEXT_INFO_RECORD_ADAPTERS_
|
10290
10282
|
if (info := ad.record_to_info(rec)) is not None
|
10283
|
+
]
|
10284
|
+
|
10285
|
+
# FIXME:
|
10286
|
+
# if extra is not None:
|
10287
|
+
# for key in extra:
|
10288
|
+
# if (key in ["message", "asctime"]) or (key in rv.__dict__):
|
10289
|
+
# raise KeyError("Attempt to overwrite %r in LogRecord" % key)
|
10290
|
+
# rv.__dict__[key] = extra[key]
|
10291
|
+
|
10292
|
+
if (extra := {
|
10293
|
+
a: v
|
10294
|
+
for a, v in rec.__dict__.items()
|
10295
|
+
if a not in _KNOWN_STD_LOGGING_RECORD_ATTR_SET
|
10296
|
+
}):
|
10297
|
+
infos.append(LoggingContextInfos.Extra(extra))
|
10298
|
+
|
10299
|
+
self._infos: ta.Dict[ta.Type[LoggingContextInfo], LoggingContextInfo] = {
|
10300
|
+
type(info): info
|
10301
|
+
for info in infos
|
10291
10302
|
}
|
10292
10303
|
|
10293
10304
|
def get_info(self, ty: ta.Type[LoggingContextInfoT]) -> ta.Optional[LoggingContextInfoT]:
|
omdev/scripts/pyproject.py
CHANGED
@@ -7176,16 +7176,17 @@ class CaptureLoggingContextImpl(CaptureLoggingContext):
|
|
7176
7176
|
stack_offset: int = 0,
|
7177
7177
|
stack_info: bool = False,
|
7178
7178
|
) -> None:
|
7179
|
-
# TODO: Name, Msg, Extra
|
7180
|
-
|
7181
7179
|
if time_ns is None:
|
7182
7180
|
time_ns = time.time_ns()
|
7183
7181
|
|
7182
|
+
# Done early to not trample on sys.exc_info()
|
7183
|
+
exc = LoggingContextInfos.Exc.build(exc_info)
|
7184
|
+
|
7184
7185
|
self._infos: ta.Dict[ta.Type[LoggingContextInfo], LoggingContextInfo] = {}
|
7185
7186
|
self._set_info(
|
7186
7187
|
LoggingContextInfos.Level.build(level),
|
7188
|
+
exc,
|
7187
7189
|
LoggingContextInfos.Time.build(time_ns),
|
7188
|
-
LoggingContextInfos.Exc.build(exc_info),
|
7189
7190
|
)
|
7190
7191
|
|
7191
7192
|
if caller is not CaptureLoggingContextImpl.NOT_SET:
|
@@ -8014,22 +8015,6 @@ class LoggingContextInfoRecordAdapters:
|
|
8014
8015
|
args=rec.args,
|
8015
8016
|
)
|
8016
8017
|
|
8017
|
-
# FIXME: handled specially - all unknown attrs on LogRecord
|
8018
|
-
# class Extra(Adapter[LoggingContextInfos.Extra]):
|
8019
|
-
# _record_attrs: ta.ClassVar[ta.Mapping[str, ta.Union[ta.Any, ta.Tuple[ta.Any, ta.Any]]]] = dict()
|
8020
|
-
#
|
8021
|
-
# def info_to_record(self, info: ta.Optional[LoggingContextInfos.Extra]) -> ta.Mapping[str, ta.Any]:
|
8022
|
-
# # FIXME:
|
8023
|
-
# # if extra is not None:
|
8024
|
-
# # for key in extra:
|
8025
|
-
# # if (key in ["message", "asctime"]) or (key in rv.__dict__):
|
8026
|
-
# # raise KeyError("Attempt to overwrite %r in LogRecord" % key)
|
8027
|
-
# # rv.__dict__[key] = extra[key]
|
8028
|
-
# return dict()
|
8029
|
-
#
|
8030
|
-
# def record_to_info(self, rec: logging.LogRecord) -> ta.Optional[LoggingContextInfos.Extra]:
|
8031
|
-
# return None
|
8032
|
-
|
8033
8018
|
class Time(RequiredAdapter[LoggingContextInfos.Time]):
|
8034
8019
|
info_cls: ta.ClassVar[ta.Type[LoggingContextInfos.Time]] = LoggingContextInfos.Time
|
8035
8020
|
|
@@ -8410,13 +8395,20 @@ class LoggingContextLogRecord(logging.LogRecord):
|
|
8410
8395
|
# - exc_info: LoggingExcInfoTuple | None
|
8411
8396
|
# - func: str | None = None -> funcName
|
8412
8397
|
# - sinfo: str | None = None -> stack_info
|
8398
|
+
#
|
8413
8399
|
|
8414
8400
|
def __init__(self, *, _logging_context: LoggingContext) -> None: # noqa
|
8415
|
-
self._logging_context
|
8401
|
+
self.__dict__.update(_logging_context=_logging_context)
|
8416
8402
|
|
8417
8403
|
for ad in _LOGGING_CONTEXT_INFO_RECORD_ADAPTERS_:
|
8418
8404
|
self.__dict__.update(ad.context_to_record(_logging_context))
|
8419
8405
|
|
8406
|
+
_logging_context: LoggingContext
|
8407
|
+
|
8408
|
+
# FIXME: track extra
|
8409
|
+
# def __setattr__(self, key, value):
|
8410
|
+
# super().__setattr__(key, value)
|
8411
|
+
|
8420
8412
|
|
8421
8413
|
##
|
8422
8414
|
|
@@ -8429,10 +8421,29 @@ class LogRecordLoggingContext(LoggingContext):
|
|
8429
8421
|
|
8430
8422
|
self._rec = rec
|
8431
8423
|
|
8432
|
-
|
8433
|
-
|
8424
|
+
infos: ta.List[LoggingContextInfo] = [
|
8425
|
+
info
|
8434
8426
|
for ad in _LOGGING_CONTEXT_INFO_RECORD_ADAPTERS_
|
8435
8427
|
if (info := ad.record_to_info(rec)) is not None
|
8428
|
+
]
|
8429
|
+
|
8430
|
+
# FIXME:
|
8431
|
+
# if extra is not None:
|
8432
|
+
# for key in extra:
|
8433
|
+
# if (key in ["message", "asctime"]) or (key in rv.__dict__):
|
8434
|
+
# raise KeyError("Attempt to overwrite %r in LogRecord" % key)
|
8435
|
+
# rv.__dict__[key] = extra[key]
|
8436
|
+
|
8437
|
+
if (extra := {
|
8438
|
+
a: v
|
8439
|
+
for a, v in rec.__dict__.items()
|
8440
|
+
if a not in _KNOWN_STD_LOGGING_RECORD_ATTR_SET
|
8441
|
+
}):
|
8442
|
+
infos.append(LoggingContextInfos.Extra(extra))
|
8443
|
+
|
8444
|
+
self._infos: ta.Dict[ta.Type[LoggingContextInfo], LoggingContextInfo] = {
|
8445
|
+
type(info): info
|
8446
|
+
for info in infos
|
8436
8447
|
}
|
8437
8448
|
|
8438
8449
|
def get_info(self, ty: ta.Type[LoggingContextInfoT]) -> ta.Optional[LoggingContextInfoT]:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev433
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -14,10 +14,10 @@ Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Python: >=3.13
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
+
Requires-Dist: omlish==0.0.0.dev433
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.1; extra == "all"
|
20
|
-
Requires-Dist: pycparser~=2.
|
20
|
+
Requires-Dist: pycparser~=2.23; extra == "all"
|
21
21
|
Requires-Dist: pcpp~=1.30; extra == "all"
|
22
22
|
Requires-Dist: docutils~=0.22; extra == "all"
|
23
23
|
Requires-Dist: markdown-it-py~=4.0; extra == "all"
|
@@ -30,7 +30,7 @@ Requires-Dist: segno~=1.6; extra == "all"
|
|
30
30
|
Provides-Extra: black
|
31
31
|
Requires-Dist: black~=25.1; extra == "black"
|
32
32
|
Provides-Extra: c
|
33
|
-
Requires-Dist: pycparser~=2.
|
33
|
+
Requires-Dist: pycparser~=2.23; extra == "c"
|
34
34
|
Requires-Dist: pcpp~=1.30; extra == "c"
|
35
35
|
Provides-Extra: doc
|
36
36
|
Requires-Dist: docutils~=0.22; extra == "doc"
|
@@ -1,5 +1,5 @@
|
|
1
|
-
omdev/.omlish-manifests.json,sha256=
|
2
|
-
omdev/__about__.py,sha256=
|
1
|
+
omdev/.omlish-manifests.json,sha256=h7weS1edP_S_5YO-kYLD8Exg4kW60JQXsHH4mKmgmpM,11909
|
2
|
+
omdev/__about__.py,sha256=x-dVL4rAhU7f3I8Y98CN8oHwxcqwEF3-W9KA4dBmdTc,1202
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/cmake.py,sha256=gu49t10_syXh_TUJs4POsxeFs8we8Y3XTOOPgIXmGvg,4608
|
5
5
|
omdev/imgur.py,sha256=oqei705LhSnLWQTOMHMHwRecRXcpSEP90Sg4SVINPQ0,3133
|
@@ -255,7 +255,7 @@ omdev/py/docstrings/parser.py,sha256=umJEgQBkSXLwWIKZrBbFCfNrz847vpTNDqTTEwlvHpA
|
|
255
255
|
omdev/py/docstrings/rest.py,sha256=c2xPYg_W01W9eYY_KLKX69E4qu4jpkgUshi5K5EyVv8,5221
|
256
256
|
omdev/py/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
257
257
|
omdev/py/scripts/bumpversion.py,sha256=UDMtTd_wfkqsmrtHqTKDilWVzUBigzZAOCVND7t9jyw,1124
|
258
|
-
omdev/py/scripts/execstat.py,sha256
|
258
|
+
omdev/py/scripts/execstat.py,sha256=iJD48Mn8lF4V7hNvOrChfBRjmItWJTAQzWwHM0wSTBk,4792
|
259
259
|
omdev/py/scripts/importtrace.py,sha256=OOf9GvB6PWP2uVzogSYsM5JGUAoSfMx1IKfYUXB8ABc,14245
|
260
260
|
omdev/py/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
261
261
|
omdev/py/tools/importscan.py,sha256=4dCH0coX0OqNwesteKaTE8GxuSfLhgXYQlzNUXLiSNY,4640
|
@@ -273,9 +273,9 @@ omdev/pyproject/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
273
273
|
omdev/pyproject/resources/docker-dev.sh,sha256=DHkz5D18jok_oDolfg2mqrvGRWFoCe9GQo04dR1czcc,838
|
274
274
|
omdev/pyproject/resources/python.sh,sha256=rFaN4SiJ9hdLDXXsDTwugI6zsw6EPkgYMmtacZeTbvw,749
|
275
275
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
276
|
-
omdev/scripts/ci.py,sha256=
|
276
|
+
omdev/scripts/ci.py,sha256=Bk7Y3M0trwgTYnOP8RXuNI6f5YrnBa4fyANRW-S62GU,423440
|
277
277
|
omdev/scripts/interp.py,sha256=39U9gjJQX0feYdXE9VpzKsE3msVBM-LiLwKaCgWNTKU,166443
|
278
|
-
omdev/scripts/pyproject.py,sha256=
|
278
|
+
omdev/scripts/pyproject.py,sha256=DV-nS6mF7_d4c08TWoZKGWc-_xcSpobJ2pad5UDTx2Q,330499
|
279
279
|
omdev/scripts/slowcat.py,sha256=PwdT-pg62imEEb6kcOozl9_YUi-4KopvjvzWT1OmGb0,2717
|
280
280
|
omdev/scripts/tmpexec.py,sha256=t0nErDRALjTk7H0X8ADjZUIDFjlPNzOOokmjCjBHdzs,1431
|
281
281
|
omdev/tokens/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -319,9 +319,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
319
319
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
320
320
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
321
321
|
omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
|
322
|
-
omdev-0.0.0.
|
323
|
-
omdev-0.0.0.
|
324
|
-
omdev-0.0.0.
|
325
|
-
omdev-0.0.0.
|
326
|
-
omdev-0.0.0.
|
327
|
-
omdev-0.0.0.
|
322
|
+
omdev-0.0.0.dev433.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
323
|
+
omdev-0.0.0.dev433.dist-info/METADATA,sha256=BICjsiPYpqxurhsQbqj2SDGXDUc9-p20F9LlkU_bilQ,5100
|
324
|
+
omdev-0.0.0.dev433.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
325
|
+
omdev-0.0.0.dev433.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
326
|
+
omdev-0.0.0.dev433.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
327
|
+
omdev-0.0.0.dev433.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|