Skip to content

Python checks: read pre-commit, tox/nox and more uv and make forms #330

Open

Description

@adityankale190895

CLI 0.3.57 added Python gate checks read from GitHub Actions workflows (python-checks.ts). It deliberately reads only two forms, and adds nothing for anything else:

  • make [-C dir] <target> for a check-named target the Makefile defines;
  • direct mypy, pyright, basedpyright, pyrefly check, ruff check and ruff format --check calls, optionally behind uv run, poetry run, pdm run, hatch run, pipenv run or python -m.

Real Python repositories often run their checks in other ways. Any one of these is a self-contained PR:

  1. pre-commit. pre-commit run --all-files (or pre-commit/action) in a workflow. With a change, pre-commit run --files <changed files> is the natural narrowed form. Hooks that rewrite files (formatters, --fix) must never be run as checks.
  2. tox and nox. tox -e lint,type or nox -s lint: read the env or session from tox.ini / noxfile.py and add it only when its commands are recognised checks.
  3. uv options before run. uv --directory dify-agent run --project . pyrefly check is not read as Python-only today, so the check always runs. Accept global uv options before run.
  4. Direct calls in a step with a working-directory. These are left out today. Running them needs the working directory carried into the planned command in a way that works on Windows (cmd.exe) and POSIX shells.
  5. Make recipes that call $(MAKE) other-target. Follow the call (with a depth limit) instead of treating the target as unreadable.

Rules for every item (see the file's header comment):

  • Fail closed: anything not read with certainty adds nothing.
  • Never run a command that rewrites files or writes output files.
  • A check counts as Python-only, and can be skipped for a change with no Python files, only when everything it runs is known.

Done when: the PR covers one item, with tests in tests/planner/python-checks.test.ts using a synthetic workflow and, where it applies, a Makefile, tox.ini or .pre-commit-config.yaml modelled on a real public repository (name it in the test). Run npm test and npm run audit:boundary, and sign off commits with git commit -s (DCO). Comment here with the item you want to take, and ask anything. Setup is in CONTRIBUTING.md.

Activity

  1. added
    enhancement
    help wanted
    on Nov 18, 2026
  2. KingEmma7 commented on Nov 19, 2026

    @KingEmma7
    Contributor

    I’ll take item 3: recognizing known uv global options before run in Python workflow checks, including the Dify --directory example.

  3. adityankale190895 commented on Nov 21, 2026

    @adityankale190895
    MemberAuthor

    Thanks @KingEmma7, item 3 is yours: it's in #333. Items 1, 2, 4 and 5 are still open for anyone who wants one; comment here with the item you'd like to take.

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

    adapterenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions