From 7b23cd9f8cef4b431f9fbd0ceda98954f436f786 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 24 Jul 2026 01:08:03 +0800 Subject: [PATCH] fix: drop deprecation warnings from the top-level module shims MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pageindex/page_index.py | 11 +---------- pageindex/page_index_md.py | 12 +----------- pageindex/utils.py | 11 +---------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/pageindex/page_index.py b/pageindex/page_index.py index 0db0c2b..8cace07 100644 --- a/pageindex/page_index.py +++ b/pageindex/page_index.py @@ -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 diff --git a/pageindex/page_index_md.py b/pageindex/page_index_md.py index 25c7e9b..d570b06 100644 --- a/pageindex/page_index_md.py +++ b/pageindex/page_index_md.py @@ -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 diff --git a/pageindex/utils.py b/pageindex/utils.py index ff6d890..ef5e793 100644 --- a/pageindex/utils.py +++ b/pageindex/utils.py @@ -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.