Skip to content

Commit f252164

Browse files
committed
refactor(build): deduplicate codex agent template
1 parent 2818250 commit f252164

File tree

4 files changed

+12
-38
lines changed

4 files changed

+12
-38
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ replacement = '](https://github.com/teng-lin/notebooklm-py/blob/v$HFPR_VERSION/S
8686

8787
[tool.hatch.build.targets.wheel]
8888
packages = ["src/notebooklm"]
89-
force-include = {"SKILL.md" = "notebooklm/data/SKILL.md"}
89+
force-include = {"SKILL.md" = "notebooklm/data/SKILL.md", "AGENTS.md" = "notebooklm/data/CODEX.md"}
9090

9191
[tool.pytest.ini_options]
9292
testpaths = ["tests"]

src/notebooklm/data/CODEX.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/integration/test_skill_packaging.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def test_wheel_includes_root_skill_content(tmp_path):
12-
"""The built wheel should carry the canonical repo SKILL.md into package data."""
12+
"""The built wheel should carry the canonical repo agent docs into package data."""
1313
if shutil.which("uv") is None:
1414
pytest.skip("uv is required for build smoke tests")
1515

@@ -27,5 +27,7 @@ def test_wheel_includes_root_skill_content(tmp_path):
2727
wheel_path = next(build_dir.glob("*.whl"))
2828
with zipfile.ZipFile(wheel_path) as wheel:
2929
packaged_skill = wheel.read("notebooklm/data/SKILL.md").decode("utf-8")
30+
packaged_codex = wheel.read("notebooklm/data/CODEX.md").decode("utf-8")
3031

3132
assert packaged_skill == (repo_root / "SKILL.md").read_text(encoding="utf-8")
33+
assert packaged_codex == (repo_root / "AGENTS.md").read_text(encoding="utf-8")

tests/unit/cli/test_agent.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ class TestAgentTemplates:
5353

5454
def test_codex_template_falls_back_to_package_data(self, tmp_path):
5555
"""Test that codex content falls back to packaged data outside repo root."""
56-
with patch.object(agent_templates_module, "REPO_ROOT_AGENTS", tmp_path / "AGENTS.md"):
56+
with (
57+
patch.object(agent_templates_module, "REPO_ROOT_AGENTS", tmp_path / "AGENTS.md"),
58+
patch.object(
59+
agent_templates_module,
60+
"_read_package_data",
61+
return_value="# Repository Guidelines",
62+
),
63+
):
5764
content = agent_templates_module.get_agent_source_content("codex")
5865

5966
assert content is not None

0 commit comments

Comments
 (0)