Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions engine/antigravity_engine/hub/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ def _read_entry_points(root: Path, config_contents: dict[str, str]) -> dict[str,
for _cmd, ref in scripts.items():
mod = ref.split(":")[0].replace(".", "/") + ".py"
candidates.append(mod)
candidates.append(f"src/{mod}")
except Exception:
pass

Expand Down
14 changes: 14 additions & 0 deletions engine/tests/test_hub_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ def test_full_scan_detects_entry_points_from_pyproject(tmp_path: Path) -> None:
assert "ag_cli/cli.py" in report.entry_points


def test_full_scan_detects_src_layout_entry_points_from_pyproject(tmp_path: Path) -> None:
"""Entry points in src-layout Python packages should be detected."""
(tmp_path / "pyproject.toml").write_text(
'[project.scripts]\nag = "ag_cli.cli:app"\n', encoding="utf-8"
)
cli_dir = tmp_path / "src" / "ag_cli"
cli_dir.mkdir(parents=True)
(cli_dir / "cli.py").write_text("app = 'hello'\n", encoding="utf-8")

report = full_scan(tmp_path)

assert "src/ag_cli/cli.py" in report.entry_points


def test_full_scan_detects_common_entry_files(tmp_path: Path) -> None:
"""Common entry-point filenames are detected as fallback."""
(tmp_path / "main.py").write_text("if __name__ == '__main__': pass\n", encoding="utf-8")
Expand Down