Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Jan 8, 2026

Summary by Sourcery

Introduce a reusable tox workflow and update CI and publish workflows to use it for package and stub testing.

Enhancements:

  • Add a reusable tox workflow that encapsulates package and stubs tox jobs, parameterized by checkout ref.

CI:

  • Replace separate tox-package and tox-stubs jobs in CI with a single job that calls a shared tox reusable workflow.
  • Update CI branch filters to only run on the 8.1 branch for push and pull_request events.
  • Refactor the publish workflow to use the new reusable tox workflow and depend on its completion before uploading to PyPI.

@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, simplifying tox job configuration and dependencies while narrowing branch triggers.

Flow diagram for updated CI workflow calling reusable tox workflow

flowchart TD
  A[Push to branch 8.1] --> B[Run ci workflow]
  C[Pull request targeting branch 8.1] --> B

  subgraph CI_Jobs[ci workflow jobs]
    B --> D[Job pre-commit
runs on ubuntu-latest]
    C --> E[Job tox
if event is pull_request]
  end

  subgraph Reusable_Tox[tox reusable workflow]
    E --> F[workflow_call with input checkout-ref]
    F --> G[tox-package job
uses tox-docker reusable workflow]
    F --> H[tox-stubs job
uses tox reusable workflow]
  end
Loading

Flow diagram for updated publish workflow calling reusable tox workflow

flowchart TD
  A[Release published event] --> B[Run publish workflow]

  subgraph Publish_Jobs[publish workflow jobs]
    B --> C[Job tox
uses reusable tox workflow]
    C --> D[pypi-upload job
needs tox]
  end

  subgraph Reusable_Tox[tox reusable workflow]
    C --> E[workflow_call with input checkout-ref
set from release tag]
    E --> F[tox-package job
uses tox-docker reusable workflow]
    E --> G[tox-stubs job
uses tox reusable workflow]
  end
Loading

File-Level Changes

Change Details Files
Introduce a reusable tox workflow and consolidate tox-package and tox-stubs into it.
  • Create .github/workflows/tox.yml as a reusable workflow triggered via workflow_call with a checkout-ref input.
  • Move tox-package job definition into the reusable workflow, still using the existing external tox-docker workflow.
  • Move tox-stubs job definition into the reusable workflow, preserving Python versions and working-directory while parameterizing checkout-ref.
.github/workflows/tox.yml
Update CI workflow to consume the reusable tox workflow and adjust branch filters.
  • Change push and pull_request branch filters to only run on branch 8.1.
  • Replace separate tox-package and tox-stubs jobs with a single tox job that calls the new reusable tox workflow, passing the current github.ref.
.github/workflows/ci.yml
Update publish workflow to consume the reusable tox workflow and simplify job dependencies.
  • Replace separate tox-package and tox-stubs jobs with a single tox job that calls the new reusable tox workflow, passing the release tag as checkout-ref.
  • Update pypi-upload job to depend on the unified tox job instead of both tox-package and tox-stubs.
.github/workflows/publish.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:

  • The CI workflow no longer runs on the 8.3 branch for either push or pull_request events; double-check that dropping 8.3 from CI triggers is intentional and not an accidental regression.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The CI workflow no longer runs on the `8.3` branch for either `push` or `pull_request` events; double-check that dropping `8.3` from CI triggers is intentional and not an accidental regression.

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 3d14373 into 8.1 Jan 8, 2026
5 checks passed
@cesarcoatl cesarcoatl deleted the ci/8.1/tox-reusable branch January 8, 2026 08:03
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