mdify-cli 2.10.0__tar.gz → 2.10.1__tar.gz

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: mdify-cli
3
- Version: 2.10.0
3
+ Version: 2.10.1
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -1,3 +1,3 @@
1
1
  """mdify - Convert documents to Markdown via Docling container."""
2
2
 
3
- __version__ = "2.10.0"
3
+ __version__ = "2.10.1"
@@ -294,8 +294,10 @@ def check_image_exists(runtime: str, image: str) -> bool:
294
294
  try:
295
295
  images = json.loads(result.stdout.decode())
296
296
  # Check if image exists in the list
297
+ # Apple Container returns format: [{"reference": "image:tag", "descriptor": {...}}]
297
298
  for img in images:
298
- if img.get("name") == image or image in img.get("repoTags", []):
299
+ reference = img.get("reference", "")
300
+ if reference == image or reference.startswith(f"{image}:"):
299
301
  return True
300
302
  except json.JSONDecodeError:
301
303
  pass
@@ -813,6 +815,10 @@ def main() -> int:
813
815
 
814
816
  image_exists = check_image_exists(runtime, image)
815
817
 
818
+ if not args.quiet and image_exists:
819
+ print(f"Using cached image: {image}")
820
+ print()
821
+
816
822
  # NOTE: Docker Desktop on macOS/Windows uses a VM, so disk space checks may not
817
823
  # accurately reflect available space in the container's filesystem. Remote Docker
818
824
  # daemons (DOCKER_HOST) are also not supported. In these cases, the check will
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 2.10.0
3
+ Version: 2.10.1
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mdify-cli"
3
- version = "2.10.0"
3
+ version = "2.10.1"
4
4
  description = "Convert PDFs and document images into structured Markdown for LLM workflows"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -995,12 +995,19 @@ class TestContainerRuntime:
995
995
  """Test check_image_exists uses 'image list' for Apple Container."""
996
996
  mock_result = Mock()
997
997
  mock_result.returncode = 0
998
+ # Use actual Apple Container response format with 'reference' field
998
999
  mock_result.stdout = json.dumps([
999
- {"name": "test-image", "repoTags": ["test-image:latest"]},
1000
- {"name": "other-image", "repoTags": ["other-image:latest"]}
1000
+ {
1001
+ "reference": "ghcr.io/docling-project/docling-serve-cpu:main",
1002
+ "descriptor": {
1003
+ "size": 1609,
1004
+ "mediaType": "application/vnd.oci.image.index.v1+json",
1005
+ "digest": "sha256:25e82dfa30371d17a0af17edc42261a4b9bedb37f0f337887c366184bc3ee291"
1006
+ }
1007
+ }
1001
1008
  ]).encode()
1002
1009
  with patch("mdify.cli.subprocess.run", return_value=mock_result) as mock_run:
1003
- result = check_image_exists("/usr/local/bin/container", "test-image")
1010
+ result = check_image_exists("/usr/local/bin/container", "ghcr.io/docling-project/docling-serve-cpu:main")
1004
1011
  assert result is True
1005
1012
  mock_run.assert_called_once_with(
1006
1013
  ["/usr/local/bin/container", "image", "list", "--format", "json"],
@@ -1013,10 +1020,17 @@ class TestContainerRuntime:
1013
1020
  mock_result = Mock()
1014
1021
  mock_result.returncode = 0
1015
1022
  mock_result.stdout = json.dumps([
1016
- {"name": "other-image", "repoTags": ["other-image:latest"]}
1023
+ {
1024
+ "reference": "ghcr.io/other-project/other-image:latest",
1025
+ "descriptor": {
1026
+ "size": 1234,
1027
+ "mediaType": "application/vnd.oci.image.index.v1+json",
1028
+ "digest": "sha256:abcd1234"
1029
+ }
1030
+ }
1017
1031
  ]).encode()
1018
1032
  with patch("mdify.cli.subprocess.run", return_value=mock_result):
1019
- result = check_image_exists("/usr/local/bin/container", "test-image")
1033
+ result = check_image_exists("/usr/local/bin/container", "ghcr.io/docling-project/docling-serve-cpu:main")
1020
1034
  assert result is False
1021
1035
 
1022
1036
 
File without changes
File without changes
File without changes
File without changes
File without changes