ominfra 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.
ominfra/__about__.py CHANGED
@@ -8,6 +8,7 @@ class Project(ProjectBase):
8
8
  description = 'ominfra'
9
9
 
10
10
  dependencies = [
11
+ f'omdev == {__version__}',
11
12
  f'omlish == {__version__}',
12
13
  ]
13
14
 
@@ -48,6 +48,7 @@ import abc
48
48
  import argparse
49
49
  import base64
50
50
  import collections.abc
51
+ import contextlib
51
52
  import dataclasses as dc
52
53
  import datetime
53
54
  import decimal
@@ -440,6 +441,24 @@ class StandardLogHandler(ProxyLogHandler):
440
441
  ##
441
442
 
442
443
 
444
+ @contextlib.contextmanager
445
+ def _locking_logging_module_lock() -> ta.Iterator[None]:
446
+ if hasattr(logging, '_acquireLock'):
447
+ logging._acquireLock() # noqa
448
+ try:
449
+ yield
450
+ finally:
451
+ logging._releaseLock() # type: ignore # noqa
452
+
453
+ elif hasattr(logging, '_lock'):
454
+ # https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96
455
+ with logging._lock: # noqa
456
+ yield
457
+
458
+ else:
459
+ raise Exception("Can't find lock in logging module")
460
+
461
+
443
462
  def configure_standard_logging(
444
463
  level: ta.Union[int, str] = logging.INFO,
445
464
  *,
@@ -447,8 +466,7 @@ def configure_standard_logging(
447
466
  target: ta.Optional[logging.Logger] = None,
448
467
  force: bool = False,
449
468
  ) -> ta.Optional[StandardLogHandler]:
450
- logging._acquireLock() # type: ignore # noqa
451
- try:
469
+ with _locking_logging_module_lock():
452
470
  if target is None:
453
471
  target = logging.root
454
472
 
@@ -488,9 +506,6 @@ def configure_standard_logging(
488
506
 
489
507
  return StandardLogHandler(handler)
490
508
 
491
- finally:
492
- logging._releaseLock() # type: ignore # noqa
493
-
494
509
 
495
510
  ########################################
496
511
  # ../../../../omlish/lite/marshal.py
@@ -5,6 +5,7 @@
5
5
  # @omdev-amalg-output main.py
6
6
  # ruff: noqa: N802 UP006 UP007 UP036
7
7
  import abc
8
+ import contextlib
8
9
  import dataclasses as dc
9
10
  import datetime
10
11
  import functools
@@ -498,6 +499,24 @@ class StandardLogHandler(ProxyLogHandler):
498
499
  ##
499
500
 
500
501
 
502
+ @contextlib.contextmanager
503
+ def _locking_logging_module_lock() -> ta.Iterator[None]:
504
+ if hasattr(logging, '_acquireLock'):
505
+ logging._acquireLock() # noqa
506
+ try:
507
+ yield
508
+ finally:
509
+ logging._releaseLock() # type: ignore # noqa
510
+
511
+ elif hasattr(logging, '_lock'):
512
+ # https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96
513
+ with logging._lock: # noqa
514
+ yield
515
+
516
+ else:
517
+ raise Exception("Can't find lock in logging module")
518
+
519
+
501
520
  def configure_standard_logging(
502
521
  level: ta.Union[int, str] = logging.INFO,
503
522
  *,
@@ -505,8 +524,7 @@ def configure_standard_logging(
505
524
  target: ta.Optional[logging.Logger] = None,
506
525
  force: bool = False,
507
526
  ) -> ta.Optional[StandardLogHandler]:
508
- logging._acquireLock() # type: ignore # noqa
509
- try:
527
+ with _locking_logging_module_lock():
510
528
  if target is None:
511
529
  target = logging.root
512
530
 
@@ -546,9 +564,6 @@ def configure_standard_logging(
546
564
 
547
565
  return StandardLogHandler(handler)
548
566
 
549
- finally:
550
- logging._releaseLock() # type: ignore # noqa
551
-
552
567
 
553
568
  ########################################
554
569
  # ../../../../omlish/lite/runtime.py
ominfra/deploy/remote.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """
2
- lookit:
2
+ See:
3
3
  - piku, obviously
4
4
  - https://github.com/mitogen-hq/mitogen/
5
5
 
@@ -7,6 +7,7 @@
7
7
  import abc
8
8
  import base64
9
9
  import collections.abc
10
+ import contextlib
10
11
  import dataclasses as dc
11
12
  import datetime
12
13
  import decimal
@@ -523,6 +524,24 @@ class StandardLogHandler(ProxyLogHandler):
523
524
  ##
524
525
 
525
526
 
527
+ @contextlib.contextmanager
528
+ def _locking_logging_module_lock() -> ta.Iterator[None]:
529
+ if hasattr(logging, '_acquireLock'):
530
+ logging._acquireLock() # noqa
531
+ try:
532
+ yield
533
+ finally:
534
+ logging._releaseLock() # type: ignore # noqa
535
+
536
+ elif hasattr(logging, '_lock'):
537
+ # https://github.com/python/cpython/commit/74723e11109a320e628898817ab449b3dad9ee96
538
+ with logging._lock: # noqa
539
+ yield
540
+
541
+ else:
542
+ raise Exception("Can't find lock in logging module")
543
+
544
+
526
545
  def configure_standard_logging(
527
546
  level: ta.Union[int, str] = logging.INFO,
528
547
  *,
@@ -530,8 +549,7 @@ def configure_standard_logging(
530
549
  target: ta.Optional[logging.Logger] = None,
531
550
  force: bool = False,
532
551
  ) -> ta.Optional[StandardLogHandler]:
533
- logging._acquireLock() # type: ignore # noqa
534
- try:
552
+ with _locking_logging_module_lock():
535
553
  if target is None:
536
554
  target = logging.root
537
555
 
@@ -571,9 +589,6 @@ def configure_standard_logging(
571
589
 
572
590
  return StandardLogHandler(handler)
573
591
 
574
- finally:
575
- logging._releaseLock() # type: ignore # noqa
576
-
577
592
 
578
593
  ########################################
579
594
  # ../../../omlish/lite/marshal.py
ominfra/ssh.py CHANGED
@@ -18,10 +18,10 @@ import contextlib
18
18
  import shlex
19
19
  import typing as ta
20
20
 
21
+ from omdev.secrets import load_secrets
21
22
  from omlish import check
22
23
  from omlish import dataclasses as dc
23
24
  from omlish import lang
24
- from omserv.secrets import load_secrets
25
25
 
26
26
  from .cmds import CommandRunner
27
27
  from .cmds import LocalCommandRunner
@@ -16,10 +16,10 @@ import typing as ta
16
16
 
17
17
  import urllib3
18
18
 
19
+ from omdev.secrets import load_secrets
19
20
  from omlish import check
20
21
  from omlish import dataclasses as dc
21
22
  from omlish import lang
22
- from omserv.secrets import load_secrets
23
23
 
24
24
 
25
25
  ##
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev29
3
+ Version: 0.0.0.dev31
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,7 +12,8 @@ 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.dev29
15
+ Requires-Dist: omdev ==0.0.0.dev31
16
+ Requires-Dist: omlish ==0.0.0.dev31
16
17
  Provides-Extra: all
17
18
  Requires-Dist: paramiko ~=3.5 ; extra == 'all'
18
19
  Requires-Dist: asyncssh ~=2.17 ; (python_version < "3.13") and extra == 'all'
@@ -1,15 +1,15 @@
1
1
  ominfra/.manifests.json,sha256=N1F-Xz3GaBn2H1p7uKzhkhKCQV8QVR0t76XD6wmFtXA,3
2
- ominfra/__about__.py,sha256=RD3ttxVUkwiE9eo9wxHTded8fSmYx0i51yFIvpXD-FY,625
2
+ ominfra/__about__.py,sha256=KP7VzaIkaT-yn7kYFo-y6t7cFk5ke3hpISgFLy4IcwY,660
3
3
  ominfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  ominfra/cmds.py,sha256=E0AfnvEmnKntXWvmLW5L05_NeDpBET1VBXn7vV6EwBQ,2083
5
- ominfra/ssh.py,sha256=U-JCvx41KI0B0riHy7cpFCKCx_LAHeSn-Irz5aAao2w,5393
5
+ ominfra/ssh.py,sha256=0GH_dpjCG0vWCT2Lh2v6pB-Y4IRsVNXfA5wDsZDvyKk,5392
6
6
  ominfra/clouds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  ominfra/clouds/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ominfra/clouds/aws/auth.py,sha256=EW3lK1U0hnjXkTn1KWJeuv9GG0ibbKdvgLD0P6HJtwo,5502
9
9
  ominfra/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- ominfra/deploy/_executor.py,sha256=Wcka4kOwATqEYGGLIW63SJSohGhVgGatXpPcNC1D9Ms,31939
10
+ ominfra/deploy/_executor.py,sha256=r2aFWr1RBPgLCOXKoSwigxWXTfyIx8aEBM2lcTF5xtQ,32397
11
11
  ominfra/deploy/configs.py,sha256=qi0kwT7G2NH7dXLOQic-u6R3yeadup_QtvrjwWIggbM,435
12
- ominfra/deploy/remote.py,sha256=LJSe3AJlpvNgb_5QtUiK2JIkKC2OgMvjSD1701_y2uI,2147
12
+ ominfra/deploy/remote.py,sha256=6ACmpXU1uBdyGs3Xsp97ktKFq30cJlzN9LRWNUWlGY4,2144
13
13
  ominfra/deploy/executor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
14
14
  ominfra/deploy/executor/base.py,sha256=AjpUT1iPsJHrDNzcflZ9IazpClmWZaGjYxE0NIBazoQ,2815
15
15
  ominfra/deploy/executor/main.py,sha256=PFx-rRMcO-J0kvklZsgjz2CbdQZC__42n9vuve56A4A,2640
@@ -22,7 +22,7 @@ ominfra/deploy/executor/concerns/systemd.py,sha256=MtsSEToEa1HNouern_JukcYTnypw_
22
22
  ominfra/deploy/executor/concerns/user.py,sha256=j5LDfQXquIp-eEM7t6aShsrYoQrM_ILXZycTmTcRVxA,686
23
23
  ominfra/deploy/executor/concerns/venv.py,sha256=jbRriqJHO4r9Zyo5Hfl_qVmcU6Qm6UgrouBroKcPn2g,775
24
24
  ominfra/deploy/poly/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
25
- ominfra/deploy/poly/_main.py,sha256=fg-lvMik6X0WVYl_AjvPuy8wv1IdiiY8WVaDnMe-f34,23110
25
+ ominfra/deploy/poly/_main.py,sha256=D0adtLE_WftgPP2oIjF5kJxDct1EaE8GO-J-NI8MTrk,23568
26
26
  ominfra/deploy/poly/base.py,sha256=Bd-CzUTaDvTRbdXKiTxMxs77WCEXItwNoBYCRnTk1u4,4167
27
27
  ominfra/deploy/poly/configs.py,sha256=9bzWdbxhOk_Q4KokDjmRz254KHnUU71Vl1frLlhQyU4,584
28
28
  ominfra/deploy/poly/deploy.py,sha256=tMYKslXLjstcv86siRt5j37USsS0Wd6lsfeGRE26zio,544
@@ -36,13 +36,13 @@ ominfra/deploy/poly/venv.py,sha256=BoipDEa4NTeodjf3L57KJfq9eGKLagFNKwD8pS4yrzA,1
36
36
  ominfra/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  ominfra/manage/manage.py,sha256=BttL8LFEknHZE_h2Pt5dAqbfUkv6qy43WI0raXBZ1a8,151
38
38
  ominfra/pyremote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- ominfra/pyremote/_runcommands.py,sha256=mOr5pueEese3mjWbi6EFWCvTxkDELstMQ55ipbfaJRA,25773
39
+ ominfra/pyremote/_runcommands.py,sha256=at26lcZ6n7w718uCI8zoqUh8jHzBPfM-r_oZ38W57HY,26231
40
40
  ominfra/pyremote/bootstrap.py,sha256=ybXxNitrNKuPAIl0SrU55Ktn-4R-bDveAm_ZURrmfF0,3368
41
41
  ominfra/pyremote/runcommands.py,sha256=hXXP41rvgL46Oe_HOcLSp2Y84ZMQfEZqqV_jNd1x7Ak,1570
42
42
  ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- ominfra/tools/listresources.py,sha256=vgLgohPwRog8e5pEljI2hOGg-Li5fcwjj-nXj2j8IQo,5918
44
- ominfra-0.0.0.dev29.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
45
- ominfra-0.0.0.dev29.dist-info/METADATA,sha256=w_QxYEweeWnLdB01iuoxa6rwygDq6UFloSQVANZmauY,764
46
- ominfra-0.0.0.dev29.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
47
- ominfra-0.0.0.dev29.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
48
- ominfra-0.0.0.dev29.dist-info/RECORD,,
43
+ ominfra/tools/listresources.py,sha256=4LhqZcBHVIAME0ulYKjPJV1tVKKBevPSGKaJXbxTBbI,5917
44
+ ominfra-0.0.0.dev31.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
45
+ ominfra-0.0.0.dev31.dist-info/METADATA,sha256=PTaZLGiUlmOTyhtiwcELLVxJZPD12TUxr1FrMN92buI,799
46
+ ominfra-0.0.0.dev31.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
47
+ ominfra-0.0.0.dev31.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
48
+ ominfra-0.0.0.dev31.dist-info/RECORD,,