mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
`import hanzo` ran the CLI's module body, so it needed click, rich, httpx and everything else in the list before it could tell you its own version — on a bare interpreter it did not import at all. It also read `__version__` back off this module from `cli`, a cycle that only worked because the assignment happened to sit above the import. Both go away by naming things instead of importing them. `__getattr__` (PEP 562) resolves a member on first touch and caches it, so `hanzo.cloud` costs nothing until somebody wants the cloud client, and the second touch is a dict lookup. A member that is not installed says which distribution to install rather than raising ModuleNotFoundError from somewhere inside us. This is the shape the npm package and the Rust crate already had: one front door, everything behind it, nothing loaded that was not asked for. One table maps a name to its distribution, so adding a member is one line.