omlish 0.0.0.dev67__py3-none-any.whl → 0.0.0.dev68__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.
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev67'
2
- __revision__ = '9c0328338df429462a1a603795fe20e4a05156ca'
1
+ __version__ = '0.0.0.dev68'
2
+ __revision__ = '60a77b10e4421b5bcc3597af79e50d5c8ab4d924'
3
3
 
4
4
 
5
5
  #
omlish/diag/__init__.py CHANGED
@@ -1,4 +1,32 @@
1
1
  """
2
2
  TODO:
3
3
  - https://github.com/aristocratos/btop/blob/00c90884c328eb3e44a0ab094e833161092aae9c/src/linux/btop_collect.cpp#L443
4
+
5
+ ==
6
+
7
+ Repls
8
+ - python - https://docs.python.org/3/tutorial/interpreter.html
9
+ - ipython - https://github.com/ipython/ipython/
10
+ - ptpython - https://github.com/prompt-toolkit/ptpython
11
+ - bpython - https://github.com/bpython/bpython
12
+
13
+ Debuggers
14
+ - pdb - https://docs.python.org/3/library/pdb.html
15
+ - ipdb - https://github.com/gotcha/ipdb
16
+ - pdub - https://github.com/inducer/pudb/
17
+
18
+ CPU Profilers
19
+ - cProfile - https://docs.python.org/3/library/profile.html
20
+ - pyinstrument - https://github.com/joerick/pyinstrument
21
+ - py-pspy - https://github.com/benfred/py-spy
22
+ - austin-dist - https://github.com/P403n1x87/austin
23
+ - yappi - https://github.com/sumerc/yappi
24
+
25
+ Memory Profilers
26
+ - tracemalloc - https://docs.python.org/3/library/tracemalloc.html
27
+ - guppy3 - https://github.com/zhuyifei1999/guppy3/
28
+ - objgraph - https://github.com/mgedmin/objgraph
29
+ - memory-profiler - https://github.com/pythonprofilers/memory_profiler
30
+ - memray - https://github.com/bloomberg/memray
31
+ - pympler - https://github.com/pympler/pympler
4
32
  """
@@ -100,12 +100,17 @@ def _get_env_path_list(k): # type: (str) -> list[str]
100
100
  ##
101
101
 
102
102
 
103
- class AsDict:
104
- def as_dict(self): # type: () -> dict[str, object]
105
- raise TypeError
103
+ class AttrsClass:
104
+ __attrs__ = () # type: tuple[str, ...]
105
+
106
+ def __repr__(self) -> str:
107
+ return _attr_repr(self, *self.__attrs__)
108
+
109
+ def attrs_dict(self): # type: () -> dict[str, object]
110
+ return {a: getattr(self, a) for a in self.__attrs__}
106
111
 
107
112
  def replace(self, **kwargs):
108
- return self.__class__(**{**self.as_dict(), **kwargs})
113
+ return self.__class__(**{**self.attrs_dict(), **kwargs})
109
114
 
110
115
 
111
116
  class AsJson:
@@ -116,7 +121,7 @@ class AsJson:
116
121
  ##
117
122
 
118
123
 
