Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move from setuptools setup.py -> project.toml #58

Merged
merged 6 commits into from
Feb 8, 2025
Merged

move from setuptools setup.py -> project.toml #58

merged 6 commits into from
Feb 8, 2025

Conversation

ypriverol
Copy link
Contributor

@ypriverol ypriverol commented Feb 8, 2025

Summary by CodeRabbit

  • New Features
    • Transitioned to a modern dependency management and build process that enhances installation consistency.
  • Documentation
    • Updated installation instructions to reflect the new build commands and packaging approach.
  • Chores
    • Streamlined automation workflows to improve release efficiency and overall performance.

Copy link
Contributor

coderabbitai bot commented Feb 8, 2025

Walkthrough

The changes update the project’s CI workflows and packaging configuration. The GitHub workflows now install dependencies with "python -m pip", introduce "poetry" for building, and install the resulting wheel from the dist folder. The README now reflects building via pyproject.toml, and a new pyproject.toml file provides project metadata and dependency definitions. Additionally, the recipe has been updated to use poetry-core instead of setuptools, and the legacy setup.py has been removed.

Changes

File(s) Change Summary
.github/workflows/python-app.yml
.github/workflows/python-package.yml
.github/workflows/python-publish.yml
Modified dependency installation steps: replaced direct pip installs with "python -m pip install", added poetry installation and build steps, and updated package installation commands.
README.md Updated the installation instructions to build the package using pyproject.toml instead of setup.py.
pyproject.toml New configuration file added with project metadata, dependency definitions, build system requirements, and CLI entry point setup.
recipe/meta.yaml Changed build dependency from setuptools to "poetry-core >=1.2.0" for the host requirements.
setup.py Removed the legacy setuptools-based packaging configuration file.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as GitHub Runner
    participant Pip as PIP Installer
    participant Poetry as Poetry Builder
    participant Dist as Distribution Folder

    Runner->>Pip: Install flake8 & pytest (using python -m pip)
    Runner->>Pip: Install poetry (using python -m pip)
    Runner->>Poetry: Build package (poetry build)
    Poetry->>Dist: Generate wheel file
    Runner->>Pip: Install built wheel from dist/*.whl
Loading

Poem

Hoppin' through the code, I take a joyful sprint,
CI steps align in a carefully crafted print.
Pip meets Poetry in a dance so light,
Wheels spin and build under the moonlight.
I, a cheery rabbit, celebrate each new byte!


🪧 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. (Beta)
  • @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
Contributor

@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: 1

🧹 Nitpick comments (3)
recipe/meta.yaml (1)

27-28: Clarify inclusion of setuptools in run requirements.
While the host now uses "poetry-core", "setuptools" still appears in the run requirements. Confirm that setuptools is necessary during runtime, or consider removing it if no longer needed.

.github/workflows/python-publish.yml (1)

22-27: Adopt Poetry-based build commands.
The updated "Install dependencies" step installs flake8 and pytest using "python -m pip install", installs Poetry, and then runs "poetry build" followed by installing the generated wheel. This approach aligns with the overall migration to Poetry. For improved reproducibility, consider pinning the Poetry version explicitly.

README.md (1)

29-29: Update Section Title to Reflect New Build Process

The heading "Install with setup.py:" is now misleading because the project has migrated from a setuptools‑based setup to the new pyproject.toml/poetry build approach. Consider updating the section title to something like "Build from Source" or "Installation from Source" to better reflect the current build process.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dc208a7 and 0b106a3.

📒 Files selected for processing (7)
  • .github/workflows/python-app.yml (1 hunks)
  • .github/workflows/python-package.yml (1 hunks)
  • .github/workflows/python-publish.yml (1 hunks)
  • README.md (1 hunks)
  • pyproject.toml (1 hunks)
  • recipe/meta.yaml (1 hunks)
  • setup.py (0 hunks)
💤 Files with no reviewable changes (1)
  • setup.py
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

34-34: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (10)
pyproject.toml (6)

1-4: Review backend configuration in build-system.
The build backend is currently set to "setuptools.build_meta" with "setuptools>=45" and "wheel". However, note that in recipe/meta.yaml the host requirements have been updated to require "poetry-core >=1.2.0". Please verify that this is intentional. If the goal is to adopt a Poetry-based build workflow, consider updating the backend to "poetry.core.masonry.api" to maintain consistency.


5-28: Project metadata configuration looks solid.
The [project] section clearly defines the name, version, description, authors, Python version requirement, keywords, license information, and dependencies. Everything appears well organized. Just double-check that including certain packages (e.g. "setuptools") in dependencies is intentional and necessary at runtime.


29-31: Project URLs defined correctly.
The Homepage URL is appropriately specified in the [project.urls] section.


32-34: CLI entry point setup is appropriate.
Mapping the command "pridepy" to "pridepy:main" in the [project.scripts] section is correctly configured for the command-line interface.


35-38: Setuptools configuration is in place.
The [tool.setuptools] block, which specifies the packages and Python modules, is correctly set up for package building.


39-41: Package data configuration is clear.
The package data patterns declared in [tool.setuptools.package-data] ensure that ancillary files (like *.txt and *.md) are included.

recipe/meta.yaml (1)

20-23: Update host requirements with Poetry-core.
Replacing "setuptools" with "poetry-core >=1.2.0" in the host requirements is a positive step towards adopting a Poetry-based build process. Please ensure that this change aligns with your overall build configuration, especially in light of the build backend specified in pyproject.toml.

.github/workflows/python-publish.yml (1)

28-29: Review potential redundancy in build steps.
The workflow first builds the package using "poetry build" and then issues a separate "python -m build" command. This may result in duplicate builds or conflicting artifacts. Please verify if both steps are necessary or if they can be consolidated.

.github/workflows/python-package.yml (1)

20-25: Consistent dependency installation with Poetry.
The installation step now leverages "python -m pip install" for flake8 and pytest, installs Poetry, executes "poetry build", and then installs the resulting wheel file. This updated process is consistent with the new packaging workflow.

.github/workflows/python-app.yml (1)

28-32: Streamlined installation and build process.
The "Install dependencies" step installs necessary tools (flake8, pytest, Poetry), builds the package using "poetry build", and installs the built wheel from the "dist" folder. This sequence aligns with the transitions in your workflows. Just ensure that the built artifacts are correctly updated before the subsequent linting and testing steps run.

README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@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)
pyproject.toml (2)

74-83: Code Formatting Configuration (Black): Minor Version Consideration.
The Black configuration is clearly specified with a custom line length and target version. Note that the target-version is set to "py39" while the project dependency specifies "^3.7". Consider aligning these if you intend to support earlier Python versions or confirm that 3.9-specific formatting is acceptable.


93-106: Static Type Checking (Mypy): Verify Python Version Alignment.
The Mypy configuration is thorough; however, note that the "python_version" is set to "3.9" even though the project claims support for Python "^3.7". Make sure this reflects your actual deployment target or adjust accordingly to avoid potential discrepancies during static analysis.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b106a3 and 6a066d6.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (11)
pyproject.toml (11)

1-12: Metadata Configuration: Comprehensive and Properly Structured.
The metadata block defines essential fields such as project name, version, description, authors, maintainers, readme, and license. Ensure that the "maintainers" field aligns with PEP 621 (if applicable) or your internal standards.


13-21: Project Keywords: Clear and Domain-Relevant.
The list of keywords effectively captures the project's context in proteomics and bioinformatics.


22-34: Classifiers: Informative and Well-Selected.
These classifiers correctly indicate the intended audience, license type, operating system independence, and the supported Python versions.


35-37: Package Inclusion: Correct Configuration.
The package section accurately includes the "pridepy" module.


38-44: Static Files Inclusion: Adequate.
Including key assets such as LICENSE, README.md, and text/markdown files ensures they are bundled in the distribution.


46-55: Runtime Dependencies: Properly Defined.
The dependencies block fixes a minimum Python version (^3.7) and constrains key libraries (like requests, ratelimit, etc.) to specific versions. Double-check these constraints to ensure compatibility across your environments.


57-62: Development Dependencies: Well Specified.
All essential tools for testing, formatting, and static analysis (pytest, black, isort, pytest-cov, mypy) are clearly declared in the dev dependency group.


64-69: Project URLs: Informative and Accurate.
The URLs provide useful links (PyPI, documentation, repository, etc.) that support both users and contributors.


71-73: Script Entry Point: Defined Correctly.
The entry point maps the "pridepy" command to the main function in the pridepy module, ensuring that the CLI behaves as expected.


84-92: Import Sorting (isort) Configuration: Well Aligned with Black.
The isort settings complement the Black configuration, ensuring consistent formatting of import statements throughout the project.


107-109: Build System: Correctly Configured.
Specifying "poetry-core>=1.2.0" and using "poetry.core.masonry.api" as the build-backend adheres to modern packaging best practices.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@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

🔭 Outside diff range comments (1)
README.md (1)

29-36: Update section header for clarity.

The heading "Install with setup.py:" is now misleading since the project has transitioned to using Poetry via pyproject.toml for building. To avoid confusion, please update the header to something like "Build from Source Using Poetry" (or a similar title) that reflects the new packaging approach.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

32-32: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


33-33: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


34-34: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


35-35: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

🧹 Nitpick comments (1)
README.md (1)

34-34: Maintain markdown command style consistency.

The command line showing "$ poetry build" includes a shell prompt, which might trigger markdownlint (MD014) warnings about dollar signs without output. Consider either removing the dollar sign or providing sample output if applicable, to better conform with markdown style guidelines.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

34-34: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6a066d6 and 1e3b4c8.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

34-34: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build

@ypriverol ypriverol requested a review from selvaebi February 8, 2025 09:22
@ypriverol ypriverol merged commit a8d6100 into master Feb 8, 2025
9 checks passed
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.

1 participant