Skip to content

Remove standalone Telegram/Naver clients from public API - #189

Merged
martinkersner merged 3 commits into
mainfrom
issue-188-remove-standalone-telegram-naver
Jul 6, 2026
Merged

Remove standalone Telegram/Naver clients from public API#189
martinkersner merged 3 commits into
mainfrom
issue-188-remove-standalone-telegram-naver

Conversation

@martinkersner

@martinkersner martinkersner commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Drops the standalone Telegram / Naver / AsyncTelegram / AsyncNaver clients as a public access path. After #186 mounted them as maxi.telegram / maxi.naver (sharing the client's Session), the standalone path was redundant and bypassed the shared retry/return-shape config. One access path — via the client — is the intended surface.

  • Sync: drop the top-level re-exports + __all__ entries in datamaxi/__init__.py. Datamaxi already lives in the datamaxi/resources/ submodule, so the top-level init never binds Telegram/Naver.
  • Async: move AsyncDatamaxi into a private datamaxi/aio/_client.py (mirroring the sync resources layout) so datamaxi/aio/__init__.py becomes a pure re-export file. The impl classes now import normally in _client.py — no _AsyncTelegram/_AsyncNaver alias hack — and Telegram/Naver simply aren't re-exported, so from datamaxi.aio import AsyncTelegram no longer resolves.
  • Impl classes kept — reachable only via maxi.telegram / maxi.naver. Mounts unchanged.
  • Tests: source the impl classes from their package modules (datamaxi.telegram etc.); live telegram/naver conftest fixtures now use the mounts. Added surface tests asserting the standalone names are no longer top-level importable.

Breaking change

from datamaxi import Telegram / Naver and from datamaxi.aio import AsyncTelegram / AsyncNaver stop working. Use Datamaxi(...).telegram / .naver (async twins on AsyncDatamaxi).

Test plan

  • uv run pytest tests/ -m "not integration" — 236 passed, 11 skipped.
  • black --check + flake8 clean.
  • Manual import check (with [async] extra): datamaxi.Telegram/Naver and datamaxi.aio.AsyncTelegram/AsyncNaver raise; Datamaxi / AsyncDatamaxi + mounts still work.

Closes #188
Closes #190

@martinkersner martinkersner self-assigned this Jul 6, 2026
Drop top-level re-exports + __all__ entries for Telegram/Naver
(datamaxi) and AsyncTelegram/AsyncNaver (datamaxi.aio); bind aio
mount imports privately so the names aren't importable. Impl classes
kept, reachable only via maxi.telegram / maxi.naver. Tests source the
classes from their package modules / mounts.

Closes #188
@martinkersner
martinkersner force-pushed the issue-188-remove-standalone-telegram-naver branch from d702907 to 5555d3d Compare July 6, 2026 05:04
docs/{telegram,naver-trend,async}.md showed the removed standalone
imports (from datamaxi import Telegram, from datamaxi.aio import
AsyncTelegram, ...) — repoint to maxi.telegram / client.telegram.
Split the not-top-level-importable assertion per resource file.
Mirrors sync layout (Datamaxi in resources/): aio/__init__.py is now a
pure re-export file, so the impl classes import normally in _client.py
instead of the _AsyncTelegram/_AsyncNaver alias hack. Telegram/Naver stay
off the public aio surface; client.telegram/.naver unchanged.

Closes #190
@martinkersner
martinkersner merged commit 09529f1 into main Jul 6, 2026
5 checks passed
@martinkersner
martinkersner deleted the issue-188-remove-standalone-telegram-naver branch July 6, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant