mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
a uv source says where, not that anything depends on it
The hanzo-tools-core suite imports ten sibling tool distributions and asserts an exact TOOLS count, but they were only ever named in [tool.uv.sources]. A source resolves a package; it does not make anything require one, so `uv sync --dev` uninstalled all ten and left the suite at 22 failed / 2 passed. Naming them in the dev dependency-group restores 24 passed, 12 skipped from a clean sync. pkg/hanzo-dev-py never existed — the directory is pkg/hanzo-dev — so the eight excludes and workspace members spelling it were inert. mypy.ini is the config that actually loads, and with the name corrected it stops type-checking a package it was written to skip (18 errors -> none). cloud.py cited APIKeyPrefixes as the authority on key prefixes; no such symbol exists. isAPIKey is the real gate and it admits hk-, sk-, pk-, fw_ and hz_, so NO_KEY was telling callers the wrong two. (cherry picked from commit b2024662400895e456d4b3811fd286565e4e7109)
This commit is contained in:
@@ -3,7 +3,7 @@ pretty = True
|
||||
show_error_codes = True
|
||||
|
||||
# Exclude non-SDK code and subpackages (they have their own CI/linting)
|
||||
exclude = ^(pkg/hanzoai/_files\.py|_dev/.*\.py|tests/.*|bin/.*|examples/.*|scripts/.*|pkg/hanzo/|pkg/hanzo-aci/|pkg/hanzo-agent/|pkg/hanzo-mcp/|pkg/hanzo-memory/|pkg/hanzo-network/|pkg/hanzo-dev-py/)
|
||||
exclude = ^(pkg/hanzoai/_files\.py|_dev/.*\.py|tests/.*|bin/.*|examples/.*|scripts/.*|pkg/hanzo/|pkg/hanzo-aci/|pkg/hanzo-agent/|pkg/hanzo-mcp/|pkg/hanzo-memory/|pkg/hanzo-network/|pkg/hanzo-dev/)
|
||||
|
||||
strict_equality = True
|
||||
implicit_reexport = True
|
||||
|
||||
@@ -5,8 +5,8 @@ search, web search, research, vision — talks to it through this one client.
|
||||
There is exactly one place that knows the base URL, the auth header, and how to
|
||||
turn a non-2xx into a typed error; tools compose it, never re-implement it.
|
||||
|
||||
Auth resolves in order: ``HANZO_API_KEY`` env, the ``apiKey`` (a ``pk-``/``sk-``
|
||||
key) in ``~/.hanzo/config.json``, then the ``hanzo`` CLI's live IAM session.
|
||||
Auth resolves in order: ``HANZO_API_KEY`` env, the ``apiKey`` in
|
||||
``~/.hanzo/config.json``, then the ``hanzo`` CLI's live IAM session.
|
||||
Base URL is ``https://api.hanzo.ai``, overridable via ``HANZO_API_BASE``.
|
||||
|
||||
Reference: HIP-0300 unified tools; api.hanzo.ai /v1 surface.
|
||||
@@ -22,11 +22,12 @@ from collections.abc import AsyncIterator
|
||||
DEFAULT_BASE = "https://api.hanzo.ai"
|
||||
|
||||
#: What a cloud-backed tool says when no key resolved — one sentence in one
|
||||
#: place, so the shapes cannot drift apart tool by tool. Cloud admits two:
|
||||
#: ``pk-`` is the publishable key you may ship in a browser bundle, ``sk-`` is
|
||||
#: the one you may not. ``APIKeyPrefixes`` in cloud's ``auth_identity.go`` is
|
||||
#: the authority; anything else resolves to no principal.
|
||||
NO_KEY = "no API key: run `hanzo login` or set HANZO_API_KEY (pk-/sk-)"
|
||||
#: place, so the shapes cannot drift apart tool by tool. ``pk-`` is the
|
||||
#: publishable key you may ship in a browser bundle; ``sk-`` and ``hk-`` are the
|
||||
#: ones you may not. ``isAPIKey`` in cloud's ``auth_identity.go`` is the
|
||||
#: authority — it admits ``hk-``, ``sk-``, ``pk-``, ``fw_`` and ``hz_``, and a
|
||||
#: token carrying no such prefix never reaches key validation at all.
|
||||
NO_KEY = "no API key: run `hanzo login` or set HANZO_API_KEY (hk-/sk-/pk-)"
|
||||
|
||||
|
||||
# Memo for cli_session_token: shelling out costs ~100ms and the token is stable
|
||||
|
||||
+20
-7
@@ -70,7 +70,7 @@ members = [
|
||||
"pkg/hanzo-mcp",
|
||||
"pkg/hanzo-memory",
|
||||
"pkg/hanzo-network",
|
||||
"pkg/hanzo-dev-py",
|
||||
"pkg/hanzo-dev",
|
||||
"pkg/hanzo-flags",
|
||||
"pkg/hanzo-s3",
|
||||
"pkg/hanzo-train",
|
||||
@@ -119,6 +119,19 @@ dev = [
|
||||
"fastapi>=0.128.0",
|
||||
"fastembed>=0.7.4",
|
||||
"hanzo-memory",
|
||||
# The hanzo-tools-core suite imports each of these and asserts an exact
|
||||
# TOOLS count. A uv source alone installs nothing, so name them here.
|
||||
"hanzo-tools",
|
||||
"hanzo-tools-agent",
|
||||
"hanzo-tools-browser",
|
||||
"hanzo-tools-fs",
|
||||
"hanzo-tools-jupyter",
|
||||
"hanzo-tools-lsp",
|
||||
"hanzo-tools-memory",
|
||||
"hanzo-tools-reasoning",
|
||||
"hanzo-tools-refactor",
|
||||
"hanzo-tools-shell",
|
||||
"hanzo-tools-todo",
|
||||
"httpx>=0.28.1",
|
||||
"importlib-metadata>=6.7.0",
|
||||
"mypy",
|
||||
@@ -209,7 +222,7 @@ exclude = [
|
||||
"pkg/hanzo-memory",
|
||||
"pkg/hanzo-network",
|
||||
"pkg/hanzo-node",
|
||||
"pkg/hanzo-dev-py",
|
||||
"pkg/hanzo-dev",
|
||||
"pkg/hanzo-train",
|
||||
"pkg/hanzo-tools",
|
||||
"pkg/hanzo-tools-agent",
|
||||
@@ -471,7 +484,7 @@ exclude = [
|
||||
"pkg/hanzo-mcp/",
|
||||
"pkg/hanzo-memory/",
|
||||
"pkg/hanzo-network/",
|
||||
"pkg/hanzo-dev-py/",
|
||||
"pkg/hanzo-dev/",
|
||||
"pkg/hanzo/",
|
||||
# Non-production code
|
||||
"bin/",
|
||||
@@ -551,10 +564,10 @@ hanzo-tools-s3 = { workspace = true }
|
||||
"**/__main__.py" = ["T201", "T203"]
|
||||
# Specific file ignores
|
||||
"pkg/hanzo-memory/src/hanzo_memory/db/base.py" = ["B027"]
|
||||
"pkg/hanzo-dev-py/src/hanzo_dev/backends.py" = ["S603"]
|
||||
"pkg/hanzo-dev-py/src/hanzo_dev/repl.py" = ["S605"]
|
||||
"pkg/hanzo-dev-py/src/hanzo_dev/tests.py" = ["ARG001"]
|
||||
"pkg/hanzo-dev-py/src/hanzo_dev/ipython_repl.py" = ["ARG002"]
|
||||
"pkg/hanzo-dev/src/hanzo_dev/backends.py" = ["S603"]
|
||||
"pkg/hanzo-dev/src/hanzo_dev/repl.py" = ["S605"]
|
||||
"pkg/hanzo-dev/src/hanzo_dev/tests.py" = ["ARG001"]
|
||||
"pkg/hanzo-dev/src/hanzo_dev/ipython_repl.py" = ["ARG002"]
|
||||
"**/cli.py" = ["T201", "T203"]
|
||||
# Test files
|
||||
"**/test_*.py" = ["F401", "F841"]
|
||||
|
||||
@@ -2277,6 +2277,17 @@ dev = [
|
||||
{ name = "fastapi" },
|
||||
{ name = "fastembed" },
|
||||
{ name = "hanzo-memory" },
|
||||
{ name = "hanzo-tools" },
|
||||
{ name = "hanzo-tools-agent" },
|
||||
{ name = "hanzo-tools-browser" },
|
||||
{ name = "hanzo-tools-fs" },
|
||||
{ name = "hanzo-tools-jupyter" },
|
||||
{ name = "hanzo-tools-lsp" },
|
||||
{ name = "hanzo-tools-memory" },
|
||||
{ name = "hanzo-tools-reasoning" },
|
||||
{ name = "hanzo-tools-refactor" },
|
||||
{ name = "hanzo-tools-shell" },
|
||||
{ name = "hanzo-tools-todo" },
|
||||
{ name = "httpx" },
|
||||
{ name = "importlib-metadata" },
|
||||
{ name = "mypy" },
|
||||
@@ -2311,6 +2322,17 @@ dev = [
|
||||
{ name = "fastapi", specifier = ">=0.128.0" },
|
||||
{ name = "fastembed", specifier = ">=0.7.4" },
|
||||
{ name = "hanzo-memory", editable = "pkg/hanzo-memory" },
|
||||
{ name = "hanzo-tools", editable = "pkg/hanzo-tools" },
|
||||
{ name = "hanzo-tools-agent", editable = "pkg/hanzo-tools-agent" },
|
||||
{ name = "hanzo-tools-browser", editable = "pkg/hanzo-tools-browser" },
|
||||
{ name = "hanzo-tools-fs", editable = "pkg/hanzo-tools-fs" },
|
||||
{ name = "hanzo-tools-jupyter", editable = "pkg/hanzo-tools-jupyter" },
|
||||
{ name = "hanzo-tools-lsp", editable = "pkg/hanzo-tools-lsp" },
|
||||
{ name = "hanzo-tools-memory", editable = "pkg/hanzo-tools-memory" },
|
||||
{ name = "hanzo-tools-reasoning", editable = "pkg/hanzo-tools-reasoning" },
|
||||
{ name = "hanzo-tools-refactor", editable = "pkg/hanzo-tools-refactor" },
|
||||
{ name = "hanzo-tools-shell", editable = "pkg/hanzo-tools-shell" },
|
||||
{ name = "hanzo-tools-todo", editable = "pkg/hanzo-tools-todo" },
|
||||
{ name = "httpx", specifier = ">=0.28.1" },
|
||||
{ name = "importlib-metadata", specifier = ">=6.7.0" },
|
||||
{ name = "mypy" },
|
||||
|
||||
Reference in New Issue
Block a user