mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 20:15:26 +00:00
refactor: rename the application package to docsgpt
The backend import package is now docsgpt, the name it will carry on PyPI; application was far too generic to install into anyone's site-packages. git mv plus a mechanical rewrite of every import, dotted string and path reference: 734 Python files, the compose files, Dockerfile, workflows, docs, setup scripts, devcontainer, k8s manifests, vscode config, pytest and coverage config, .gitignore. Behaviour is unchanged. Kept for one release: - A top-level application package whose meta-path finder resolves application.x.y to the already-imported docsgpt.x.y object, so old imports and entry points (celery -A application.app.celery, uvicorn application.asgi:asgi_app) keep working with a FutureWarning. - Celery registers every application.* task name as an alias of its docsgpt.* task on start-up, so messages queued by the previous release still run. The redbeat key prefix moves to redbeat:docsgpt:v2: so schedule entries the previous release wrote are left unread instead of firing twice. The backend image builds from the repository root (docker build -f docsgpt/Dockerfile .) so it can ship the alias package; a root .dockerignore allow-lists docsgpt/ and application/ and keeps caches, local data, .env files, the sample index files and the Dockerfile out. Compose and the image workflows point at the new context.
This commit is contained in:
1 parent
3e7f1f91b4
commit
574f96341e
984 files changed
+9847
-9682
No files matched your search
@@ -11,8 +11,8 @@ from typing import Any, Dict, List
|
||||
|
||||
import pytest
|
||||
|
||||
import application.parser.document_reader as dr
|
||||
from application.parser.document_reader import (
|
||||
import docsgpt.parser.document_reader as dr
|
||||
from docsgpt.parser.document_reader import (
|
||||
bound_parse_payload,
|
||||
parse_document_bytes,
|
||||
truncate_text_head_tail,
|
||||
@@ -229,7 +229,7 @@ def test_default_markdown_with_tables_converts_docling_once(monkeypatch):
|
||||
# engine=auto resolves to the server default; this test is about the docling path.
|
||||
monkeypatch.setattr(dr.settings, "DOC_PARSER_ENGINE", "docling")
|
||||
|
||||
from application.parser.file.docling_parser import DoclingParser
|
||||
from docsgpt.parser.file.docling_parser import DoclingParser
|
||||
|
||||
counter = {"instances": 0, "converts": 0}
|
||||
|
||||
@@ -546,7 +546,7 @@ def test_vanilla_converter_applies_inference_settings(monkeypatch, tmp_path):
|
||||
|
||||
called = []
|
||||
monkeypatch.setattr(
|
||||
"application.parser.file.docling_parser._apply_inference_settings",
|
||||
"docsgpt.parser.file.docling_parser._apply_inference_settings",
|
||||
lambda: called.append(True),
|
||||
)
|
||||
|
||||
@@ -618,7 +618,7 @@ def test_structured_tables_render_blank_cells_as_strings(monkeypatch, tmp_path):
|
||||
return types.SimpleNamespace(document=_Doc())
|
||||
|
||||
monkeypatch.setattr(
|
||||
"application.parser.file.docling_parser._apply_inference_settings",
|
||||
"docsgpt.parser.file.docling_parser._apply_inference_settings",
|
||||
lambda: None,
|
||||
)
|
||||
fake_docling = types.ModuleType("docling")
|
||||
@@ -753,7 +753,7 @@ def test_tables_are_not_collected_when_the_pdf_parser_is_not_docling(monkeypatch
|
||||
"""Under OCR_BACKEND=native the docling engine hands PDFs to the native OCR
|
||||
parser; a vanilla DocumentConverter table pass would OCR the scan again."""
|
||||
|
||||
from application.parser.file.ocr_parser import NativeOcrPdfParser
|
||||
from docsgpt.parser.file.ocr_parser import NativeOcrPdfParser
|
||||
|
||||
native = NativeOcrPdfParser()
|
||||
native._parser_config = {}
|
||||
@@ -777,8 +777,8 @@ def test_tables_survive_native_ocr_delegation_for_text_only_pdfs(monkeypatch):
|
||||
to that parser, so tables must ride that single conversion instead of being
|
||||
dropped by the scan exclusion."""
|
||||
|
||||
from application.parser.file.docling_parser import DoclingParser
|
||||
from application.parser.file.ocr_parser import NativeOcrPdfParser
|
||||
from docsgpt.parser.file.docling_parser import DoclingParser
|
||||
from docsgpt.parser.file.ocr_parser import NativeOcrPdfParser
|
||||
|
||||
class _Docling(DoclingParser):
|
||||
def __init__(self):
|
||||
|
||||
Reference in new issue
Block a user