119
- class RunEnv(AsJson):
124
+ class RunEnv(AttrsClass, AsJson):
120
125
  def __init__(
121
126
  self,
122
127
  *,
@@ -171,7 +176,7 @@ class RunEnv(AsJson):
171
176
  sys_path = list(sys.path)
172
177
  self._sys_path = sys_path
173
178
 
174
- _ATTRS = (
179
+ __attrs__ = (
175
180
  'argv',
176
181
  'orig_argv',
177
182
 
@@ -186,12 +191,6 @@ class RunEnv(AsJson):
186
191
  'sys_path',
187
192
  )
188
193
 
189
- def as_json(self): # type: () -> dict[str, object]
190
- return {a: getattr(self, a) for a in self._ATTRS}
191
-
192
- def __repr__(self) -> str:
193
- return _attr_repr(self, *self._ATTRS)
194
-
195
194
  @property
196
195
  def argv(self): # type: () -> list[str]
197
196
  return self._argv
@@ -228,6 +227,9 @@ class RunEnv(AsJson):
228
227
  def sys_path(self): # type: () -> list[str]
229
228
  return self._sys_path
230
229
 
230
+ def as_json(self): # type: () -> dict[str, object]
231
+ return self.attrs_dict()
232
+
231
233
 
232
234
  ##
233
235
 
@@ -495,7 +497,7 @@ def render_args(args): # type: (list[Arg]) -> list[str]
495
497
  ##
496
498
 
497
499
 
498
- class Target(AsDict, AsJson):
500
+ class Target(AttrsClass, AsJson):
499
501
  pass
500
502
 
501
503
 
@@ -530,16 +532,10 @@ class FileTarget(UserTarget):
530
532
  def file(self) -> str:
531
533
  return self._file
532
534
 
533
- _ATTRS = ('file', 'argv')
534
-
535
- def __repr__(self) -> str:
536
- return _attr_repr(self, *self._ATTRS)
537
-
538
- def as_dict(self): # type: () -> dict[str, object]
539
- return _attr_dict(self, *self._ATTRS)
535
+ __attrs__ = ('file', 'argv')
540
536
 
541
537
  def as_json(self): # type: () -> dict[str, object]
542
- return self.as_dict()
538
+ return self.attrs_dict()
543
539
 
544
540
 
545
541
  class ModuleTarget(UserTarget):
@@ -556,16 +552,10 @@ class ModuleTarget(UserTarget):
556
552
  def module(self) -> str:
557
553
  return self._module
558
554
 
559
- _ATTRS = ('module', 'argv')
560
-
561
- def __repr__(self) -> str:
562
- return _attr_repr(self, *self._ATTRS)
563
-
564
- def as_dict(self): # type: () -> dict[str, object]
565
- return _attr_dict(self, *self._ATTRS)
555
+ __attrs__ = ('module', 'argv')
566
556
 
567
557
  def as_json(self): # type: () -> dict[str, object]
568
- return self.as_dict()
558
+ return self.attrs_dict()
569
559
 
570
560
 
571
561
  #
@@ -604,13 +594,7 @@ class DebuggerTarget(PycharmTarget):
604
594
  def target(self) -> Target:
605
595
  return self._target
606
596
 
607
- _ATTRS = ('file', 'args', 'target')
608
-
609
- def __repr__(self) -> str:
610
- return _attr_repr(self, *self._ATTRS)
611
-
612
- def as_dict(self): # type: () -> dict[str, object]
613
- return _attr_dict(self, *self._ATTRS)
597
+ __attrs__ = ('file', 'args', 'target')
614
598
 
615
599
  def as_json(self): # type: () -> dict[str, object]
616
600
  return {
@@ -662,13 +646,7 @@ class TestRunnerTarget(PycharmTarget):
662
646
  def tests(self): # type: () -> list[Test]
663
647
  return self._tests
664
648
 
665
- _ATTRS = ('file', 'args', 'tests')
666
-
667
- def __repr__(self) -> str:
668
- return _attr_repr(self, *self._ATTRS)
669
-
670
- def as_dict(self): # type: () -> dict[str, object]
671
- return _attr_dict(self, *self._ATTRS)
649
+ __attrs__ = ('file', 'args', 'tests')
672
650
 
673
651
  def as_json(self): # type: () -> dict[str, object]
674
652
  return {
@@ -884,7 +862,7 @@ def render_target_args(tgt): # type: (Target) -> list[str]
884
862
  ##
885
863
 
886
864
 
887
- class Exec(AsDict, AsJson):
865
+ class Exec(AttrsClass, AsJson):
888
866
  def __init__(
889
867
  self,
890
868
  exe: str,
@@ -909,13 +887,7 @@ class Exec(AsDict, AsJson):
909
887
  def target(self) -> Target:
910
888
  return self._target
911
889
 
912
- _ATTRS = ('exe', 'exe_args', 'target')
913
-
914
- def __repr__(self) -> str:
915
- return _attr_repr(self, *self._ATTRS)
916
-
917
- def as_dict(self): # type: () -> dict[str, object]
918
- return _attr_dict(self, *self._ATTRS)
890
+ __attrs__ = ('exe', 'exe_args', 'target')
919
891
 
920
892
  def as_json(self): # type: () -> dict[str, object]
921
893
  return {
@@ -979,7 +951,7 @@ def render_exec_args(exe): # type: (Exec) -> list[str]
979
951
  ##
980
952
 
981
953
 
982
- class ExecDecision(AsDict, AsJson):
954
+ class ExecDecision(AttrsClass, AsJson):
983
955
  def __init__(
984
956
  self,
985
957
  target: Target,
@@ -1020,7 +992,7 @@ class ExecDecision(AsDict, AsJson):
1020
992
  def os_exec(self) -> bool:
1021
993
  return self._os_exec
1022
994
 
1023
- _ATTRS = (
995
+ __attrs__ = (
1024
996
  'target',
1025
997
  'cwd',
1026
998
  'python_path',
@@ -1028,12 +1000,6 @@ class ExecDecision(AsDict, AsJson):
1028
1000
  'os_exec',
1029
1001
  )
1030
1002
 
1031
- def __repr__(self) -> str:
1032
- return _attr_repr(self, *self._ATTRS)
1033
-
1034
- def as_dict(self): # type: () -> dict[str, object]
1035
- return _attr_dict(self, *self._ATTRS)
1036
-
1037
1003
  def as_json(self): # type: () -> dict[str, object]
1038
1004
  return {
1039
1005
  'target': self._target.as_json(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev67
3
+ Version: 0.0.0.dev68
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=TXvFdkAU0Zr2FKdo7fyvt9nr3UjCtrnAZ0diZXSAteE,1430
2
- omlish/__about__.py,sha256=GBJLEW2X4D4jw_aYUOp97zWZQ0xVb4LJGcqAd4jBtnk,3420
2
+ omlish/__about__.py,sha256=Lo42shN4zusm7eF0NYiY81TzhZ8cDCXTIRZnGyGtd-Q,3420
3
3
  omlish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  omlish/argparse.py,sha256=Dc73G8lyoQBLvXhMYUbzQUh4SJu_OTvKUXjSUxq_ang,7499
5
5
  omlish/c3.py,sha256=4vogWgwPb8TbNS2KkZxpoWbwjj7MuHG2lQG-hdtkvjI,8062
@@ -149,7 +149,7 @@ omlish/dataclasses/impl/repr.py,sha256=oLXBTxqp88NKmz82HrJeGiTEiwK4l5LlXQT9Q0-tX
149
149
  omlish/dataclasses/impl/simple.py,sha256=EovA-GpmQYtB_svItO2byTAWqbKGF4njz0MdQts3QBU,3157
150
150
  omlish/dataclasses/impl/slots.py,sha256=_sm-x9v1tPnXEHBHNUMTHZocgVyhZaPdvamIPPBUVyk,2635
151
151
  omlish/dataclasses/impl/utils.py,sha256=aER2iL3UAtgS1BdLuEvTr9Tr2wC28wk1kiOeO-jIymw,6138
152
- omlish/diag/__init__.py,sha256=BYQoq12W2qU0O7m2Z-RLCX6YLIYEW9MmfN7_i9--Yk0,132
152
+ omlish/diag/__init__.py,sha256=4S8v0myJM4Zld6_FV6cPe_nSv0aJb6kXftEit0HkiGE,1141
153
153
  omlish/diag/asts.py,sha256=BveUUNUcaAm4Hg55f4ZxGSI313E4L8cCZ5XjHpEkKVI,3325
154
154
  omlish/diag/debug.py,sha256=YPzQXiBAJMYHYpBKzx0QhlLMZokjR5kkAVLodA3yddQ,424
155
155
  omlish/diag/procfs.py,sha256=vBovaMvAUKdl7FbtFq3TNsSmdhs8DaYfhoEsKeWYta8,9704
@@ -158,7 +158,7 @@ omlish/diag/ps.py,sha256=1JWxZen3fVG-20R6ZZ8BtO_gpzw_5bhHZiKdoHkgxoU,1004
158
158
  omlish/diag/pydevd.py,sha256=Fsx9rfCOnwLD6RLBqH0uAdtq75rbNeBAQfiDvIBd3e0,7295
159
159
  omlish/diag/threads.py,sha256=1-x02VCDZ407gfbtXm1pWK-ubqhqfePm9PMqkHCVoqk,3642
160
160
  omlish/diag/_pycharm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
- omlish/diag/_pycharm/runhack.py,sha256=PCH6K4yT1di3n5q9d1nqUQWHZRcEOi3piGKXPjVDb38,35428
161
+ omlish/diag/_pycharm/runhack.py,sha256=LFxuv7WibkC6Q7JmcKtPdytzinYFMZWqjane7YjPiVI,34463
162
162
  omlish/diag/pycharm/__init__.py,sha256=sT-ub7flKeCCbM_i32z9-eGV8hgGJ45hwdcqtGDkVRY,153
163
163
  omlish/diag/pycharm/cli.py,sha256=7SRh6yj8S5YGda4bq9BD4Kzwtgg4_Wa-K202ReZN2iI,1011
164
164
  omlish/diag/pycharm/pycharm.py,sha256=g-IfF8FBH93o6k_KDrLy8kIiFSLe3n39I2URipfFy0Q,3115
@@ -412,9 +412,9 @@ omlish/text/delimit.py,sha256=ubPXcXQmtbOVrUsNh5gH1mDq5H-n1y2R4cPL5_DQf68,4928
412
412
  omlish/text/glyphsplit.py,sha256=Ug-dPRO7x-OrNNr8g1y6DotSZ2KH0S-VcOmUobwa4B0,3296
413
413
  omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
414
414
  omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
415
- omlish-0.0.0.dev67.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
416
- omlish-0.0.0.dev67.dist-info/METADATA,sha256=hkhdhVlLm3TrbEEx22WjxDY4HDUOG_i2F--9ZwlK-ZE,4167
417
- omlish-0.0.0.dev67.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
418
- omlish-0.0.0.dev67.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
419
- omlish-0.0.0.dev67.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
420
- omlish-0.0.0.dev67.dist-info/RECORD,,
415
+ omlish-0.0.0.dev68.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
416
+ omlish-0.0.0.dev68.dist-info/METADATA,sha256=dB7UaEa5BlDr9UDJLwPaobs83TJrglLK7JxNHdDYlAI,4167
417
+ omlish-0.0.0.dev68.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
418
+ omlish-0.0.0.dev68.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
419
+ omlish-0.0.0.dev68.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
420
+ omlish-0.0.0.dev68.dist-info/RECORD,,