mdify-cli 2.5.0__py3-none-any.whl → 2.6.0__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.
- mdify/__init__.py +1 -1
- mdify/container.py +35 -0
- {mdify_cli-2.5.0.dist-info → mdify_cli-2.6.0.dist-info}/METADATA +1 -1
- mdify_cli-2.6.0.dist-info/RECORD +12 -0
- mdify_cli-2.5.0.dist-info/RECORD +0 -12
- {mdify_cli-2.5.0.dist-info → mdify_cli-2.6.0.dist-info}/WHEEL +0 -0
- {mdify_cli-2.5.0.dist-info → mdify_cli-2.6.0.dist-info}/entry_points.txt +0 -0
- {mdify_cli-2.5.0.dist-info → mdify_cli-2.6.0.dist-info}/licenses/LICENSE +0 -0
- {mdify_cli-2.5.0.dist-info → mdify_cli-2.6.0.dist-info}/top_level.txt +0 -0
mdify/__init__.py
CHANGED
mdify/container.py
CHANGED
|
@@ -41,6 +41,39 @@ class DoclingContainer:
|
|
|
41
41
|
"""Return base URL for API requests."""
|
|
42
42
|
return f"http://localhost:{self.port}"
|
|
43
43
|
|
|
44
|
+
def _cleanup_stale_containers(self) -> None:
|
|
45
|
+
"""Stop any existing mdify-serve containers.
|
|
46
|
+
|
|
47
|
+
This handles the case where a previous run left a container running
|
|
48
|
+
(e.g., due to crash, interrupt, or timeout).
|
|
49
|
+
"""
|
|
50
|
+
# Find running containers matching mdify-serve-* pattern
|
|
51
|
+
result = subprocess.run(
|
|
52
|
+
[
|
|
53
|
+
self.runtime,
|
|
54
|
+
"ps",
|
|
55
|
+
"--filter",
|
|
56
|
+
"name=mdify-serve-",
|
|
57
|
+
"--format",
|
|
58
|
+
"{{.Names}}",
|
|
59
|
+
],
|
|
60
|
+
capture_output=True,
|
|
61
|
+
text=True,
|
|
62
|
+
check=False,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
if result.returncode != 0 or not result.stdout.strip():
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
# Stop each stale container
|
|
69
|
+
for container_name in result.stdout.strip().split("\n"):
|
|
70
|
+
if container_name:
|
|
71
|
+
subprocess.run(
|
|
72
|
+
[self.runtime, "stop", container_name],
|
|
73
|
+
capture_output=True,
|
|
74
|
+
check=False,
|
|
75
|
+
)
|
|
76
|
+
|
|
44
77
|
def start(self, timeout: int = 120) -> None:
|
|
45
78
|
"""Start container and wait for health check.
|
|
46
79
|
|
|
@@ -51,6 +84,8 @@ class DoclingContainer:
|
|
|
51
84
|
subprocess.CalledProcessError: If container fails to start
|
|
52
85
|
TimeoutError: If health check doesn't pass within timeout
|
|
53
86
|
"""
|
|
87
|
+
self._cleanup_stale_containers()
|
|
88
|
+
|
|
54
89
|
# Start container in detached mode
|
|
55
90
|
cmd = [
|
|
56
91
|
self.runtime,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
+
mdify/__init__.py,sha256=4mWutp3KF_BH9sz_oEPFBoN7Ee6vamK3cHDBpUtRQVY,90
|
|
3
|
+
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
+
mdify/cli.py,sha256=LqIibolYSKGCNYqxuIyFnvPkjJyNlXvfWeKaSaoOrqo,28542
|
|
5
|
+
mdify/container.py,sha256=tkk0nv7EquL-rKUY4nkS_yGITb7mqw8B7eEfuqaeVrg,5239
|
|
6
|
+
mdify/docling_client.py,sha256=_9qjL5yOOeJahOg6an2P6Iii1xkeR6wmNJZG4Q6NRkk,6553
|
|
7
|
+
mdify_cli-2.6.0.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
+
mdify_cli-2.6.0.dist-info/METADATA,sha256=NcyfsGSLiSkz0NkRdc6g5pOervCpXJbWEIDSPnYSvFk,7923
|
|
9
|
+
mdify_cli-2.6.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
mdify_cli-2.6.0.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
+
mdify_cli-2.6.0.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
+
mdify_cli-2.6.0.dist-info/RECORD,,
|
mdify_cli-2.5.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
-
mdify/__init__.py,sha256=lH-hnX0KOG9_zJ_QZ-A_kQFPYghziohhpm7nmxVZc7w,90
|
|
3
|
-
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
-
mdify/cli.py,sha256=LqIibolYSKGCNYqxuIyFnvPkjJyNlXvfWeKaSaoOrqo,28542
|
|
5
|
-
mdify/container.py,sha256=2oh9NyvFr9lCRb2YYpM_qKP3PPmAin0DbxvNP3m69jw,4158
|
|
6
|
-
mdify/docling_client.py,sha256=_9qjL5yOOeJahOg6an2P6Iii1xkeR6wmNJZG4Q6NRkk,6553
|
|
7
|
-
mdify_cli-2.5.0.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
-
mdify_cli-2.5.0.dist-info/METADATA,sha256=egwIWB2tV9F41fcUf3RvfszEJGb--AQVDN3ybI1FFt0,7923
|
|
9
|
-
mdify_cli-2.5.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
-
mdify_cli-2.5.0.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
-
mdify_cli-2.5.0.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
-
mdify_cli-2.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|