winipedia-utils 0.1.58__py3-none-any.whl → 0.1.60__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.

Potentially problematic release.


This version of winipedia-utils might be problematic. Click here for more details.

@@ -48,7 +48,9 @@ def _pre_commit_config_is_correct() -> bool:
48
48
  """Check if the pre-commit config is correct."""
49
49
  config = load_pre_commit_config()
50
50
  package_hook_config = _get_pre_commit_config_dict().get("hooks", [{}])[0]
51
- return bool(config.get("repos", [{}])[0].get("hooks", [{}])[0] == package_hook_config)
51
+ return bool(
52
+ config.get("repos", [{}])[0].get("hooks", [{}])[0] == package_hook_config
53
+ )
52
54
 
53
55
 
54
56
  def _add_package_hook_to_pre_commit_config() -> None:
winipedia_utils/os/os.py CHANGED
@@ -11,11 +11,12 @@ from pathlib import Path
11
11
  from typing import Any
12
12
 
13
13
 
14
- def which_with_raise(cmd: str) -> str:
14
+ def which_with_raise(cmd: str, *, raise_error: bool = True) -> str | None:
15
15
  """Give the path to the given command.
16
16
 
17
17
  Args:
18
18
  cmd: The command to find
19
+ raise_error: Whether to raise an error if the command is not found
19
20
 
20
21
  Returns:
21
22
  The path to the command
@@ -27,7 +28,8 @@ def which_with_raise(cmd: str) -> str:
27
28
  path = shutil.which(cmd)
28
29
  if path is None:
29
30
  msg = f"Command {cmd} not found"
30
- raise FileNotFoundError(msg)
31
+ if raise_error:
32
+ raise FileNotFoundError(msg)
31
33
  return path
32
34
 
33
35
 
@@ -11,7 +11,8 @@ from winipedia_utils.os.os import run_subprocess, which_with_raise
11
11
 
12
12
  logger = get_logger(__name__)
13
13
 
14
- POETRY_PATH = which_with_raise("poetry")
14
+
15
+ POETRY_PATH = which_with_raise("poetry", raise_error=False) or "poetry"
15
16
 
16
17
  POETRY_RUN_ARGS = [POETRY_PATH, "run"]
17
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: winipedia-utils
3
- Version: 0.1.58
3
+ Version: 0.1.60
4
4
  Summary: A package with many utility functions
5
5
  License: MIT
6
6
  Author: Winipedia
@@ -14,7 +14,7 @@ winipedia_utils/git/__init__.py,sha256=pPo5DDqaQkFim8L6x22DXjqthLnKAxLyXlXl7JXGU
14
14
  winipedia_utils/git/gitignore/__init__.py,sha256=t65uvpOaNvh7ICgwuJFRr7vS2nWfxzWUGIpnJs0_jzE,58
15
15
  winipedia_utils/git/gitignore/gitignore.py,sha256=wCU2lRztTFKQ7JrKnCqPLCsuVRjfx8wGfTy42BLgFJI,4512
16
16
  winipedia_utils/git/pre_commit/__init__.py,sha256=2sBe5nOqmm3qb8YjhZzE4tCHhqxWOZ6R2ECljSVG7i4,59
17
- winipedia_utils/git/pre_commit/config.py,sha256=wm6jFSwB6nnWh6pxhgUf60uRStcHSYJGj3q7BC9Uks4,2316
17
+ winipedia_utils/git/pre_commit/config.py,sha256=bIncUO4et0B5XYPUlSJskl_8Lg6si45ALyM9cEVJpfU,2332
18
18
  winipedia_utils/git/pre_commit/hooks.py,sha256=Q6rXvbpUf9UasQ8vSBruoLA-wjm37jamvIUkXJ1B3FE,3210
19
19
  winipedia_utils/git/pre_commit/run_hooks.py,sha256=WoF1WDr07mS2GpKt0M-TpnuWfS0-Hwa4tP6z_9-JqlU,1572
20
20
  winipedia_utils/iterating/__init__.py,sha256=TZ0SSFA3zCJLk0z3IsLMxJqsfGzfxOSUKbQmwW-Dsqg,54
@@ -33,11 +33,11 @@ winipedia_utils/oop/mixins/__init__.py,sha256=PDK-cJcdRUfDUCz36qQ5pmMW07G133WtN4
33
33
  winipedia_utils/oop/mixins/meta.py,sha256=ajSlKTDqNYbPc3vAin84dWVG3R7ZaBEwga1e3Mzm-Gw,11309
34
34
  winipedia_utils/oop/mixins/mixin.py,sha256=sFImqDFX0TtdAAYHgepVT_UqJ50juvDdwGG9vMNa3PE,1438
35
35
  winipedia_utils/os/__init__.py,sha256=WSLt7tb6HqWRlCGGIEwRfVksF0sLJNeEW3iZeJhGWk0,47
36
- winipedia_utils/os/os.py,sha256=ITuiLLfjGBV2jH8tHQfwVzsICT-jY1zUxtwu3ASJBG4,1690
36
+ winipedia_utils/os/os.py,sha256=CXPVnagfj3dXlc8OIv1DirJpin8oaGXWetnmx2lULE4,1831
37
37
  winipedia_utils/projects/__init__.py,sha256=6oTiSlUMAwO5xnH4SGVnvspzKcxrxo9kn1L4xkjq1p8,53
38
38
  winipedia_utils/projects/poetry/__init__.py,sha256=0yNMuu9KmM19od4VBxBV3HLK-RdCsa0e2Zhg33J7RmQ,60
39
39
  winipedia_utils/projects/poetry/config.py,sha256=ghJzlNDVrSfG5Mg0JjnL9Xmz6fVD-rAHl41tjbFUBb8,2993
40
- winipedia_utils/projects/poetry/poetry.py,sha256=5jyUSMxhCZ7pz9bOaz5E9r7Da9qIrGOp6wcBzI1y7Cg,932
40
+ winipedia_utils/projects/poetry/poetry.py,sha256=QoQ-b8NgMiWaqq85gs2HZh_436VpNqKzGogrWPS5DrU,965
41
41
  winipedia_utils/projects/project.py,sha256=2nz1Hh51A-shjgdPCgiDw-ODrVtOtiHEHQnMPjAJZ-A,1587
42
42
  winipedia_utils/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
43
43
  winipedia_utils/pyside/__init__.py,sha256=knliQxknKWqxCEfxlI1K02OtbBfnTkYUZFqyYcLJNDI,52
@@ -94,7 +94,7 @@ winipedia_utils/testing/tests/base/utils/utils.py,sha256=dUPDrgAxlfREQb33zz23Mfz
94
94
  winipedia_utils/testing/tests/conftest.py,sha256=8RounBlI8Jq1aLaLNpv84MW4ne8Qq0aavQextDOp5ng,920
95
95
  winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
96
96
  winipedia_utils/text/string.py,sha256=pK_VQXxSZa8HqHY1a6oMKfmN-OKteFE32eZaweCI22E,3508
97
- winipedia_utils-0.1.58.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
98
- winipedia_utils-0.1.58.dist-info/METADATA,sha256=lVhQy8rZcm3EAUxq49vnH8157qNr-4-SahRBLNk5cPE,12576
99
- winipedia_utils-0.1.58.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
100
- winipedia_utils-0.1.58.dist-info/RECORD,,
97
+ winipedia_utils-0.1.60.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
98
+ winipedia_utils-0.1.60.dist-info/METADATA,sha256=ppNOIOy5iJyYteOhpFQYmveOH9n66IdigHgxeFc1k5M,12576
99
+ winipedia_utils-0.1.60.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
100
+ winipedia_utils-0.1.60.dist-info/RECORD,,