dycw-utilities 0.135.1__py3-none-any.whl → 0.135.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.135.1
3
+ Version: 0.135.2
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=fd7dlmu-Le53NgKruzJmKZxnXhzb2Q5mfIFs0t3mJlI,60
1
+ utilities/__init__.py,sha256=dS9-gVIgJGzS5CZL-BTK1_FXZj4N7p0SWBqVdZrhTN4,60
2
2
  utilities/aiolimiter.py,sha256=mD0wEiqMgwpty4XTbawFpnkkmJS6R4JRsVXFUaoitSU,628
3
3
  utilities/altair.py,sha256=HeZBVUocjkrTNwwKrClppsIqgNFF-ykv05HfZSoHYno,9104
4
4
  utilities/arq.py,sha256=S-sfBfY-E1ErRKf4sSXt2YyCjKvu-pBlOECDfjBebRA,6399
@@ -78,7 +78,7 @@ utilities/tempfile.py,sha256=VqmZJAhTJ1OaVywFzk5eqROV8iJbW9XQ_QYAV0bpdRo,1384
78
78
  utilities/text.py,sha256=ymBFlP_cA8OgNnZRVNs7FAh7OG8HxE6YkiLEMZv5g_A,11297
79
79
  utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
80
80
  utilities/timer.py,sha256=oXfTii6ymu57niP0BDGZjFD55LEHi2a19kqZKiTgaFQ,2588
81
- utilities/traceback.py,sha256=i-790AQbTrDA8MiYyOcYPFpm48I558VR_kL_7x4ypfY,8503
81
+ utilities/traceback.py,sha256=TR-3XD40fVIfPT4TSX6E92BEl3xze03N_G4iEE8Qy-4,8837
82
82
  utilities/typed_settings.py,sha256=niNxgvVKrTy1c0j0D0Jp2tO3m231f4yJJ-38ni-xY3Q,3739
83
83
  utilities/types.py,sha256=DrFWZQqpkekHdnr2-G2eBaxGX8FoND6ON2XFRvhm8Jo,17177
84
84
  utilities/typing.py,sha256=Z-_XDaWyT_6wIo3qfNK-hvRlzxP2Jxa9PgXzm5rDYRA,13790
@@ -90,7 +90,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
90
90
  utilities/whenever.py,sha256=A-yoOqBqrcVD1yDINDsTFDw7dq9-zgUGn_f8CxVUQJs,23332
91
91
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
92
92
  utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
93
- dycw_utilities-0.135.1.dist-info/METADATA,sha256=tswCMdL1NHJH_VeKHYyY6tEZbGnOGzFlN45k2iOhJls,1584
94
- dycw_utilities-0.135.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
- dycw_utilities-0.135.1.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
96
- dycw_utilities-0.135.1.dist-info/RECORD,,
93
+ dycw_utilities-0.135.2.dist-info/METADATA,sha256=H4xe_yx3Eh17ngKfl6qkcPUlFUSeNYZmbfaf9IT1Kqs,1584
94
+ dycw_utilities-0.135.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
+ dycw_utilities-0.135.2.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
96
+ dycw_utilities-0.135.2.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.135.1"
3
+ __version__ = "0.135.2"
utilities/traceback.py CHANGED
@@ -16,6 +16,7 @@ from typing import TYPE_CHECKING, override
16
16
  from utilities.atomicwrites import writer
17
17
  from utilities.errors import repr_error
18
18
  from utilities.iterables import OneEmptyError, one
19
+ from utilities.os import get_env_var
19
20
  from utilities.pathlib import get_path
20
21
  from utilities.reprlib import (
21
22
  RICH_EXPAND_ALL,
@@ -202,6 +203,7 @@ def make_except_hook(
202
203
  max_depth: int | None = RICH_MAX_DEPTH,
203
204
  expand_all: bool = RICH_EXPAND_ALL,
204
205
  slack_url: str | None = None,
206
+ pudb_env_var: str | None = None,
205
207
  ) -> Callable[
206
208
  [type[BaseException] | None, BaseException | None, TracebackType | None], None
207
209
  ]:
@@ -218,6 +220,7 @@ def make_except_hook(
218
220
  max_depth=max_depth,
219
221
  expand_all=expand_all,
220
222
  slack_url=slack_url,
223
+ pudb_env_var=pudb_env_var,
221
224
  )
222
225
 
223
226
 
@@ -237,6 +240,7 @@ def _make_except_hook_inner(
237
240
  max_depth: int | None = RICH_MAX_DEPTH,
238
241
  expand_all: bool = RICH_EXPAND_ALL,
239
242
  slack_url: str | None = None,
243
+ pudb_env_var: str | None = None,
240
244
  ) -> None:
241
245
  """Exception hook to log the traceback."""
242
246
  _ = (exc_type, traceback)
@@ -268,6 +272,12 @@ def _make_except_hook_inner(
268
272
 
269
273
  send = f"```{slim}```"
270
274
  run(send_to_slack(slack_url, send))
275
+ if (pudb_env_var is not None) and ( # pragma: no cover
276
+ get_env_var(pudb_env_var, nullable=True) is not None
277
+ ):
278
+ from pudb import post_mortem
279
+
280
+ post_mortem()
271
281
 
272
282
 
273
283
  @dataclass(kw_only=True, slots=True)