Skip to content

ci: fix PyPI publishing process, enforce mypy types#20

Merged
cademirch merged 6 commits intosnakemake:mainfrom
jjjermiah:main
Mar 16, 2025
Merged

ci: fix PyPI publishing process, enforce mypy types#20
cademirch merged 6 commits intosnakemake:mainfrom
jjjermiah:main

Conversation

@jjjermiah
Copy link
Copy Markdown
Contributor

@jjjermiah jjjermiah commented Mar 15, 2025

Introduce a new publish environment in pyproject.toml and update the release workflow to fix the PyPI publishing process.

Summary by CodeRabbit

  • Chores

    • Streamlined the Python package release process with a new publishing approach.
    • Now builds both source and wheel distributions with an added build verification step.
    • Removed redundant setup steps for a more efficient release workflow.
  • Documentation

    • Enhanced clarity of method signatures with added type annotations in various classes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 15, 2025

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • src/snakemake_interface_logger_plugins/py.typed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The GitHub Actions workflow file has been revised to update the build and release process. The job formerly known as setup_and_build has been renamed to publish-pypi. The steps for setting up Python, installing Poetry, and managing dependencies have been removed. Instead, the workflow now checks out the repository, installs Pixi (with a specified version and in publish mode), builds both source and wheel distributions with an added build check, and publishes the package to PyPI. Artifact downloading is no longer part of the process.

Changes

File Change Summary
.github/workflows/release-please.yml Renamed job from setup_and_build to publish-pypi. Removed the steps for Python setup, Poetry installation, and dependency management. Added steps to checkout the repository, install Pixi (with version and publish environment), build distributions with a build check, and publish to PyPI.
src/snakemake_interface_logger_plugins/common.py Added type annotations to StrEnum class methods: _generate_next_value_ (static method), __str__, and __repr__.
src/snakemake_interface_logger_plugins/registry/plugin.py Added return type annotations to name, cli_prefix, and settings_cls methods in the Plugin class.

Possibly related PRs

  • fix: use release-please python #7: The changes in the main PR, which involve a complete restructuring of the release-please workflow, are related to the modifications in the retrieved PR that also alter the release-please job configuration, specifically focusing on the release strategy for Python projects.

Suggested reviewers

  • cademirch
  • johanneskoester

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/release-please.yml (2)

30-35: Pixi Installation Step
The Pixi installation is implemented with prefix-dev/setup-pixi@v0.8.3, specifying both the pixi-version: v0.42.1 and the environments: publish parameter. This step appears correct, but please double-check that the parameter key (environments) exactly matches the expected input for the Pixi action.


42-42: File Ending Newline
Static analysis has flagged that there is no newline character at the end of the file. Please add a newline at the end to comply with YAML linting rules and improve file formatting.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31b720c and 6722e37.

⛔ Files ignored due to path filters (2)
  • pixi.lock is excluded by !**/*.lock
  • pyproject.toml is excluded by !pyproject.toml
📒 Files selected for processing (1)
  • .github/workflows/release-please.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/release-please.yml

[error] 42-42: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (4)
.github/workflows/release-please.yml (4)

19-27: New Job Introduction: Publish-PyPI Job
The addition of the publish-pypi job is well-structured. It correctly depends on the release-please job and sets appropriate permissions and environment. Verify that the conditional if: ${{ needs.release-please.outputs.release_created }} reliably triggers the job only when a release is actually created.


28-29: Checkout Step in Publish-PyPI Job
The checkout step using actions/checkout@v4 is standard and properly positioned as the first step in the new job.


36-39: Build Distribution and Check Build Step
The build step runs the command pixi run --environment publish check-build to build both source and wheel distributions, which is critical for ensuring package integrity before publishing. The accompanying comment clarifies the intent, and the implementation adheres to the new workflow requirements.


41-42: Publish Distribution to PyPI Step
The use of pypa/gh-action-pypi-publish@release/v1 to publish the distribution to PyPI is a standard approach and is appropriately placed after the build validation step.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: no new line character at the end of file

(new-line-at-end-of-file)

@jjjermiah jjjermiah changed the title ci: update release workflow to streamline PyPI publishing process ci: update release workflow to fix PyPI publishing process Mar 15, 2025
@jjjermiah jjjermiah changed the title ci: update release workflow to fix PyPI publishing process ci: fix PyPI publishing process, enforce mypy types Mar 16, 2025
Copy link
Copy Markdown
Collaborator

@cademirch cademirch left a comment

Choose a reason for hiding this comment

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

Lgtm. Thanks for tackling this.

@cademirch cademirch merged commit 63a89f3 into snakemake:main Mar 16, 2025
6 checks passed
@jjjermiah jjjermiah moved this to Done in Roadmap Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants