HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
environments: a pip wildcard pin is a range, so its check does not call it unpublished (#543)
Rudy Mizrahi Celeklid773ccff6c6d
diff --git a/runner/environments.py b/runner/environments.pyindex ac4426d8..a2270611 100644--- a/runner/environments.py+++ b/runner/environments.py@@ -604,7 +604,14 @@ def spec_parts(spec: str, manager: str) -> tuple[str, str]:for sep in ("==", "="):if sep in s:n, v = s.split(sep, 1)- return n.strip(), v.strip()+ n, v = n.strip(), v.strip()+ # PEP 440's prefix match (`numpy==1.4.*`) is every release whose version begins `1.4.`,+ # not one version, just as npm's `4.x` is not: PyPI's `releases` names exact ones, so a+ # range read as a pin was "not published". pip resolves it at build time. apt keeps its+ # pin verbatim: it has no wildcard, so `=1.4.*` really is not in the sources.+ if manager == "pip" and v.endswith(".*"):+ return n, ""+ return n, vreturn s, ""diff --git a/runner/tests/test_environments.py b/runner/tests/test_environments.pyindex 669b6788..d83e15e2 100644--- a/runner/tests/test_environments.py+++ b/runner/tests/test_environments.py@@ -753,6 +753,27 @@ def test_an_npm_range_is_a_name_with_no_pin(monkeypatch):assert "not published" in E.check_package("npm", "[email protected]")["error"]+def test_a_pip_wildcard_pin_is_a_name_with_no_pin(monkeypatch):+ """PEP 440's prefix match (`numpy==1.4.*`) is every release beginning `1.4.`, not one version,+ the way npm's `[email protected]` is not. It went through as an exact pin, so it was checked against+ PyPI's exact releases and refused as "not published" though pip installs it."""+ for spec in ("numpy==1.4.*", "numpy==1.*", "numpy == 1.4.* "):+ assert E.spec_parts(spec, "pip") == ("numpy", ""), spec+ for spec, want in (("numpy==1.4.0", ("numpy", "1.4.0")), ("numpy==1.4.0rc1", ("numpy", "1.4.0rc1")),+ ("numpy", ("numpy", ""))):+ assert E.spec_parts(spec, "pip") == want, spec++ answers = {"https://pypi.org/pypi/numpy/json": (200, {"info": {"version": "2.3.1", "name": "numpy"},+ "releases": {"1.4.0": {}, "1.4.1": {}, "2.3.1": {}}})}+ monkeypatch.setattr(E, "_http_json", lambda url: answers.get(url, (503, {})))+ ranged = E.check_package("pip", "numpy==1.4.*")+ assert ranged["exists"] is True and ranged["error"] == "" and ranged["version"] == ""+ assert "not published" in E.check_package("pip", "numpy==9.9.9")["error"]+ # and an apt declaration keeps its pin verbatim: apt has no wildcard, so `=1.4.*` is a pin+ # that is genuinely not in the sources, which is what the check should say.+ assert E.spec_parts("jq=1.4.*", "apt") == ("jq", "1.4.*")++def test_an_npm_dist_tag_resolves_to_its_version(monkeypatch):"""#494: `lodash@latest` names a dist-tag, not a version — the check resolves the taginstead of reporting it "not published". An unknown tag keeps the error."""