omdev 0.0.0.dev427__py3-none-any.whl → 0.0.0.dev428__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/ci/docker/dataserver.py +2 -2
- omdev/interp/inspect.py +2 -1
- omdev/interp/providers/system.py +2 -2
- omdev/interp/pyenv/provider.py +2 -2
- omdev/interp/uv/provider.py +3 -2
- omdev/interp/uv/uv.py +2 -2
- omdev/interp/venvs.py +2 -2
- omdev/scripts/ci.py +4338 -3240
- omdev/scripts/interp.py +111 -9
- omdev/scripts/pyproject.py +1346 -146
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/RECORD +16 -16
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev427.dist-info → omdev-0.0.0.dev428.dist-info}/top_level.txt +0 -0
omdev/scripts/interp.py
CHANGED
@@ -72,6 +72,9 @@ CheckOnRaiseFn = ta.Callable[[Exception], None] # ta.TypeAlias
|
|
72
72
|
CheckExceptionFactory = ta.Callable[..., Exception] # ta.TypeAlias
|
73
73
|
CheckArgsRenderer = ta.Callable[..., ta.Optional[str]] # ta.TypeAlias
|
74
74
|
|
75
|
+
# ../../omlish/logs/levels.py
|
76
|
+
LogLevel = int # ta.TypeAlias
|
77
|
+
|
75
78
|
# ../packaging/specifiers.py
|
76
79
|
UnparsedVersion = ta.Union['Version', str]
|
77
80
|
UnparsedVersionVar = ta.TypeVar('UnparsedVersionVar', bound=UnparsedVersion)
|
@@ -1385,6 +1388,74 @@ def format_num_bytes(num_bytes: int) -> str:
|
|
1385
1388
|
return f'{num_bytes / 1024 ** (len(FORMAT_NUM_BYTES_SUFFIXES) - 1):.2f}{FORMAT_NUM_BYTES_SUFFIXES[-1]}'
|
1386
1389
|
|
1387
1390
|
|
1391
|
+
########################################
|
1392
|
+
# ../../../omlish/logs/levels.py
|
1393
|
+
|
1394
|
+
|
1395
|
+
##
|
1396
|
+
|
1397
|
+
|
1398
|
+
@ta.final
|
1399
|
+
class NamedLogLevel(int):
|
1400
|
+
# logging.getLevelNamesMapping (or, as that is unavailable <3.11, logging._nameToLevel) includes the deprecated
|
1401
|
+
# aliases.
|
1402
|
+
_NAMES_BY_INT: ta.ClassVar[ta.Mapping[LogLevel, str]] = dict(sorted(logging._levelToName.items(), key=lambda t: -t[0])) # noqa
|
1403
|
+
|
1404
|
+
_INTS_BY_NAME: ta.ClassVar[ta.Mapping[str, LogLevel]] = {v: k for k, v in _NAMES_BY_INT.items()}
|
1405
|
+
|
1406
|
+
_NAME_INT_PAIRS: ta.ClassVar[ta.Sequence[ta.Tuple[str, LogLevel]]] = list(_INTS_BY_NAME.items())
|
1407
|
+
|
1408
|
+
#
|
1409
|
+
|
1410
|
+
@property
|
1411
|
+
def exact_name(self) -> ta.Optional[str]:
|
1412
|
+
return self._NAMES_BY_INT.get(self)
|
1413
|
+
|
1414
|
+
_effective_name: ta.Optional[str]
|
1415
|
+
|
1416
|
+
@property
|
1417
|
+
def effective_name(self) -> ta.Optional[str]:
|
1418
|
+
try:
|
1419
|
+
return self._effective_name
|
1420
|
+
except AttributeError:
|
1421
|
+
pass
|
1422
|
+
|
1423
|
+
if (n := self.exact_name) is None:
|
1424
|
+
for n, i in self._NAME_INT_PAIRS: # noqa
|
1425
|
+
if self >= i:
|
1426
|
+
break
|
1427
|
+
else:
|
1428
|
+
n = None
|
1429
|
+
|
1430
|
+
self._effective_name = n
|
1431
|
+
return n
|
1432
|
+
|
1433
|
+
#
|
1434
|
+
|
1435
|
+
def __repr__(self) -> str:
|
1436
|
+
return f'{self.__class__.__name__}({int(self)})'
|
1437
|
+
|
1438
|
+
def __str__(self) -> str:
|
1439
|
+
return self.exact_name or f'{self.effective_name or "INVALID"}:{int(self)}'
|
1440
|
+
|
1441
|
+
#
|
1442
|
+
|
1443
|
+
CRITICAL: ta.ClassVar['NamedLogLevel']
|
1444
|
+
ERROR: ta.ClassVar['NamedLogLevel']
|
1445
|
+
WARNING: ta.ClassVar['NamedLogLevel']
|
1446
|
+
INFO: ta.ClassVar['NamedLogLevel']
|
1447
|
+
DEBUG: ta.ClassVar['NamedLogLevel']
|
1448
|
+
NOTSET: ta.ClassVar['NamedLogLevel']
|
1449
|
+
|
1450
|
+
|
1451
|
+
NamedLogLevel.CRITICAL = NamedLogLevel(logging.CRITICAL)
|
1452
|
+
NamedLogLevel.ERROR = NamedLogLevel(logging.ERROR)
|
1453
|
+
NamedLogLevel.WARNING = NamedLogLevel(logging.WARNING)
|
1454
|
+
NamedLogLevel.INFO = NamedLogLevel(logging.INFO)
|
1455
|
+
NamedLogLevel.DEBUG = NamedLogLevel(logging.DEBUG)
|
1456
|
+
NamedLogLevel.NOTSET = NamedLogLevel(logging.NOTSET)
|
1457
|
+
|
1458
|
+
|
1388
1459
|
########################################
|
1389
1460
|
# ../../../omlish/logs/std/filters.py
|
1390
1461
|
|
@@ -2748,6 +2819,37 @@ class PredicateTimeout(Timeout):
|
|
2748
2819
|
return self()
|
2749
2820
|
|
2750
2821
|
|
2822
|
+
########################################
|
2823
|
+
# ../../../omlish/logs/protocols.py
|
2824
|
+
|
2825
|
+
|
2826
|
+
##
|
2827
|
+
|
2828
|
+
|
2829
|
+
class LoggerLike(ta.Protocol):
|
2830
|
+
"""Satisfied by both our Logger and stdlib logging.Logger."""
|
2831
|
+
|
2832
|
+
def isEnabledFor(self, level: LogLevel) -> bool: ... # noqa
|
2833
|
+
|
2834
|
+
def getEffectiveLevel(self) -> LogLevel: ... # noqa
|
2835
|
+
|
2836
|
+
#
|
2837
|
+
|
2838
|
+
def log(self, level: LogLevel, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2839
|
+
|
2840
|
+
def debug(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2841
|
+
|
2842
|
+
def info(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2843
|
+
|
2844
|
+
def warning(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2845
|
+
|
2846
|
+
def error(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2847
|
+
|
2848
|
+
def exception(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2849
|
+
|
2850
|
+
def critical(self, msg: str, /, *args: ta.Any, **kwargs: ta.Any) -> None: ... # noqa
|
2851
|
+
|
2852
|
+
|
2751
2853
|
########################################
|
2752
2854
|
# ../../../omlish/logs/std/json.py
|
2753
2855
|
"""
|
@@ -4396,12 +4498,12 @@ class VerboseCalledProcessError(subprocess.CalledProcessError):
|
|
4396
4498
|
|
4397
4499
|
|
4398
4500
|
class BaseSubprocesses(Abstract):
|
4399
|
-
DEFAULT_LOGGER: ta.ClassVar[ta.Optional[
|
4501
|
+
DEFAULT_LOGGER: ta.ClassVar[ta.Optional[LoggerLike]] = None
|
4400
4502
|
|
4401
4503
|
def __init__(
|
4402
4504
|
self,
|
4403
4505
|
*,
|
4404
|
-
log: ta.Optional[
|
4506
|
+
log: ta.Optional[LoggerLike] = None,
|
4405
4507
|
try_exceptions: ta.Optional[ta.Tuple[ta.Type[Exception], ...]] = None,
|
4406
4508
|
) -> None:
|
4407
4509
|
super().__init__()
|
@@ -4409,7 +4511,7 @@ class BaseSubprocesses(Abstract):
|
|
4409
4511
|
self._log = log if log is not None else self.DEFAULT_LOGGER
|
4410
4512
|
self._try_exceptions = try_exceptions if try_exceptions is not None else self.DEFAULT_TRY_EXCEPTIONS
|
4411
4513
|
|
4412
|
-
def set_logger(self, log: ta.Optional[
|
4514
|
+
def set_logger(self, log: ta.Optional[LoggerLike]) -> None:
|
4413
4515
|
self._log = log
|
4414
4516
|
|
4415
4517
|
#
|
@@ -4767,7 +4869,7 @@ class AsyncioProcessCommunicator:
|
|
4767
4869
|
proc: asyncio.subprocess.Process,
|
4768
4870
|
loop: ta.Optional[ta.Any] = None,
|
4769
4871
|
*,
|
4770
|
-
log: ta.Optional[
|
4872
|
+
log: ta.Optional[LoggerLike] = None,
|
4771
4873
|
) -> None:
|
4772
4874
|
super().__init__()
|
4773
4875
|
|
@@ -4990,7 +5092,7 @@ class InterpInspector:
|
|
4990
5092
|
def __init__(
|
4991
5093
|
self,
|
4992
5094
|
*,
|
4993
|
-
log: ta.Optional[
|
5095
|
+
log: ta.Optional[LoggerLike] = None,
|
4994
5096
|
) -> None:
|
4995
5097
|
super().__init__()
|
4996
5098
|
|
@@ -5154,7 +5256,7 @@ class Uv:
|
|
5154
5256
|
self,
|
5155
5257
|
config: UvConfig = UvConfig(),
|
5156
5258
|
*,
|
5157
|
-
log: ta.Optional[
|
5259
|
+
log: ta.Optional[LoggerLike] = None,
|
5158
5260
|
) -> None:
|
5159
5261
|
super().__init__()
|
5160
5262
|
|
@@ -5246,7 +5348,7 @@ class SystemInterpProvider(InterpProvider):
|
|
5246
5348
|
options: Options = Options(),
|
5247
5349
|
*,
|
5248
5350
|
inspector: ta.Optional[InterpInspector] = None,
|
5249
|
-
log: ta.Optional[
|
5351
|
+
log: ta.Optional[LoggerLike] = None,
|
5250
5352
|
) -> None:
|
5251
5353
|
super().__init__()
|
5252
5354
|
|
@@ -5629,7 +5731,7 @@ class UvInterpProvider(InterpProvider):
|
|
5629
5731
|
*,
|
5630
5732
|
pyenv: Uv,
|
5631
5733
|
inspector: InterpInspector,
|
5632
|
-
log: ta.Optional[
|
5734
|
+
log: ta.Optional[LoggerLike] = None,
|
5633
5735
|
) -> None:
|
5634
5736
|
super().__init__()
|
5635
5737
|
|
@@ -5686,7 +5788,7 @@ class PyenvInterpProvider(InterpProvider):
|
|
5686
5788
|
*,
|
5687
5789
|
pyenv: Pyenv,
|
5688
5790
|
inspector: InterpInspector,
|
5689
|
-
log: ta.Optional[
|
5791
|
+
log: ta.Optional[LoggerLike] = None,
|
5690
5792
|
) -> None:
|
5691
5793
|
super().__init__()
|
5692
5794
|
|