Skip to content

Run the Prose Gate Through uv in hub_fetch_run.py and the Local Shim #3408

Closed

Description

@ptr727

Problem

CODESTYLE.md "Tests and Script Dependencies" has a hub-hosted script that needs a third-party library declare it in PEP 723 inline metadata and run as uv run --no-project --script <path>. Two runners still execute .github/actions/prose-gate/prose_lint.py in-process through runpy.run_path, which ignores an inline block:

  • catalog/snippets/hub_fetch_run.py, the fleet-wide local route behind the carried catalog/snippets/husky/pre-commit, catalog/snippets/pre-commit/.pre-commit-config.yaml, and the VS Code prose task in catalog/snippets/configs/vscode-tasks-python.json and vscode-tasks.json.
  • scripts/prose_lint.py, the hub's local shim, which OPERATIONS.md, scripts/README.md, and the local-strict-review skill call.

The first PEP 723 block added to prose_lint.py therefore raises ImportError in every downstream repository's local hook and in each of the shim's callers, while CI (which now runs the action through uv run --no-project --script) passes.

Reproduction (constructed)

printf '# /// script\n# dependencies = ["mistletoe"]\n# ///\nimport mistletoe\nprint("ran")\n' > /tmp/gate.py
python3 -c 'import runpy; runpy.run_path("/tmp/gate.py", run_name="__main__")'   # ModuleNotFoundError: mistletoe
uv run --no-project --script /tmp/gate.py                                           # ran

What fixing it needs

  • hub_fetch_run.py runs the fetched file as a subprocess through uv run --no-project --script, passing the exit code through, reporting a missing uv as the gate not running, and keeping the PROSE_GATE_PROVENANCE handling. Its unittest suite exercises the in-process path and changes with it.
  • scripts/prose_lint.py either delegates the same way or its callers switch to the action path. tests/test_cli_usage.py stubs uv as a recorded effect, so a delegating shim fails its --help contract unless it answers --help itself.

This must land before, or with, the pull request that gives prose_lint.py its first dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions