Skip to content

Python checks: allow the usual setup steps before tox and nox sessions #345

Backlog

Description

@adityankale190895

Follow-up to #344 (item 2 of #330).

#344 plans tox -e … / nox -s … only when nothing but a plain actions/checkout@vN (or a full SHA, no inputs) or another supported session runs before it. Real workflows almost always set up Python and install the runner first, so the two jobs the fixtures model still stay in CI:

  • mykrok/mykrok misc: actions/setup-python → pip install tox tox-uv → tox -e lint,type
  • googleads/google-ads-mcp lint: actions/setup-python → pip install --upgrade pip → pip install black nox → nox -s lint

Proposal. In discoverPythonChecks (src/planner/python-checks.ts), keep the session context known across:

  • actions/checkout with literal inputs (fetch-depth, ref, persist-credentials …) and semver tags such as @v4.2.2
  • actions/setup-python and astral-sh/setup-uv with literal inputs
  • a pip install / python -m pip install / uv tool install / uv pip install --system step whose arguments are only package names (tox, nox, tox-uv, and the check tools), plus pip install --upgrade pip

Anything else (requirements files, -e ., extras, ${{ }} expressions, custom actions) keeps leaving the session to CI. Note mykrok's tox envs also install project extras, so it would still stay in CI on the tox side; a test against workflows shaped like both jobs should pin the expected result.

The design note in docs/design/affected-checks.md should be updated to match.

Activity

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