Skip to content

Commit

Permalink
feat: add platform info to CLI version printout (#816)
Browse files Browse the repository at this point in the history
* feat: add platform info to CLI version printout

Signed-off-by: Panos Vagenas <[email protected]>

* Update main.py

Signed-off-by: Panos Vagenas <[email protected]>

* add Python implementation & language versions

Signed-off-by: Panos Vagenas <[email protected]>

---------

Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas authored Jan 27, 2025
1 parent 5332755 commit 95b293a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docling/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import importlib
import json
import logging
import platform
import re
import sys
import tempfile
import time
import warnings
from enum import Enum
from pathlib import Path
from typing import Annotated, Dict, Iterable, List, Optional, Type

import typer
from docling_core.types.doc import ImageRefMode
from docling_core.utils.file import resolve_source_to_path
from pydantic import TypeAdapter, ValidationError
from pydantic import TypeAdapter

from docling.backend.docling_parse_backend import DoclingParseDocumentBackend
from docling.backend.docling_parse_v2_backend import DoclingParseV2DocumentBackend
Expand Down Expand Up @@ -65,10 +65,15 @@ def version_callback(value: bool):
docling_core_version = importlib.metadata.version("docling-core")
docling_ibm_models_version = importlib.metadata.version("docling-ibm-models")
docling_parse_version = importlib.metadata.version("docling-parse")
platform_str = platform.platform()
py_impl_version = sys.implementation.cache_tag
py_lang_version = platform.python_version()
print(f"Docling version: {docling_version}")
print(f"Docling Core version: {docling_core_version}")
print(f"Docling IBM Models version: {docling_ibm_models_version}")
print(f"Docling Parse version: {docling_parse_version}")
print(f"Python: {py_impl_version} ({py_lang_version})")
print(f"Platform: {platform_str}")
raise typer.Exit()


Expand Down

0 comments on commit 95b293a

Please sign in to comment.