The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(pm): stage a version for version-less buildable plugin members too
ethernet3d8dfc1da262
diff --git a/pm/workspace.py b/pm/workspace.pyindex 39d5b0d0fbb..98b7fd614eb 100644--- a/pm/workspace.py+++ b/pm/workspace.py@@ -271,14 +271,16 @@ def _workspace_member(plugin_dir: Path, root: Path, *, identity: Path) -> Path:spec["path"] = (identity / relative).resolve().as_posix()changed = Trueif virtual:- project = document.setdefault("project", {})- project["name"] = f"hermes-plugin-{key}"- # uv requires project.version (or dynamic) — a metadata-only member- # has none declared, so give it the same inert version plugin-deps use.- # PEP 621 forbids a static version while "version" is listed under- # project.dynamic, so an explicitly dynamic version is left alone.- if "version" not in project.get("dynamic", ()):- project.setdefault("version", "0.0.0")+ document.setdefault("project", {})["name"] = f"hermes-plugin-{key}"+ project = document.get("project")+ # uv rejects any [project] table whose version is neither set nor dynamic, at+ # parse time and for buildable members too, so a version-less member would abort+ # every `uv lock` of the workspace. Give it the same inert version plugin-deps use.+ # PEP 621 forbids a static version while "version" is listed under+ # project.dynamic, so an explicitly dynamic version is left alone.+ if project is not None and "version" not in project and "version" not in project.get("dynamic", ()):+ project["version"] = "0.0.0"+ changed = Trueif virtual or changed:import tomli_wdiff --git a/tests/pm/test_member_selection.py b/tests/pm/test_member_selection.pyindex 3e1f8616322..3092e714f53 100644--- a/tests/pm/test_member_selection.py+++ b/tests/pm/test_member_selection.py@@ -129,3 +129,23 @@ def test_virtual_member_declaring_dynamic_version_is_left_alone(tmp_path):project = tomllib.loads((member / "pyproject.toml").read_text(encoding="utf-8"))["project"]assert "version" not in projectassert project["dynamic"] == ["version"]+++def test_buildable_member_without_a_version_gets_one_and_keeps_its_name(tmp_path):+ """uv rejects a [project] table with no version at parse time, buildable or not.+ A buildable member still keeps its declared name (uv checks it against its backend)."""+ import tomllib+ from pm.workspace import _workspace_member++ plugin = tmp_path / "home" / "plugins" / "noversion"+ plugin.mkdir(parents=True)+ (plugin / "pyproject.toml").write_text(+ '[project]\nname = "noversion-plugin"\n'+ '[build-system]\nrequires = []\nbuild-backend = "backend"\n',+ encoding="utf-8",+ )+ root = tmp_path / "gen"+ root.mkdir()+ member = _workspace_member(plugin, root, identity=plugin)+ project = tomllib.loads((member / "pyproject.toml").read_text(encoding="utf-8"))["project"]+ assert project == {"name": "noversion-plugin", "version": "0.0.0"}