From 3f52a7091ab70ba8430fb6e826eef1df91f7ace2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Gait=C3=A1n-Villamizar?= Date: Mon, 11 May 2026 11:30:52 +0200 Subject: [PATCH 1/2] test(wheel): probe all 5 console aliases and bundled defaults in wheel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the wheel smoke test to assert all five console_scripts entries (interlocks, ilocks, ilock, ils, il) are present and executable after install — previously only `interlocks` and `il` were checked. Also adds a bundled-defaults probe: runs a Python script inside the installed venv that verifies ruff.toml, coveragerc, pyrightconfig.json, and importlinter_template.ini are reachable via interlocks.defaults_path (importlib.resources), confirming they ship in the wheel. --- tests/test_wheel_install.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_wheel_install.py b/tests/test_wheel_install.py index 306243e..5b8f0dd 100644 --- a/tests/test_wheel_install.py +++ b/tests/test_wheel_install.py @@ -51,11 +51,14 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP venv_python = venv / "bin" / "python" run(["uv", "pip", "install", wheel, "--python", venv_python]) + all_aliases = ("interlocks", "ilocks", "ilock", "ils", "il") + for alias in all_aliases: + bin_path = venv / "bin" / alias + assert bin_path.exists(), f"entry point missing: {alias} at {bin_path}" + assert bin_path.stat().st_mode & 0o111, f"entry point not executable: {alias}" + interlocks_bin = venv / "bin" / "interlocks" il_bin = venv / "bin" / "il" - for bin_path in (interlocks_bin, il_bin): - assert bin_path.exists(), f"entry point missing at {bin_path}" - assert bin_path.stat().st_mode & 0o111, f"entry point not executable at {bin_path}" help_out = run([interlocks_bin, "help", "--advanced"]).stdout for expected in ("check", "ci", "pre-commit", "nightly"): @@ -71,6 +74,18 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP for cmd in version_cmds: assert run(cmd).stdout.strip() == version, cmd + # Verify bundled default configs ship inside the wheel and are resolvable + # via interlocks.defaults_path (importlib.resources) — the runtime mechanism + # used by every tool dispatch that lacks a project-native config. + bundled_probe = "\n".join([ + "from interlocks.defaults_path import path", + *[ + f"assert path({n!r}).is_file(), f'bundled default missing: {n}'" + for n in ("ruff.toml", "coveragerc", "pyrightconfig.json", "importlinter_template.ini") + ], + ]) + run([venv_python, "-c", bundled_probe]) + setup_project = tmp_path / "setup-project" setup_project.mkdir() (setup_project / "pyproject.toml").write_text( From abf43ba4008a0f7d533110960c55d9cede96407f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Gait=C3=A1n-Villamizar?= Date: Mon, 11 May 2026 12:43:09 +0200 Subject: [PATCH 2/2] refactor(test): derive aliases and bundled configs dynamically Load console-script aliases from pyproject.toml [project.scripts] and iterate TOOL_CONFIG_SPECS for bundled-config assertions, so both lists stay in sync with their canonical sources automatically. Addresses review feedback from gemini-code-assist. --- tests/test_wheel_install.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_wheel_install.py b/tests/test_wheel_install.py index 5b8f0dd..75885b5 100644 --- a/tests/test_wheel_install.py +++ b/tests/test_wheel_install.py @@ -51,7 +51,8 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP venv_python = venv / "bin" / "python" run(["uv", "pip", "install", wheel, "--python", venv_python]) - all_aliases = ("interlocks", "ilocks", "ilock", "ils", "il") + pyproject_data = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")) + all_aliases = tuple(pyproject_data["project"]["scripts"].keys()) for alias in all_aliases: bin_path = venv / "bin" / alias assert bin_path.exists(), f"entry point missing: {alias} at {bin_path}" @@ -78,11 +79,9 @@ def run(cmd: list[str | Path], *, cwd: Path = tmp_path) -> subprocess.CompletedP # via interlocks.defaults_path (importlib.resources) — the runtime mechanism # used by every tool dispatch that lacks a project-native config. bundled_probe = "\n".join([ - "from interlocks.defaults_path import path", - *[ - f"assert path({n!r}).is_file(), f'bundled default missing: {n}'" - for n in ("ruff.toml", "coveragerc", "pyrightconfig.json", "importlinter_template.ini") - ], + "from interlocks.defaults_path import path, TOOL_CONFIG_SPECS", + "for spec in TOOL_CONFIG_SPECS.values():", + " assert path(spec.filename).is_file(), f'bundled default missing: {spec.filename}'", ]) run([venv_python, "-c", bundled_probe])