Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Jan 8, 2026

Summary by Sourcery

Introduce a reusable tox GitHub Actions workflow and consolidate existing tox jobs to use it.

CI:

  • Limit CI and pull request workflows to the 8.3 branch only.
  • Replace inline tox jobs in ci and publish workflows with a shared reusable tox workflow.
  • Simplify publish workflow dependencies by having the PyPI upload job depend on a single consolidated tox job.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 8, 2026

Reviewer's Guide

Introduces a reusable tox workflow and updates existing CI and publish workflows to call it, while narrowing CI triggers to the 8.3 branch and simplifying tox-related jobs and dependencies.

Flow diagram for publish workflow using reusable tox jobs

flowchart TD
  A[Release published event] --> B[Trigger publish.yml]
  B --> C[tox job]
  C --> D[Call reusable tox.yml workflow]
  D --> D1[tox-package job using tox-docker.yml]
  D --> D2[tox-stubs job using shared tox.yml]
  D1 --> E[Tests for package complete]
  D2 --> F[Tests for stubs complete]
  E --> G[Signal tox job success]
  F --> G
  G --> H[pypi-upload job]
  H --> I[Build distributions]
  I --> J[Upload to PyPI]
Loading

File-Level Changes

Change Details Files
Extract tox-related jobs into a reusable GitHub Actions workflow and update CI to use it.
  • Restrict push and pull_request triggers in the main CI workflow to only the 8.3 branch.
  • Replace separate tox-package and tox-stubs jobs with a single tox job that calls the new reusable tox workflow.
  • Pass the current ref from CI into the reusable tox workflow via the checkout-ref input.
.github/workflows/ci.yml
Update the publish workflow to use the reusable tox workflow and simplify job dependencies.
  • Replace separate tox-package and tox-stubs jobs with a single tox job that calls the reusable tox workflow.
  • Pass the release tag as checkout-ref into the reusable workflow.
  • Update the pypi-upload job dependency to wait on the unified tox job instead of two separate tox jobs.
.github/workflows/publish.yml
Create a reusable tox workflow encapsulating package and stub tox jobs.
  • Define a workflow_call-triggered workflow that accepts a checkout-ref input.
  • Add a tox-package job that uses the existing shared tox-docker workflow with the provided ref.
  • Add a tox-stubs job that runs tox across Python 3.9–3.12 in the stubs working directory using the shared tox workflow and the provided ref.
.github/workflows/tox.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In the reusable .github/workflows/tox.yml, consider exposing python-versions and working-directory as inputs rather than hardcoding them so the workflow is flexible if you need to run tox for different targets or interpreters in the future.
  • Now that tox-package and tox-stubs are wrapped in the tox reusable workflow, double-check that needs: tox in publish.yml aligns with your intended dependency granularity (i.e., you don’t need to wait on only one of the inner jobs specifically).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the reusable `.github/workflows/tox.yml`, consider exposing `python-versions` and `working-directory` as inputs rather than hardcoding them so the workflow is flexible if you need to run tox for different targets or interpreters in the future.
- Now that `tox-package` and `tox-stubs` are wrapped in the `tox` reusable workflow, double-check that `needs: tox` in `publish.yml` aligns with your intended dependency granularity (i.e., you don’t need to wait on only one of the inner jobs specifically).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@cesarcoatl cesarcoatl merged commit b0fa5f8 into 8.3 Jan 8, 2026
5 checks passed
@cesarcoatl cesarcoatl deleted the ci/8.3/tox-reusable branch January 8, 2026 08:14
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.

2 participants