docling-project/docling · error · RuntimeError

Could not determine Docling version from pyproject.toml

Error message

Could not determine Docling version from pyproject.toml

What it means

Error "Could not determine Docling version from pyproject.toml" thrown in docling-project/docling.

Source

Thrown at perfs/xlsx_merged_cells.py:93

        default=DEFAULT_MERGE_COUNTS,
        help="Merged-range counts to benchmark.",
    )
    parser.add_argument(
        "--output",
        type=Path,
        help="Optional JSONL output path; results are always written to stdout.",
    )
    return parser.parse_args()


def _runtime_info() -> RuntimeInfo:
    repository_root = Path(__file__).resolve().parents[1]
    pyproject_text = (repository_root / "pyproject.toml").read_text(encoding="utf-8")
    version_match = re.search(
        r'^version\s*=\s*"([^"]+)"', pyproject_text, flags=re.MULTILINE
    )
    if version_match is None:
        raise RuntimeError("Could not determine Docling version from pyproject.toml")

    git_result = subprocess.run(
        ["git", "rev-parse", "HEAD"],
        check=True,
        capture_output=True,
        cwd=repository_root,
        text=True,
        timeout=10,
    )
    return RuntimeInfo(
        python_version=platform.python_version(),
        platform=platform.platform(),
        docling_version=version_match.group(1),
        commit_sha=git_result.stdout.strip(),
    )


def _create_workbook(path: Path, *, merge_count: int) -> float:

View on GitHub (pinned to 61d76f1ff3)

Solutions

  1. Ensure pyproject.toml at the repository root contains a top-level `version = "..."` entry; the script reads it with a regex matching `^version\s*=\s*"([^"]+)"`.
  2. Run the script from a checkout of the docling repository so that Path(__file__).resolve().parents[1] points at the repo root containing pyproject.toml.
  3. Check that pyproject.toml is readable and that its [project] section declares a plain `version` string rather than dynamic versioning.

When it happens

Trigger: Raised by perfs/xlsx_merged_cells.py when the benchmark script cannot parse a version string out of the repository's pyproject.toml.

Common situations: Running the benchmark from a copied or partial checkout where pyproject.toml is missing, unreadable, or does not contain a 'version = "..."' line.


AI-assisted analysis of docling-project/docling@61d76f1ff3 (2026-08-14). Data as JSON: /api/errors/2f09e1bfeb36e723. Report an issue: GitHub.