Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

chore: add .zcodeignore for build artifacts and temporary files

myhloli1aa76acf1cdc
diff --git a/.zcodeignore b/.zcodeignore
new file mode 100644
index 00000000..466c7449
--- /dev/null
+++ b/.zcodeignore
@@ -0,0 +1,100 @@
+*.tar
+*.tar.gz
+*.zip
+venv*/
+envs/
+slurm_logs/
+
+sync1.sh
+data_preprocess_pj1
+data-preparation1
+__pycache__
+*.log
+*.pyc
+.vscode
+debug/
+*.ipynb
+.idea
+
+# Python build artifacts
+*.egg-info/
+build/
+# PDF.js 的浏览器发行资源必须随源码提交。
+!mineru/resources/pdf_preview/vendor/pdfjs/legacy/build/
+mineru/resources/pdf_preview/vendor/pdfjs/legacy/build/*
+!mineru/resources/pdf_preview/vendor/pdfjs/legacy/build/pdf.min.mjs
+!mineru/resources/pdf_preview/vendor/pdfjs/legacy/build/pdf.worker.min.mjs
+dist/
+*.egg
+
+# vscode history
+.history
+
+.DS_Store
+.env
+
+bad_words/
+bak/
+
+app/tests/*
+temp/
+tmp/
+tmp
+.vscode
+.vscode/
+ocr_demo
+.coveragerc
+/app/common/__init__.py
+/magic_pdf/config/__init__.py
+source.dev.env
+
+tmp
+
+projects/web/node_modules
+projects/web/dist
+
+projects/web_demo/web_demo/static/
+cli_debug/
+debug_utils/
+
+# sphinx docs
+_build/
+
+
+output/
+.coverage
+
+# E2E 测试工作目录(.e2e/fixtures-cache 跨 session 复用)
+.e2e/
+
+htmlcov/
+.zcode/
+
+# ===== ↑ 以上同步自 .gitignore(「从 .gitignore 同步」只重写以上部分)=====
+.git/
+.hg/
+.svn/
+node_modules/
+bower_components/
+jspm_packages/
+site-packages/
+venv/
+coverage/
+lcov-report/
+cmakefiles/
+cmake-build-*/
+bazel-*/
+pods/
+deriveddata/
+storybook-static/
+playwright-report/
+test-results/
+allure-results/
+allure-report/
+cdk.out/
+*.dist-info/
+eggs/
+pip-wheel-metadata/
+wheels/
+# ----- ↑ 以上为 ZCode 默认排除规则(自定义规则请写在本行下方,不会被同步/恢复改动)-----
+# 自定义规则写在下方(本行提示可删除)
diff --git a/pyproject.toml b/pyproject.toml
index bb63c8a6..f17679ef 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -39,7 +39,7 @@ classifiers = [
"Programming Language :: Python :: 3.14",
]
dependencies = [
- "docvortex>=0.5.3,<1",
+ "docvortex>=0.5.4,<1",
"gradio>=6.8,<7",
"mineru[torch] ; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mineru-vl-utils>=2.0.5,<3",
diff --git a/tests/unittest/test_docvortex_import_boundary.py b/tests/unittest/test_docvortex_import_boundary.py
index 8a680437..ad962051 100644
--- a/tests/unittest/test_docvortex_import_boundary.py
+++ b/tests/unittest/test_docvortex_import_boundary.py
@@ -6,12 +6,9 @@ import ast
from pathlib import Path
import pytest
-from docvortex.document.mhtml import __all__ as MHTML_EXPORTS
from docvortex.public_api import PUBLIC_API
-# DocVortex 0.4.24 已通过模块 __all__ 导出归档接口,公开清单将在后续版本同步。
_DECLARED_API = dict(PUBLIC_API)
-_DECLARED_API.setdefault("docvortex.document.mhtml", tuple(MHTML_EXPORTS))
def _dotted_name(node: ast.AST) -> str:
diff --git a/tests/unittest/test_pdf_tight_spacing.py b/tests/unittest/test_pdf_tight_spacing.py
index a4b9d5f3..8df9c24c 100644
--- a/tests/unittest/test_pdf_tight_spacing.py
+++ b/tests/unittest/test_pdf_tight_spacing.py
@@ -1,12 +1,9 @@
-"""验证普通、旋转及 Rust 原生回填共用非 CJK 墨迹词界规则。"""
+"""验证普通文本、代码保护与整页/竖排回填共用非 CJK 墨迹词界规则。"""
-from copy import deepcopy
-from pathlib import Path
from typing import Any
import pytest
-from docvortex.document.pdf import PDFDocument
-from docvortex.document.pdf.text._contracts import Bbox
+from docvortex.document.pdf import Bbox
from mineru.backend.analysis.pdf.text import native
from mineru.backend.analysis.pdf.text.models import _AnalyzeSpan
from mineru.types import ContentType
@@ -106,39 +103,3 @@ def test_vertical_line_fill_uses_tight_spacing(monkeypatch: pytest.MonkeyPatch)
detect_scripts=False,
)
assert target.content == "A B"
-
-
[email protected]("enabled", [True, False])
-def test_real_snapshot_content_matches_python(enabled: bool) -> None:
- """真实论文逐字符验证 Rust 物化与 Python 回退一致,且确实执行 Rust 内容快路径。"""
- from docvortex._compute_backend import get_native
-
- extension = get_native()
- if extension is None:
- pytest.skip("requires native extension")
- path = Path(__file__).resolve().parents[3] / "docvortex/demo/pdfs/中文论文2.pdf"
- with PDFDocument(path.read_bytes()) as document:
- owner = document[0].get_text_snapshot()
- width, height = document[0].size
- geometry = owner.materialize_geometry()
- results = []
- before = extension.text_snapshot_stats()[2]
- for current_owner in (None, owner):
- span = _AnalyzeSpan(
- ContentType.TEXT,
- (0.0, 0.0, width, height),
- metadata={"chars": [], "height": height, "width": width, "_native_tight_spacing": enabled},
- )
- native.fill_char_in_spans(
- [span],
- deepcopy(geometry.chars),
- 10.0,
- tight_bboxes=geometry.tight_bboxes,
- origins=geometry.origins,
- detect_scripts=False,
- _native_text=current_owner,
- )
- results.append(span.content)
- assert extension.text_snapshot_stats()[2] == before + 1
- assert results[0] == results[1]
- assert ("Large Language Models" in results[0]) is enabled