From c0f6861cb7d9262d1c449e3373cde6bba0177f84 Mon Sep 17 00:00:00 2001 From: skishchampi <996985+skishchampi@users.noreply.github.com> Date: Thu, 20 Aug 2026 23:46:48 -0400 Subject: [PATCH] chore: import three commoner-probe modules under their current names probe renamed three modules and kept the old names as deprecated aliases. This package imported all three old names, so the suite ran with three DeprecationWarnings. It now runs with none. commoner_probe.committees -> commoner_probe.committee_report_api commoner_probe.sansad -> commoner_probe.parliament_qa_api commoner_probe.neva -> commoner_probe.assembly_portal No public surface changes. Only the module this package imports FROM changes. Every re-exported name stays as it was. Verified against probe 0.16.0: each new module exposes an identical public surface to the one it replaces. The four compat tests move with it, because they patched the old paths. The old names break when probe removes them. A local run could not see the warnings: the repo venv held probe 0.13.0 while pyproject pinned 0.16.0. The venv is repaired. 509 passed, 1 skipped, and zero warnings. --- CHANGELOG.md | 16 ++++++++++++++++ commoner_analyse/committees.py | 2 +- commoner_analyse/neva.py | 4 ++-- commoner_analyse/sansad.py | 2 +- tests/test_committee_compat.py | 6 +++--- tests/test_neva_compat.py | 4 ++-- tests/test_sansad_compat.py | 6 +++--- tests/test_sansad_record_filter_integration.py | 2 +- 8 files changed, 29 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edb4eff..fd3eb7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,22 @@ researchers who pin a tag and want to know what they are pinning to. ## [Unreleased] +### Changed + +- **Import three `commoner-probe` modules under their current names.** + `commoner_probe.committees` becomes `commoner_probe.committee_report_api`, + `commoner_probe.sansad` becomes `commoner_probe.parliament_qa_api`, and + `commoner_probe.neva` becomes `commoner_probe.assembly_portal`. probe + deprecated the old names, and it raises a `DeprecationWarning` on each. The + suite ran with three of them and now runs with none. + + **No public surface changes here.** Only the module this package imports + FROM changes. Every name this package re-exports stays exactly as it was. + Verified against probe 0.16.0: each new module exposes an identical public + surface to the module it replaces, so the swap is a pure alias. + + The four compat tests move with it, because they patched the old paths. + ## [2.7.1] — 2026-08-20 ### Fixed diff --git a/commoner_analyse/committees.py b/commoner_analyse/committees.py index 6efc24f..28758b7 100644 --- a/commoner_analyse/committees.py +++ b/commoner_analyse/committees.py @@ -24,7 +24,7 @@ from pathlib import Path from typing import Iterable -from commoner_probe.committees import ( # noqa: F401 (re-export) +from commoner_probe.committee_report_api import ( # noqa: F401 (re-export) DEFAULT_LOK_SABHA, LS_COMMITTEES, REPORT_TYPE_ACTION_TAKEN, diff --git a/commoner_analyse/neva.py b/commoner_analyse/neva.py index 4fa42e6..ce019c1 100644 --- a/commoner_analyse/neva.py +++ b/commoner_analyse/neva.py @@ -3,7 +3,7 @@ State-assembly acquisition (questions, unlisted questions, members, papers to be laid) is delegated to the published ``commoner-probe`` package (the single -source of truth — ``commoner_probe.neva.StateAssemblyCrawler``). This module +source of truth — ``commoner_probe.assembly_portal.StateAssemblyCrawler``). This module used to carry a full local re-implementation as a fallback for when the probe was absent; that fallback was dead code (``commoner-probe`` is a required dependency that ``sansad.py``/``committees.py`` already import @@ -19,7 +19,7 @@ from pathlib import Path -from commoner_probe.neva import StateAssemblyCrawler +from commoner_probe.assembly_portal import StateAssemblyCrawler from . import __version__ from ._probe_compat import with_crawled_at as _with_crawled_at diff --git a/commoner_analyse/sansad.py b/commoner_analyse/sansad.py index acec808..90bfd30 100644 --- a/commoner_analyse/sansad.py +++ b/commoner_analyse/sansad.py @@ -31,7 +31,7 @@ from pathlib import Path from typing import Iterable -from commoner_probe.sansad import ( # noqa: F401 (re-export) +from commoner_probe.parliament_qa_api import ( # noqa: F401 (re-export) SansadProbe, date_in_range, md_value, diff --git a/tests/test_committee_compat.py b/tests/test_committee_compat.py index ba74106..f6ef661 100644 --- a/tests/test_committee_compat.py +++ b/tests/test_committee_compat.py @@ -20,10 +20,10 @@ def reloaded_committees(probe_class: type) -> Iterator[ModuleType]: """Reload the SSC committees module with the commoner-probe probe patched. - Acquisition is delegated to ``commoner_probe.committees.CommitteeProbe`` (a + Acquisition is delegated to ``commoner_probe.committee_report_api.CommitteeProbe`` (a hard dependency). We patch that class to a fake before re-importing the SSC module so ``CommitteeCrawler`` subclasses the fake; the re-exported helpers - continue to resolve from the real ``commoner_probe.committees`` module. + continue to resolve from the real ``commoner_probe.committee_report_api`` module. """ original = sys.modules.pop(TARGET_MODULE, None) package = sys.modules.get("commoner_analyse") @@ -31,7 +31,7 @@ def reloaded_committees(probe_class: type) -> Iterator[ModuleType]: if package is not None and hasattr(package, "committees"): delattr(package, "committees") try: - with mock.patch("commoner_probe.committees.CommitteeProbe", probe_class): + with mock.patch("commoner_probe.committee_report_api.CommitteeProbe", probe_class): yield REAL_IMPORT_MODULE(TARGET_MODULE) finally: sys.modules.pop(TARGET_MODULE, None) diff --git a/tests/test_neva_compat.py b/tests/test_neva_compat.py index bdb995d..2f43b5c 100644 --- a/tests/test_neva_compat.py +++ b/tests/test_neva_compat.py @@ -18,7 +18,7 @@ def reloaded_neva(probe_class: type) -> Iterator[ModuleType]: """Reload the SSC neva module with the commoner-probe crawler patched. - Acquisition is delegated to ``commoner_probe.neva.StateAssemblyCrawler`` (a + Acquisition is delegated to ``commoner_probe.assembly_portal.StateAssemblyCrawler`` (a hard dependency). We patch that class to a fake before re-importing the SSC module so ``NevaStateCrawler`` subclasses the fake. """ @@ -28,7 +28,7 @@ def reloaded_neva(probe_class: type) -> Iterator[ModuleType]: if package is not None and hasattr(package, "neva"): delattr(package, "neva") try: - with mock.patch("commoner_probe.neva.StateAssemblyCrawler", probe_class): + with mock.patch("commoner_probe.assembly_portal.StateAssemblyCrawler", probe_class): yield REAL_IMPORT_MODULE(TARGET_MODULE) finally: sys.modules.pop(TARGET_MODULE, None) diff --git a/tests/test_sansad_compat.py b/tests/test_sansad_compat.py index b598e26..a804c56 100644 --- a/tests/test_sansad_compat.py +++ b/tests/test_sansad_compat.py @@ -20,10 +20,10 @@ def reloaded_sansad(probe_class: type) -> Iterator[ModuleType]: """Reload the SSC sansad module with the commoner-probe SansadProbe patched. - Acquisition is delegated to ``commoner_probe.sansad.SansadProbe`` (a hard + Acquisition is delegated to ``commoner_probe.parliament_qa_api.SansadProbe`` (a hard dependency). We patch that class to a fake before re-importing the SSC module so ``SansadCrawler`` subclasses the fake; the re-exported helpers continue to - resolve from the real ``commoner_probe.sansad`` module. + resolve from the real ``commoner_probe.parliament_qa_api`` module. """ original = sys.modules.pop(TARGET_MODULE, None) package = sys.modules.get("commoner_analyse") @@ -31,7 +31,7 @@ def reloaded_sansad(probe_class: type) -> Iterator[ModuleType]: if package is not None and hasattr(package, "sansad"): delattr(package, "sansad") try: - with mock.patch("commoner_probe.sansad.SansadProbe", probe_class): + with mock.patch("commoner_probe.parliament_qa_api.SansadProbe", probe_class): yield REAL_IMPORT_MODULE(TARGET_MODULE) finally: sys.modules.pop(TARGET_MODULE, None) diff --git a/tests/test_sansad_record_filter_integration.py b/tests/test_sansad_record_filter_integration.py index a0f816d..badd4ff 100644 --- a/tests/test_sansad_record_filter_integration.py +++ b/tests/test_sansad_record_filter_integration.py @@ -1,7 +1,7 @@ """End-to-end check that SSC's RS semantic filter runs at acquisition time. Unlike test_sansad_compat (which fakes the probe), this drives the *real* -``commoner_probe.sansad.SansadProbe`` (>=0.5.1) through ``SansadCrawler``, with +``commoner_probe.parliament_qa_api.SansadProbe`` (>=0.5.1) through ``SansadCrawler``, with only the HTTP boundary (``rs_search_session``) and the network roster (``_enrich_askers``) stubbed. It pins the two behaviours the append-time filter got wrong: ``--max-records`` must cap topic-matching rows (not acquired rows),