Skip to content

Move AsyncDatamaxi into a private submodule to drop the aio import-alias hack #190

Description

@martinkersner

Deferred from PR #189 review.

Context

AsyncDatamaxi (the async mounting logic) lives directly in datamaxi/aio/__init__.py. Because the mount instantiates AsyncTelegram/AsyncNaver in that same module, #189 had to bind their imports privately (from datamaxi.aio.telegram import AsyncTelegram as _AsyncTelegram) so the public names stop resolving from datamaxi.aio top level.

The sync side needs no such alias: Datamaxi lives in the datamaxi/resources/__init__.py submodule, so top-level datamaxi/__init__.py simply never imports Telegram/Naver.

Suggestion

Move AsyncDatamaxi into a private submodule (mirroring the sync resources layout), then re-export it from datamaxi/aio/__init__.py. That lets the async side import the impl classes normally (no _-alias workaround) and makes the two clients structurally symmetric rather than just outcome-symmetric.

Done when

  • AsyncDatamaxi no longer defined directly in datamaxi/aio/__init__.py; the private-alias imports (as _AsyncTelegram/_AsyncNaver) are gone.
  • from datamaxi.aio import AsyncTelegram/AsyncNaver still raises ImportError; client.telegram/client.naver still work.
  • Offline suite green.

Ref: file datamaxi/aio/init.py:46-47 (PR #189)

Metadata

Metadata

Assignees

Labels

claude-foundSurfaced by ClaudereviewAuto-detected by Claude during /review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions