Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Dec 18, 2025

Summary by Sourcery

Introduce a reusable tox workflow and integrate it into both CI and publish workflows.

Build:

  • Add a reusable .github/workflows/tox.yml workflow encapsulating tox package and stubs jobs.
  • Update ci.yml to use the local reusable tox workflow instead of separate tox-package and tox-stubs jobs.
  • Update publish.yml to run the tox workflow before triggering the PyPI upload job.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 18, 2025

Reviewer's Guide

Refactors tox-related CI logic into a reusable workflow and applies it consistently to both PR CI and publish workflows, ensuring tox runs before publishing to PyPI.

Sequence diagram for updated publish workflow with tox gate before PyPI upload

sequenceDiagram
  actor Developer
  participant GitHubActions
  participant Publish_Workflow
  participant Reusable_tox_Workflow
  participant External_tox_docker
  participant External_tox
  participant PyPI

  Developer->>GitHubActions: Create release (published)
  GitHubActions->>Publish_Workflow: Trigger publish.yml
  Publish_Workflow->>Reusable_tox_Workflow: Run tox job (workflow_call)
  Reusable_tox_Workflow->>External_tox_docker: Run tox-package job
  Reusable_tox_Workflow->>External_tox: Run tox-stubs job
  External_tox_docker-->>Reusable_tox_Workflow: tox-package success
  External_tox-->>Reusable_tox_Workflow: tox-stubs success
  Reusable_tox_Workflow-->>Publish_Workflow: tox jobs completed
  Publish_Workflow->>PyPI: Run pypi-upload job
  PyPI-->>Publish_Workflow: Upload result
Loading

File-Level Changes

Change Details Files
Replace separate tox jobs in CI with a single reusable tox workflow and invoke it from ci.yml for pull_request events.
  • Remove standalone tox-package job that used the shared tox-docker workflow directly.
  • Remove standalone tox-stubs job that ran tox across multiple Python versions in the stubs directory.
  • Introduce a new tox job in ci.yml that calls a local reusable workflow via ./.github/workflows/tox.yml, gated on pull_request events.
.github/workflows/ci.yml
Introduce a reusable tox workflow that encapsulates tox-package and tox-stubs jobs using existing shared workflows.
  • Create .github/workflows/tox.yml as a workflow_call reusable workflow named tox.
  • Define tox-package job within tox.yml that uses coatl-dev/workflows tox-docker.yml@v6.
  • Define tox-stubs job within tox.yml that uses coatl-dev/workflows tox.yml@v6 with Python 3.9–3.12 and working-directory set to stubs.
.github/workflows/tox.yml
Wire the publish workflow to run the reusable tox workflow before uploading to PyPI.
  • Add a tox job to publish.yml that calls the local reusable tox workflow.
  • Make pypi-upload job depend on successful completion of the tox job via needs: tox.
.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
Contributor

@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 there - I've reviewed your changes and they look great!


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 7555416 into main Dec 18, 2025
5 checks passed
@cesarcoatl cesarcoatl deleted the ci/tox-reusable branch December 18, 2025 18:51
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