fix: drop deprecation warnings from the top-level module shims

Same adjudication as the client methods (42d57b6): pageindex.utils is
the documented 0.2.8 location, and the top-level modules are permanent
compatibility surface — "will be removed in a future release" was not
true. The shims stay; only the import-time warnings go.
This commit is contained in:
Ray 2026-07-24 01:08:03 +08:00
parent 42d57b6f4c
commit 7b23cd9f8c
3 changed files with 3 additions and 31 deletions

View file

@ -1,19 +1,10 @@
# pageindex/page_index.py
# Deprecation shim. The PDF indexing pipeline now lives in
# Compatibility shim. The PDF indexing pipeline now lives in
# pageindex/index/page_index.py (the single source of truth). This module
# re-exports it so legacy imports (`from pageindex.page_index import ...`,
# `from pageindex import page_index`) keep working.
import sys
import types
import warnings
warnings.warn(
"pageindex.page_index has moved to pageindex.index.page_index; importing it "
"from the top level is deprecated and will be removed in a future release.",
PendingDeprecationWarning,
stacklevel=2,
)
from .index.page_index import * # noqa: F401,F403,E402
# pageindex/__init__.py binds the FUNCTION `page_index` as the package

View file

@ -1,19 +1,9 @@
# pageindex/page_index_md.py
# Deprecation shim. The Markdown indexing pipeline now lives in
# Compatibility shim. The Markdown indexing pipeline now lives in
# pageindex/index/page_index_md.py (the single source of truth). This module
# re-exports it so legacy imports keep working.
#
# The canonical md_to_tree coerces legacy 'yes'/'no' string flags itself (a
# bare 'no' would otherwise be truthy) — this shim used to duplicate that
# coercion in its own wrapper; now it just re-exports the canonical function.
import warnings
warnings.warn(
"pageindex.page_index_md has moved to pageindex.index.page_index_md; "
"importing it from the top level is deprecated and will be removed in a "
"future release.",
PendingDeprecationWarning,
stacklevel=2,
)
from .index.page_index_md import * # noqa: F401,F403,E402

View file

@ -1,16 +1,7 @@
# pageindex/utils.py
# Deprecation shim. The indexing utilities now live in pageindex/index/utils.py,
# Compatibility shim. The indexing utilities now live in pageindex/index/utils.py,
# which is the single source of truth. This module re-exports them so legacy
# imports (`from pageindex.utils import ...`) keep working.
import warnings
warnings.warn(
"pageindex.utils has moved to pageindex.index.utils; importing it from the "
"top level is deprecated and will be removed in a future release.",
PendingDeprecationWarning,
stacklevel=2,
)
from .index.utils import * # noqa: F401,F403,E402
# Legacy 0.2.x alias. index.utils keeps it private (_config) so its star-export
# can't shadow the pageindex.config submodule; re-expose it only in this shim.