ominfra 0.0.0.dev209__py3-none-any.whl → 0.0.0.dev211__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
ominfra/manage/main.py CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env python3
2
1
  # @omlish-amalg ../scripts/manage.py
3
2
  # ruff: noqa: UP006 UP007
4
3
  """
@@ -1719,7 +1719,7 @@ def deep_subclasses(cls: ta.Type[T]) -> ta.Iterator[ta.Type[T]]:
1719
1719
  ##
1720
1720
 
1721
1721
 
1722
- def camel_case(name: str, lower: bool = False) -> str:
1722
+ def camel_case(name: str, *, lower: bool = False) -> str:
1723
1723
  if not name:
1724
1724
  return ''
1725
1725
  s = ''.join(map(str.capitalize, name.split('_'))) # noqa
@@ -1736,6 +1736,27 @@ def snake_case(name: str) -> str:
1736
1736
  ##
1737
1737
 
1738
1738
 
1739
+ def is_dunder(name: str) -> bool:
1740
+ return (
1741
+ name[:2] == name[-2:] == '__' and
1742
+ name[2:3] != '_' and
1743
+ name[-3:-2] != '_' and
1744
+ len(name) > 4
1745
+ )
1746
+
1747
+
1748
+ def is_sunder(name: str) -> bool:
1749
+ return (
1750
+ name[0] == name[-1] == '_' and
1751
+ name[1:2] != '_' and
1752
+ name[-2:-1] != '_' and
1753
+ len(name) > 2
1754
+ )
1755
+
1756
+
1757
+ ##
1758
+
1759
+
1739
1760
  def strip_with_newline(s: str) -> str:
1740
1761
  if not s:
1741
1762
  return ''
@@ -1767,27 +1788,6 @@ def split_keep_delimiter(s, d):
1767
1788
  ##
1768
1789
 
1769
1790
 
1770
- def is_dunder(name: str) -> bool:
1771
- return (
1772
- name[:2] == name[-2:] == '__' and
1773
- name[2:3] != '_' and
1774
- name[-3:-2] != '_' and
1775
- len(name) > 4
1776
- )
1777
-
1778
-
1779
- def is_sunder(name: str) -> bool:
1780
- return (
1781
- name[0] == name[-1] == '_' and
1782
- name[1:2] != '_' and
1783
- name[-2:-1] != '_' and
1784
- len(name) > 2
1785
- )
1786
-
1787
-
1788
- ##
1789
-
1790
-
1791
1791
  def attr_repr(obj: ta.Any, *attrs: str) -> str:
1792
1792
  return f'{type(obj).__name__}({", ".join(f"{attr}={getattr(obj, attr)!r}" for attr in attrs)})'
1793
1793
 
ominfra/scripts/manage.py CHANGED
@@ -2952,7 +2952,7 @@ def read_package_resource_text(package: str, resource: str) -> str:
2952
2952
  ##
2953
2953
 
2954
2954
 
2955
- def camel_case(name: str, lower: bool = False) -> str:
2955
+ def camel_case(name: str, *, lower: bool = False) -> str:
2956
2956
  if not name:
2957
2957
  return ''
2958
2958
  s = ''.join(map(str.capitalize, name.split('_'))) # noqa
@@ -2969,6 +2969,27 @@ def snake_case(name: str) -> str:
2969
2969
  ##
2970
2970
 
2971
2971
 
2972
+ def is_dunder(name: str) -> bool:
2973
+ return (
2974
+ name[:2] == name[-2:] == '__' and
2975
+ name[2:3] != '_' and
2976
+ name[-3:-2] != '_' and
2977
+ len(name) > 4
2978
+ )
2979
+
2980
+
2981
+ def is_sunder(name: str) -> bool:
2982
+ return (
2983
+ name[0] == name[-1] == '_' and
2984
+ name[1:2] != '_' and
2985
+ name[-2:-1] != '_' and
2986
+ len(name) > 2
2987
+ )
2988
+
2989
+
2990
+ ##
2991
+
2992
+
2972
2993
  def strip_with_newline(s: str) -> str:
2973
2994
  if not s:
2974
2995
  return ''
@@ -3000,27 +3021,6 @@ def split_keep_delimiter(s, d):
3000
3021
  ##
3001
3022
 
3002
3023
 
3003
- def is_dunder(name: str) -> bool:
3004
- return (
3005
- name[:2] == name[-2:] == '__' and
3006
- name[2:3] != '_' and
3007
- name[-3:-2] != '_' and
3008
- len(name) > 4
3009
- )
3010
-
3011
-
3012
- def is_sunder(name: str) -> bool:
3013
- return (
3014
- name[0] == name[-1] == '_' and
3015
- name[1:2] != '_' and
3016
- name[-2:-1] != '_' and
3017
- len(name) > 2
3018
- )
3019
-
3020
-
3021
- ##
3022
-
3023
-
3024
3024
  def attr_repr(obj: ta.Any, *attrs: str) -> str:
3025
3025
  return f'{type(obj).__name__}({", ".join(f"{attr}={getattr(obj, attr)!r}" for attr in attrs)})'
3026
3026
 
@@ -4970,11 +4970,26 @@ class ArgparseCli:
4970
4970
 
4971
4971
  #
4972
4972
 
4973
- async def async_cli_run(self) -> ta.Optional[int]:
4973
+ async def async_cli_run(
4974
+ self,
4975
+ *,
4976
+ force_async: bool = False,
4977
+ ) -> ta.Optional[int]:
4974
4978
  if (fn := self.prepare_cli_run()) is None:
4975
4979
  return 0
4976
4980
 
4977
- return await fn()
4981
+ if force_async:
4982
+ is_async = True
4983
+ else:
4984
+ tfn = fn
4985
+ if isinstance(tfn, ArgparseCmd):
4986
+ tfn = tfn.fn
4987
+ is_async = inspect.iscoroutinefunction(tfn)
4988
+
4989
+ if is_async:
4990
+ return await fn()
4991
+ else:
4992
+ return fn()
4978
4993
 
4979
4994
 
4980
4995
  ########################################
@@ -10580,7 +10595,8 @@ class SystemInterpProvider(InterpProvider):
10580
10595
  async def get_exe_version(self, exe: str) -> ta.Optional[InterpVersion]:
10581
10596
  if not self._options.inspect:
10582
10597
  s = os.path.basename(exe)
10583
- s = s.removeprefix('python')
10598
+ if s.startswith('python'): # noqa
10599
+ s = s[len('python'):]
10584
10600
  if '.' in s:
10585
10601
  try:
10586
10602
  return InterpVersion.parse(s)
@@ -2535,7 +2535,7 @@ def deep_subclasses(cls: ta.Type[T]) -> ta.Iterator[ta.Type[T]]:
2535
2535
  ##
2536
2536
 
2537
2537
 
2538
- def camel_case(name: str, lower: bool = False) -> str:
2538
+ def camel_case(name: str, *, lower: bool = False) -> str:
2539
2539
  if not name:
2540
2540
  return ''
2541
2541
  s = ''.join(map(str.capitalize, name.split('_'))) # noqa
@@ -2552,6 +2552,27 @@ def snake_case(name: str) -> str:
2552
2552
  ##
2553
2553
 
2554
2554
 
2555
+ def is_dunder(name: str) -> bool:
2556
+ return (
2557
+ name[:2] == name[-2:] == '__' and
2558
+ name[2:3] != '_' and
2559
+ name[-3:-2] != '_' and
2560
+ len(name) > 4
2561
+ )
2562
+
2563
+
2564
+ def is_sunder(name: str) -> bool:
2565
+ return (
2566
+ name[0] == name[-1] == '_' and
2567
+ name[1:2] != '_' and
2568
+ name[-2:-1] != '_' and
2569
+ len(name) > 2
2570
+ )
2571
+
2572
+
2573
+ ##
2574
+
2575
+
2555
2576
  def strip_with_newline(s: str) -> str:
2556
2577
  if not s:
2557
2578
  return ''
@@ -2583,27 +2604,6 @@ def split_keep_delimiter(s, d):
2583
2604
  ##
2584
2605
 
2585
2606
 
2586
- def is_dunder(name: str) -> bool:
2587
- return (
2588
- name[:2] == name[-2:] == '__' and
2589
- name[2:3] != '_' and
2590
- name[-3:-2] != '_' and
2591
- len(name) > 4
2592
- )
2593
-
2594
-
2595
- def is_sunder(name: str) -> bool:
2596
- return (
2597
- name[0] == name[-1] == '_' and
2598
- name[1:2] != '_' and
2599
- name[-2:-1] != '_' and
2600
- len(name) > 2
2601
- )
2602
-
2603
-
2604
- ##
2605
-
2606
-
2607
2607
  def attr_repr(obj: ta.Any, *attrs: str) -> str:
2608
2608
  return f'{type(obj).__name__}({", ".join(f"{attr}={getattr(obj, attr)!r}" for attr in attrs)})'
2609
2609
 
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env python3
2
1
  # ruff: noqa: UP006 UP007
3
2
  # @omlish-amalg ../scripts/supervisor.py
4
3
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ominfra
3
- Version: 0.0.0.dev209
3
+ Version: 0.0.0.dev211
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,9 +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: omdev==0.0.0.dev209
16
- Requires-Dist: omlish==0.0.0.dev209
17
- Requires-Dist: omserv==0.0.0.dev209
15
+ Requires-Dist: omdev==0.0.0.dev211
16
+ Requires-Dist: omlish==0.0.0.dev211
18
17
  Provides-Extra: all
19
18
  Requires-Dist: paramiko~=3.5; extra == "all"
20
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -1,5 +1,5 @@
1
1
  ominfra/.manifests.json,sha256=8KREXxMAlsilZOktXPYru1ND3V5hFI22vnrp6hT3bio,589
2
- ominfra/__about__.py,sha256=_gUs3H7uunGy5IfGw3mq4dFJWaF1mecSPruJPyjbs7Y,741
2
+ ominfra/__about__.py,sha256=6i1AoruFYQCd-PyhhbDQDWY2d1tiQu9nkwWr-fXAqfY,705
3
3
  ominfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  ominfra/pyremote.py,sha256=qjY3Bj0GhuYznQ3bhqXmU9zyIVZkhD9Wv76QUG34ZME,15198
5
5
  ominfra/systemd.py,sha256=d61NVrJoItzSaqhMDgKGrQjbrxEVAujUMDsj8WggXos,1022
@@ -21,19 +21,19 @@ ominfra/clouds/aws/journald2aws/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxk
21
21
  ominfra/clouds/aws/journald2aws/__main__.py,sha256=d23loR_cKfTYZwYiqpt_CmKI7dd5WcYFgIYzqMep75E,68
22
22
  ominfra/clouds/aws/journald2aws/cursor.py,sha256=tQ7O6BHlEdaalbiI_Rqagj0aHfdtTQ_ZJwdOSRUjNvQ,1173
23
23
  ominfra/clouds/aws/journald2aws/driver.py,sha256=b3XfSlIBWAWJLImmyh1ZK9FpdNAYNZ2YZeCv_Q9GckM,6111
24
- ominfra/clouds/aws/journald2aws/main.py,sha256=4qWnw33cTPUW1CU4_9ojkn0wRStANrQzSI_cXpyuOf8,2202
24
+ ominfra/clouds/aws/journald2aws/main.py,sha256=sqs_IoLzadv0EJoWHnYdgg3bkDDSFshCvyRWByTm8Sg,2179
25
25
  ominfra/clouds/aws/journald2aws/poster.py,sha256=hz1XuctW8GtLmfjhRvCFY6py52D4BzXHYny5XKFpHSA,2833
26
26
  ominfra/clouds/aws/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- ominfra/clouds/aws/models/base.py,sha256=s2ffsIGOhRMhMY7awmordfrjWjvZGf5yeJJadt-tjEA,3287
27
+ ominfra/clouds/aws/models/base.py,sha256=0VtlcRo4kbjdIOqikTe_cegViBHqb-DoqJSw_8eQZC4,3777
28
28
  ominfra/clouds/aws/models/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  ominfra/clouds/aws/models/gen/__main__.py,sha256=Jsrv3P7LX2Cg08W7ByZfZ1JQT4lgLDPW1qNAmShFuMk,75
30
30
  ominfra/clouds/aws/models/gen/cli.py,sha256=-tsjPPqUvXVqD40grn1Of-2-YF53dvCfISrIRI2AX4s,3869
31
- ominfra/clouds/aws/models/gen/gen.py,sha256=Z0bKHNbmVqcMdrtUjCWR9Dp5qBtfzP9mgEqcA7uw0ao,14010
31
+ ominfra/clouds/aws/models/gen/gen.py,sha256=u4pfQCH9ir04zd3OPTeb6U3QaOuthM9FsCrJwMDCZB8,15189
32
32
  ominfra/clouds/aws/models/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- ominfra/clouds/aws/models/services/ec2.py,sha256=wx1MlOyJSbYNwIWmmklex3JYbvY_teQZ_IfG-xwpztI,236248
34
- ominfra/clouds/aws/models/services/lambda_.py,sha256=FHxUTZownw_yGfFijPUKM9Ff0_oRNJGNVeSxgIdaCa0,23262
35
- ominfra/clouds/aws/models/services/rds.py,sha256=FNhaSR6rq3Xzlz16Aqp7e_HfejRrpxsnSJzH-tpUiuA,52509
36
- ominfra/clouds/aws/models/services/s3.py,sha256=KRKEeRS6cNmOIJm_J3YW5MohhpvLtMhxtD_5di0nfc4,45186
33
+ ominfra/clouds/aws/models/services/ec2.py,sha256=TsJqFvX271BsBhCx18xg0bb-iXHoksZKT24lauZAchA,262063
34
+ ominfra/clouds/aws/models/services/lambda_.py,sha256=LeAw6TmUwMLjB5VEYH1khWSmlSe6o_YhYjo7l2DXLFY,25766
35
+ ominfra/clouds/aws/models/services/rds.py,sha256=T_V0qrdu3sUIfvk9coNu8OQLaP4BwDxyYaLp3xaeWEM,59730
36
+ ominfra/clouds/aws/models/services/s3.py,sha256=g-3x1it0fk26psjDheInG-p308_ytTdOGMO-3SAlVV4,49431
37
37
  ominfra/clouds/aws/models/services/services.toml,sha256=njiWEctmUUrfzZh-aboCNP9BpYBpxGFAVaGvgtv3pMo,866
38
38
  ominfra/clouds/gcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  ominfra/clouds/gcp/auth.py,sha256=rDIiOH5gP3OSIaMC5Lp8yAD4zWuLDEYlFu37mDx5YDA,1360
@@ -51,7 +51,7 @@ ominfra/manage/bootstrap.py,sha256=1RIRhVkUZjxZcZerHMg8U6xgWhhemGgPN5cDye8dQ68,4
51
51
  ominfra/manage/bootstrap_.py,sha256=B9UfR9J7mS3J54PFaSe1MQS5lCnKgxt5dDRJ9mnHYwg,656
52
52
  ominfra/manage/config.py,sha256=1y2N_8nXHBZc6YbW6BaRZoDDCTBmiHuWtTOQ7zdr5VE,184
53
53
  ominfra/manage/inject.py,sha256=_FVaMZUBKi-oObv14H77luWYCodxNJJD1t4pNQzckFE,2030
54
- ominfra/manage/main.py,sha256=1-PIAWnmd9XIy8pVcWGsME9xNTSj_t0sWWQTq9GYIzc,4403
54
+ ominfra/manage/main.py,sha256=eZ2YpXlFaDxV_O5oNRKJ_6r5kS6GsQ0bQJflhxAIXDw,4380
55
55
  ominfra/manage/marshal.py,sha256=WKj7IU9bo4fBMSSzT6ZMm_WFalXIJZ-V7j8oi92fNhk,305
56
56
  ominfra/manage/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  ominfra/manage/commands/base.py,sha256=LtaI0AgnplttQK7gNncNItq8yuTZQimJTaprVpZktI8,3993
@@ -111,9 +111,9 @@ ominfra/manage/targets/connection.py,sha256=rVI1YJxFClcF-sdttqWyIz9_XjPI01GUdwxY
111
111
  ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhhMcE,1561
112
112
  ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
113
113
  ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
- ominfra/scripts/journald2aws.py,sha256=Bo_24qN3YI_72BcZYBHid9_SJWnCAmbKRJ3-wE6dGMU,166250
115
- ominfra/scripts/manage.py,sha256=QlG02s1uAJ4sFTRuR50HpinKp-B7-P0yAEHxikRonA0,357276
116
- ominfra/scripts/supervisor.py,sha256=6OQnZfnHfXT-hHsGQA_OhA_BjOs01vzInkmEZWYhiVY,291847
114
+ ominfra/scripts/journald2aws.py,sha256=NDitI-4E4Joi0JiH60q_n45fRLweF40MtVQfotNbU2I,166253
115
+ ominfra/scripts/manage.py,sha256=sb7uxZX6ovhMo0jyoem3halHN48mnobLBeIc8yzBRqg,357677
116
+ ominfra/scripts/supervisor.py,sha256=WP1gthTsdQZZY4swRXGtPUrznnc1OYf25cs0m875YXk,291850
117
117
  ominfra/supervisor/LICENSE.txt,sha256=ZrHY15PVR98y26Yg6iQfa-SXnUaYTDhrUsPVcEO5OKM,1874
118
118
  ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
119
119
  ominfra/supervisor/__main__.py,sha256=I0yFw-C08OOiZ3BF6lF1Oiv789EQXu-_j6whDhQUTEA,66
@@ -127,7 +127,7 @@ ominfra/supervisor/groupsimpl.py,sha256=PCDyc_Wc-pnvIj56_aEyiA5exCpK6n9iErqnJzO2
127
127
  ominfra/supervisor/http.py,sha256=Tl5eT6dyf4KuQXKbhGo1B6CFEzUDtPl_DZAuUFVD9zI,3453
128
128
  ominfra/supervisor/inject.py,sha256=IeR-WKvK1sGNxMe6G2OBT5kSP7EUP5ipkDgcUFmDPCA,4838
129
129
  ominfra/supervisor/io.py,sha256=moaGNaPuYXEAUzLg8Qjo05DEIcOUNYUj8SSr8eT0d24,3198
130
- ominfra/supervisor/main.py,sha256=--oFVmoCfJuyenet4u5x2pCv9rXbYuVxuUT5tnUQOPw,4404
130
+ ominfra/supervisor/main.py,sha256=zCVuHZG2kGIPHwTLH4EUr5xpN4vJYessmKO2P0NE5RU,4381
131
131
  ominfra/supervisor/pipes.py,sha256=2ZihNTnRNjnIPOtPbm3_pyqO15f7BNs7WnNtO5V8ahM,2231
132
132
  ominfra/supervisor/privileges.py,sha256=kaRTHI7XjqzxEWCeHp3_0J0Vc4gSPugRbXEwxuw6MYE,2054
133
133
  ominfra/supervisor/process.py,sha256=UaubVxsxVqDnbuWVpTH0DTGbJGLO0vGJ9mNcvy2kCXM,217
@@ -155,9 +155,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
155
155
  ominfra/tailscale/cli.py,sha256=3FnJbgpLw6gInTfhERd1mDy9ijjMUGxkdYVo43Tnxx4,3555
156
156
  ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
157
  ominfra/tools/listresources.py,sha256=4qVg5txsb10EHhvqXXeM6gJ2jx9LbroEnPydDv1uXs0,6176
158
- ominfra-0.0.0.dev209.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
159
- ominfra-0.0.0.dev209.dist-info/METADATA,sha256=SqQycIG8tpaoacb0KsST3UuoYBcn7bdjI0UoIz2DVLo,767
160
- ominfra-0.0.0.dev209.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
161
- ominfra-0.0.0.dev209.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
162
- ominfra-0.0.0.dev209.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
163
- ominfra-0.0.0.dev209.dist-info/RECORD,,
158
+ ominfra-0.0.0.dev211.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
159
+ ominfra-0.0.0.dev211.dist-info/METADATA,sha256=wfG7Vql_zLWXluRFIsFxFOB8l26CL8uImcOsvKGFqe0,731
160
+ ominfra-0.0.0.dev211.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
161
+ ominfra-0.0.0.dev211.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
162
+ ominfra-0.0.0.dev211.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
163
+ ominfra-0.0.0.dev211.dist-info/RECORD,,