dycw-utilities 0.166.9__py3-none-any.whl → 0.166.10__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.166.9
3
+ Version: 0.166.10
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=mNdgDKPJB1m562MXyEVPLbFgwRGfqrm5zcP056ww7uQ,60
1
+ utilities/__init__.py,sha256=qF1Ri_H67zA2CqTmHkYAittQhN7YVEOKoTOqGPnB2ok,61
2
2
  utilities/aeventkit.py,sha256=ddoleSwW9zdc2tjX5Ge0pMKtYwV_JMxhHYOxnWX2AGM,12609
3
3
  utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
4
4
  utilities/asyncio.py,sha256=PUedzQ5deqlSECQ33sam9cRzI9TnygHz3FdOqWJWPTM,15288
@@ -43,7 +43,7 @@ utilities/optuna.py,sha256=C-fhWYiXHVPo1l8QctYkFJ4DyhbSrGorzP1dJb_qvd8,1933
43
43
  utilities/orjson.py,sha256=rII_rINPcH9X0CfL_WeFjwHgKNkKAF-TVS5rnpLHjzc,41998
44
44
  utilities/os.py,sha256=8TjFLVWlGhhEpzZ0X_vNAyhYntjeVL5WTwaQcdTaNVw,3934
45
45
  utilities/parse.py,sha256=JcJn5yXKhIWXBCwgBdPsyu7Hvcuw6kyEdqvaebCaI9k,17951
46
- utilities/pathlib.py,sha256=qGuU8XPmdgGpy8tOMUgelfXx3kxI8h9IaV3TI_06QGE,8428
46
+ utilities/pathlib.py,sha256=YMcWbIwyWN7DAKrkwgHzQoS8BpcWMoJltN9Nb8Knw3Y,8915
47
47
  utilities/pickle.py,sha256=MBT2xZCsv0pH868IXLGKnlcqNx2IRVKYNpRcqiQQqxw,653
48
48
  utilities/platform.py,sha256=pTn7gw6N4T6LdKrf0virwarof_mze9WtoQlrGMzhGVI,2798
49
49
  utilities/polars.py,sha256=FehlIHgHP-kvicBPSE6o-tswqUpRysA6epmkPrgHkGE,83239
@@ -91,8 +91,8 @@ utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
91
91
  utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
92
92
  utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
93
93
  utilities/pytest_plugins/pytest_regressions.py,sha256=9v8kAXDM2ycIXJBimoiF4EgrwbUvxTycFWJiGR_GHhM,1466
94
- dycw_utilities-0.166.9.dist-info/METADATA,sha256=ppZfK4QrngRPjFPFsH7UW-JgVsmvv2FVfVYFiHPL4Ak,1696
95
- dycw_utilities-0.166.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
- dycw_utilities-0.166.9.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
97
- dycw_utilities-0.166.9.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
98
- dycw_utilities-0.166.9.dist-info/RECORD,,
94
+ dycw_utilities-0.166.10.dist-info/METADATA,sha256=uEK_P-JUyB5EiGYGeDiVoVS1VVAFUK9-UFNVUCytedk,1697
95
+ dycw_utilities-0.166.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
+ dycw_utilities-0.166.10.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
97
+ dycw_utilities-0.166.10.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
98
+ dycw_utilities-0.166.10.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.166.9"
3
+ __version__ = "0.166.10"
utilities/pathlib.py CHANGED
@@ -94,15 +94,30 @@ def get_repo_root(path: MaybeCallablePathLike = Path.cwd, /) -> Path:
94
94
  # newer versions of git report "Not a git repository", whilst older
95
95
  # versions report "not a git repository"
96
96
  if search("fatal: not a git repository", error.stderr, flags=IGNORECASE):
97
- raise GetRepoRootError(path=path) from None
97
+ raise _GetRepoRootNotARepoError(path=path) from None
98
98
  raise # pragma: no cover
99
+ except FileNotFoundError as error: # pragma: no cover
100
+ if search("No such file or directory: 'git'", error.args[0], flags=IGNORECASE):
101
+ raise _GetRepoRootGitNotFoundError from None
102
+ raise
99
103
  else:
100
104
  return Path(output.strip("\n"))
101
105
 
102
106
 
103
107
  @dataclass(kw_only=True, slots=True)
104
- class GetRepoRootError(Exception):
105
- path: PathLike
108
+ class GetRepoRootError(Exception): ...
109
+
110
+
111
+ @dataclass(kw_only=True, slots=True)
112
+ class _GetRepoRootGitNotFoundError(GetRepoRootError):
113
+ @override
114
+ def __str__(self) -> str:
115
+ return "'git' not found"
116
+
117
+
118
+ @dataclass(kw_only=True, slots=True)
119
+ class _GetRepoRootNotARepoError(GetRepoRootError):
120
+ path: Path
106
121
 
107
122
  @override
108
123
  def __str__(self) -> str: