dycw-utilities 0.175.30__py3-none-any.whl → 0.175.32__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.3
2
2
  Name: dycw-utilities
3
- Version: 0.175.30
3
+ Version: 0.175.32
4
4
  Summary: Miscellaneous Python utilities
5
5
  Author: Derek Wan
6
6
  Author-email: Derek Wan <d.wan@icloud.com>
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=MtsJJrbSJrW256hO7llrT3qk9914hd3MBaFYuonK4KU,61
1
+ utilities/__init__.py,sha256=7U4Xd87qzllL41jIo34W_Ske0_0FA06dOeqtqpEx2p8,61
2
2
  utilities/altair.py,sha256=TLfRFbG9HwG7SLXoJ-v0r-t49ZaGgTQZD82cpjVi4vs,9085
3
3
  utilities/asyncio.py,sha256=aJySVxBY0gqsIYnoNmH7-1r8djKuf4vSsU69VCD08t8,16772
4
4
  utilities/atomicwrites.py,sha256=tPo6r-Rypd9u99u66B9z86YBPpnLrlHtwox_8Z7T34Y,5790
@@ -11,7 +11,7 @@ utilities/contextvars.py,sha256=J8OhC7jqozAGYOCe2KUWysbPXNGe5JYz3HfaY_mIs08,883
11
11
  utilities/cryptography.py,sha256=5PFrzsNUGHay91dFgYnDKwYprXxahrBqztmUqViRzBk,956
12
12
  utilities/cvxpy.py,sha256=Rv1-fD-XYerosCavRF8Pohop2DBkU3AlFaGTfD8AEAA,13776
13
13
  utilities/dataclasses.py,sha256=xbU3QN1GFy7RC6hIJRZIeUZm7YRlodrgEWmahWG6k2g,32465
14
- utilities/docker.py,sha256=nzeuR5-OQKL2yhtY-SSqLS2ftl-iev0cUrshwEMwB2k,9808
14
+ utilities/docker.py,sha256=0OQdmMvB_cgtRpUoWH98IMzlQyrcxEekGmgWvd8UUt4,10675
15
15
  utilities/enum.py,sha256=5l6pwZD1cjSlVW4ss-zBPspWvrbrYrdtJWcg6f5_J5w,5781
16
16
  utilities/errors.py,sha256=mFlDGSM0LI1jZ1pbqwLAH3ttLZ2JVIxyZLojw8tGVZU,1479
17
17
  utilities/fastapi.py,sha256=TqyKvBjiMS594sXPjrz-KRTLMb3l3D3rZ1zAYV7GfOk,1454
@@ -97,7 +97,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
97
97
  utilities/whenever.py,sha256=F4ek0-OBWxHYrZdmoZt76N2RnNyKY5KrEHt7rqO4AQE,60183
98
98
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
99
99
  utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
100
- dycw_utilities-0.175.30.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
101
- dycw_utilities-0.175.30.dist-info/entry_points.txt,sha256=cOGtKeJI0KXLSV7MJ8Dhc2G8jPgDcBDm53MVNJU4ycI,136
102
- dycw_utilities-0.175.30.dist-info/METADATA,sha256=X2Hiaa6YhG9ZkFu1AfxlEDbXKDKYepqcVZylTh5hVds,1443
103
- dycw_utilities-0.175.30.dist-info/RECORD,,
100
+ dycw_utilities-0.175.32.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
101
+ dycw_utilities-0.175.32.dist-info/entry_points.txt,sha256=cOGtKeJI0KXLSV7MJ8Dhc2G8jPgDcBDm53MVNJU4ycI,136
102
+ dycw_utilities-0.175.32.dist-info/METADATA,sha256=Ydsvjv-Zb-V82ofDdKk1xhFSi7SsViGqFXBPHOp-clE,1443
103
+ dycw_utilities-0.175.32.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.175.30"
3
+ __version__ = "0.175.32"
utilities/docker.py CHANGED
@@ -28,9 +28,18 @@ if TYPE_CHECKING:
28
28
  )
29
29
 
30
30
 
31
- def docker_compose_down(*, files: MaybeIterable[PathLike] | None = None) -> None:
31
+ def docker_compose_down(
32
+ *,
33
+ files: MaybeIterable[PathLike] | None = None,
34
+ print: bool = False, # noqa: A002
35
+ print_stdout: bool = False,
36
+ print_stderr: bool = False,
37
+ ) -> None:
32
38
  """Stop and remove containers."""
33
- run(*docker_compose_down_cmd(files=files)) # pragma: no cover
39
+ args = docker_compose_down_cmd(files=files) # pragma: no cover
40
+ run( # pragma: no cover
41
+ *args, print=print, print_stdout=print_stdout, print_stderr=print_stderr
42
+ )
34
43
 
35
44
 
36
45
  def docker_compose_down_cmd(
@@ -40,9 +49,18 @@ def docker_compose_down_cmd(
40
49
  return _docker_compose_cmd("down", files=files)
41
50
 
42
51
 
43
- def docker_compose_pull(*, files: MaybeIterable[PathLike] | None = None) -> None:
52
+ def docker_compose_pull(
53
+ *,
54
+ files: MaybeIterable[PathLike] | None = None,
55
+ print: bool = False, # noqa: A002
56
+ print_stdout: bool = False,
57
+ print_stderr: bool = False,
58
+ ) -> None:
44
59
  """Pull service images."""
45
- run(*docker_compose_pull_cmd(files=files)) # pragma: no cover
60
+ args = docker_compose_pull_cmd(files=files) # pragma: no cover
61
+ run( # pragma: no cover
62
+ *args, print=print, print_stdout=print_stdout, print_stderr=print_stderr
63
+ )
46
64
 
47
65
 
48
66
  def docker_compose_pull_cmd(
@@ -52,24 +70,39 @@ def docker_compose_pull_cmd(
52
70
  return _docker_compose_cmd("pull", files=files)
53
71
 
54
72
 
55
- def docker_compose_up(*, files: MaybeIterable[PathLike] | None = None) -> None:
73
+ def docker_compose_up(
74
+ *,
75
+ files: MaybeIterable[PathLike] | None = None,
76
+ detach: bool = True,
77
+ print: bool = False, # noqa: A002
78
+ print_stdout: bool = False,
79
+ print_stderr: bool = False,
80
+ ) -> None:
56
81
  """Create and start containers."""
57
- run(*docker_compose_up_cmd(files=files)) # pragma: no cover
82
+ args = docker_compose_up_cmd(files=files, detach=detach) # pragma: no cover
83
+ run( # pragma: no cover
84
+ *args, print=print, print_stdout=print_stdout, print_stderr=print_stderr
85
+ )
58
86
 
59
87
 
60
- def docker_compose_up_cmd(*, files: MaybeIterable[PathLike] | None = None) -> list[str]:
88
+ def docker_compose_up_cmd(
89
+ *, files: MaybeIterable[PathLike] | None = None, detach: bool = True
90
+ ) -> list[str]:
61
91
  """Command to use 'docker compose up' to create and start containers."""
62
- return _docker_compose_cmd("up", files=files)
92
+ args: list[str] = []
93
+ if detach:
94
+ args.append("--detach")
95
+ return _docker_compose_cmd("up", *args, files=files)
63
96
 
64
97
 
65
98
  def _docker_compose_cmd(
66
- cmd: str, /, *, files: MaybeIterable[PathLike] | None = None
99
+ cmd: str, /, *args: str, files: MaybeIterable[PathLike] | None = None
67
100
  ) -> list[str]:
68
- args: list[str] = ["docker", "compose"]
101
+ all_args: list[str] = ["docker", "compose"]
69
102
  if files is not None:
70
103
  for file in always_iterable(files):
71
- args.extend(["--file", str(file)])
72
- return [*args, cmd]
104
+ all_args.extend(["--file", str(file)])
105
+ return [*all_args, cmd, *args]
73
106
 
74
107
 
75
108
  ##