Skip to content

Commit ac0c593

Browse files
authored
chore(python): rename PyPI distribution to agent-eval-rpc (#41)
The Python client renames from `tangle-agent-eval` to `agent-eval-rpc`, and the import path from `tangle_agent_eval` to `agent_eval_rpc`. Two reasons: 1. Accuracy. The package is a thin RPC client over the Node runtime — not a Python re-implementation of the eval logic. `-rpc` says that plainly; `tangle-` was substituting for an npm-style scope and added no information beyond the npm scope itself (`@tangle-network/...`) already provides. 2. No prior shipped PyPI version exists under the old name (Trusted Publisher misconfiguration; see issue #40), so this is a clean first publish, not a migration. Zero existing consumers, zero deprecation flow needed. Mechanical: - clients/python/pyproject.toml: name + description + wheel package path updated. - clients/python/src/tangle_agent_eval/ → clients/python/src/agent_eval_rpc/ via `git mv` so file history is preserved. - clients/python/src/agent_eval_rpc/__init__.py: docstring + version() distribution-name lookup point at the new name. - clients/python/tests/test_models.py + test_subprocess.py: import paths updated. - clients/python/README.md: title + import examples + version-lock copy. - .github/workflows/publish.yml: __init__.py path + PyPI URL pre-check + skip message. - docs/wire-protocol.md: cross-reference to the python client path. - CHANGELOG.md: 0.21.0 Python-client section explains the rename and points at issue #40. Verification: - `pnpm typecheck` clean. - `pnpm test` — 867 / 867 still passing (no TS impact). - `pip install -e clients/python && pytest` — 11 / 11 passing under the new import path. Issue #40 needs its PyPI Trusted Publisher claims updated to reference the new project name (agent-eval-rpc instead of tangle-agent-eval); the GitHub-side claims (owner=tangle-network, repo=agent-eval, workflow= publish.yml) stay the same because the OIDC subject is the GitHub identity, not the PyPI project.
1 parent e239750 commit ac0c593

11 files changed

Lines changed: 24 additions & 18 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: |
4343
NPM_VERSION=$(node -p "require('./package.json').version")
4444
PY_VERSION=$(grep -E '^version' clients/python/pyproject.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
45-
PY_RUNTIME_VERSION=$(python -c "import pathlib,re; text=pathlib.Path('clients/python/src/tangle_agent_eval/__init__.py').read_text(); match=re.search(r'__version__ = \"([^\"]+)\"', text); print(match.group(1) if match else '')")
45+
PY_RUNTIME_VERSION=$(python -c "import pathlib,re; text=pathlib.Path('clients/python/src/agent_eval_rpc/__init__.py').read_text(); match=re.search(r'__version__ = \"([^\"]+)\"', text); print(match.group(1) if match else '')")
4646
if [ "$NPM_VERSION" != "$PY_VERSION" ]; then
4747
echo "::error::Version mismatch: npm=$NPM_VERSION pypi=$PY_VERSION. Bump them together."
4848
exit 1
@@ -144,8 +144,8 @@ jobs:
144144
id: pypi-check
145145
run: |
146146
VERSION=$(grep -E '^version' clients/python/pyproject.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
147-
if curl -sf "https://pypi.org/pypi/tangle-agent-eval/$VERSION/json" >/dev/null; then
148-
echo "tangle-agent-eval==$VERSION already on PyPI; skipping publish"
147+
if curl -sf "https://pypi.org/pypi/agent-eval-rpc/$VERSION/json" >/dev/null; then
148+
echo "agent-eval-rpc==$VERSION already on PyPI; skipping publish"
149149
echo "skip=true" >> "$GITHUB_OUTPUT"
150150
else
151151
echo "skip=false" >> "$GITHUB_OUTPUT"

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ surface.
7474

7575
### Python client
7676

77-
Locked at `tangle-agent-eval==0.21.0` to match the npm package.
77+
The PyPI distribution renamed from `tangle-agent-eval` to **`agent-eval-rpc`**, and the import path from `tangle_agent_eval` to `agent_eval_rpc`. The new name accurately describes the package — it is a thin RPC client over the Node runtime, not a Python re-implementation of the eval logic — and the npm scope (`@tangle-network/agent-eval`) already provides the namespacing the `tangle-` prefix was substituting for. No prior PyPI version ever shipped under the old name (Trusted Publisher misconfiguration; see issue #40), so this rename is a clean first publish rather than a migration.
78+
79+
Locked at `agent-eval-rpc==0.21.0` to match the npm package.
7880

7981
## 0.20.10 — hardening audit follow-up
8082

clients/python/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tangle-agent-eval — Python client
1+
# agent-eval-rpc — Python client
22

33
Python client for [`@tangle-network/agent-eval`](https://github.com/tangle-network/agent-eval) — a content/code judging framework written in TypeScript. This package is a **thin transport adapter**: every judgement runs in the Node runtime, marshalled over HTTP or stdio RPC. Two languages, one implementation. No drift.
44

@@ -7,7 +7,7 @@ Python client for [`@tangle-network/agent-eval`](https://github.com/tangle-netwo
77
A function-call interface to score any string against a rubric:
88

99
```python
10-
from tangle_agent_eval import Client
10+
from agent_eval_rpc import Client
1111

1212
client = Client() # auto-detects HTTP server, falls back to subprocess
1313
result = client.judge(
@@ -111,7 +111,7 @@ assert v.wire_version == "1.0.0"
111111
Built-in `anti-slop` is tuned for technical-buyer audiences. For different scoring, pass a `Rubric` inline:
112112

113113
```python
114-
from tangle_agent_eval import Client, Rubric, RubricDimension, FailureMode
114+
from agent_eval_rpc import Client, Rubric, RubricDimension, FailureMode
115115

116116
rubric = Rubric(
117117
name="my-rubric",
@@ -141,7 +141,7 @@ All errors carry `.code` and `.details` (the structured payload from the server)
141141

142142
## Versioning
143143

144-
This package is **version-locked** to the npm package. `tangle-agent-eval==0.20.10``@tangle-network/agent-eval@0.20.10`. CI verifies the npm package, Python package, runtime `__version__`, and release tag all agree before publish. If one registry publish fails after the other succeeds, retry the failed publish from the same tag or supersede with the next patch release.
144+
This package is **version-locked** to the npm package. `agent-eval-rpc==0.21.0``@tangle-network/agent-eval@0.21.0`. CI verifies the npm package, Python package, runtime `__version__`, and release tag all agree before publish. If one registry publish fails after the other succeeds, retry the failed publish from the same tag or supersede with the next patch release.
145145

146146
`wire_version` is separate. It bumps only on breaking schema changes. Package versions can differ across releases as long as `wire_version` is the same.
147147

clients/python/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requires = ["hatchling>=1.21"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "tangle-agent-eval"
6+
name = "agent-eval-rpc"
77
version = "0.21.0"
8-
description = "Python client for @tangle-network/agent-eval — judge content against rubrics over HTTP or stdio RPC."
8+
description = "Python RPC client for @tangle-network/agent-eval — judge content against rubrics over HTTP or stdio RPC. Eval logic runs in the Node runtime; this package is a thin wire client."
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
license = { text = "MIT" }
@@ -40,7 +40,7 @@ Issues = "https://github.com/tangle-network/agent-eval/issues"
4040
Documentation = "https://github.com/tangle-network/agent-eval/blob/main/clients/python/README.md"
4141

4242
[tool.hatch.build.targets.wheel]
43-
packages = ["src/tangle_agent_eval"]
43+
packages = ["src/agent_eval_rpc"]
4444

4545
[tool.ruff]
4646
line-length = 100

clients/python/src/tangle_agent_eval/__init__.py renamed to clients/python/src/agent_eval_rpc/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
"""tangle-agent-eval — Python client for @tangle-network/agent-eval.
1+
"""agent-eval-rpc — Python RPC client for @tangle-network/agent-eval.
22
33
The TypeScript package is the source of truth for evaluation logic. This
44
client is a thin transport adapter — every judgement runs in the Node
55
runtime, marshalled over HTTP or stdio RPC. Two languages, one
66
implementation.
77
8+
The package distributes as ``agent-eval-rpc`` on PyPI and imports as
9+
``agent_eval_rpc`` to make the wire-client nature explicit; the rubric
10+
logic lives upstream in ``@tangle-network/agent-eval`` on npm.
11+
812
Quickstart
913
----------
1014
11-
from tangle_agent_eval import Client
15+
from agent_eval_rpc import Client
1216
1317
client = Client() # auto-detects HTTP server, falls back to subprocess
1418
result = client.judge(content="our scaffold supports zero-copy IO", rubric_name="anti-slop")
@@ -42,7 +46,7 @@
4246
)
4347

4448
try:
45-
__version__ = version("tangle-agent-eval")
49+
__version__ = version("agent-eval-rpc")
4650
except PackageNotFoundError:
4751
__version__ = "0.21.0"
4852

File renamed without changes.
File renamed without changes.
File renamed without changes.

clients/python/tests/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import pytest
1010

11-
from tangle_agent_eval.models import JudgeRequest, Rubric, RubricDimension
11+
from agent_eval_rpc.models import JudgeRequest, Rubric, RubricDimension
1212

1313

1414
MIN_RUBRIC = Rubric(

clients/python/tests/test_subprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import pytest
1919

20-
from tangle_agent_eval import Client, RubricNotFoundError, ValidationError
20+
from agent_eval_rpc import Client, RubricNotFoundError, ValidationError
2121

2222
REPO_ROOT = Path(__file__).resolve().parents[3]
2323
CLI_DIST = REPO_ROOT / "dist" / "cli.js"
@@ -48,7 +48,7 @@ def _subprocess_call(self, method: str, params): # type: ignore[override]
4848
raise RuntimeError(f"no stdout. stderr: {proc.stderr}")
4949
envelope = json.loads(proc.stdout.strip().splitlines()[-1])
5050
if "error" in envelope:
51-
from tangle_agent_eval.errors import from_error_body
51+
from agent_eval_rpc.errors import from_error_body
5252
raise from_error_body(proc.returncode or 500, envelope)
5353
return envelope["result"]
5454

0 commit comments

Comments
 (0)