Skip to content

test(wheel): probe all 5 console aliases and bundled defaults#50

Open
0xjgv wants to merge 2 commits into
mainfrom
unit9-wheel-probe
Open

test(wheel): probe all 5 console aliases and bundled defaults#50
0xjgv wants to merge 2 commits into
mainfrom
unit9-wheel-probe

Conversation

@0xjgv

@0xjgv 0xjgv commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extends tests/test_wheel_install.py to check all 5 [project.scripts] aliases (interlocks, ilocks, ilock, ils, il) are present and executable after wheel install — previously only interlocks and il were checked.
  • Adds a bundled-defaults probe that runs inside the installed venv and verifies ruff.toml, coveragerc, pyrightconfig.json, and importlinter_template.ini are resolvable via interlocks.defaults_path (importlib.resources), confirming they ship in the wheel.

Test plan

  • uv run pytest -q tests/test_wheel_install.py — 1 passed
  • uvx ruff check tests/test_wheel_install.py — all clear
  • Pre-commit hook (fix + format + typecheck) passed on cherry-pick

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the wheel installation tests by expanding the verification of entry point aliases and ensuring that bundled configuration files are correctly included and resolvable at runtime. The reviewer suggested improving maintainability by dynamically loading the list of aliases from pyproject.toml and the list of bundled configuration files from TOOL_CONFIG_SPECS to avoid hardcoding and potential desynchronization.

Comment thread tests/test_wheel_install.py Outdated
venv_python = venv / "bin" / "python"
run(["uv", "pip", "install", wheel, "--python", venv_python])

all_aliases = ("interlocks", "ilocks", "ilock", "ils", "il")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of aliases is already defined in pyproject.toml. To avoid duplication and ensure the test stays in sync with the package definition, you can load them dynamically from the project metadata.

    pyproject_data = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))
    all_aliases = tuple(pyproject_data["project"]["scripts"].keys())

Comment on lines +80 to +86
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")
],
])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of hardcoding the list of bundled configuration files, you can derive them dynamically from TOOL_CONFIG_SPECS. This ensures that any new tools added to the package are automatically covered by this wheel installation test, improving maintainability and reducing duplication. Note that mutmut.toml is mentioned in the pyproject.toml comments as a bundled file but is currently missing from both TOOL_CONFIG_SPECS and this test probe.

    bundled_probe = "\n".join([
        "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}'",
    ])

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant