Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commoner_analyse/committees.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions commoner_analyse/neva.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commoner_analyse/sansad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_committee_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
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")
old_attr = getattr(package, "committees", None) if package is not None else None
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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_neva_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sansad_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
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")
old_attr = getattr(package, "sansad", None) if package is not None else None
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sansad_record_filter_integration.py
Original file line number Diff line number Diff line change
@@ -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),
Expand Down