Skip to content

chore: move deps from requirements-dev.txt to pyproject.toml #120

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

shenxianpeng
Copy link
Collaborator

@shenxianpeng shenxianpeng commented Jun 1, 2025

Summary by CodeRabbit

  • Chores
    • Updated development dependency management to use a standardized extras group, simplifying installation commands.
    • Removed the separate development requirements file.
    • Updated workflow and environment setup instructions to reflect these changes.

@shenxianpeng shenxianpeng requested a review from Copilot June 1, 2025 22:37
@shenxianpeng shenxianpeng added the enhancement New feature or request label Jun 1, 2025
Copy link

sonarqubecloud bot commented Jun 1, 2025

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Consolidate developer dependencies into pyproject.toml and update install commands to use the new extras.

  • Removed requirements-dev.txt and added a [project.optional-dependencies] dev group.
  • Updated Gitpod and GitHub Actions to install using pip install .[dev].

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
requirements-dev.txt Removed file after moving dev dependencies to pyproject.toml
pyproject.toml Added dev extra under [project.optional-dependencies]
.gitpod.yml Replaced pip install -r requirements-dev.txt with . [dev] install
.github/workflows/python-test.yml Replaced -r requirements-dev.txt install with . [dev] install
Comments suppressed due to low confidence (2)

.gitpod.yml:8

  • The command step was removed, so the workspace won't reinstall the package on start. Re-add a command: pip install -e .[dev] to match the install in before.
command: pip install -e .

pyproject.toml:44

  • The dev extra is missing flake8, which was previously in requirements-dev.txt. Add "flake8" to ensure linting tools are installed.
"pre-commit",

Copy link

codecov bot commented Jun 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.42%. Comparing base (0529202) to head (5d32d29).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #120   +/-   ##
=======================================
  Coverage   95.42%   95.42%           
=======================================
  Files           7        7           
  Lines         284      284           
=======================================
  Hits          271      271           
  Misses         13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

coderabbitai bot commented Jun 1, 2025

Walkthrough

The changes consolidate Python development dependency management by defining a [project.optional-dependencies] dev group in pyproject.toml, removing requirements-dev.txt, and updating both the GitHub Actions workflow and Gitpod configuration to install development dependencies via the new extras group. Installation commands are streamlined to use pip install .[dev] or pip install -e .[dev].

Changes

Files/Paths Change Summary
pyproject.toml Added [project.optional-dependencies] section with a dev group listing development dependencies.
requirements-dev.txt Deleted the file; development dependencies are now managed via pyproject.toml.
.github/workflows/python-test.yml Updated dependency installation to use pip install .[dev] instead of separate commands/files.
.gitpod.yml Changed setup to use pip install -e .[dev] and removed redundant install command.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Environment (GitHub Actions/Gitpod)
    participant pip
    participant pyproject.toml

    Developer->>Environment (GitHub Actions/Gitpod): Trigger setup (CI run or workspace start)
    Environment->>pip: pip install .[dev] or pip install -e .[dev]
    pip->>pyproject.toml: Read [project.optional-dependencies].dev
    pip->>Environment: Install main package + dev dependencies (coverage, pre-commit, pytest)
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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

@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 (1)

41-46: Enhance the dev extras group and update documentation.
The new dev extras look good, but since the project configures MyPy (see [tool.mypy]), consider adding "mypy" to this list so the type checker is installed automatically. Also, don’t forget to update the README and any docs to replace references to requirements-dev.txt with the new pip install .[dev] command.

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

40-40: Quote the extras spec to avoid shell globbing.
Unquoted brackets (.[dev]) can be interpreted as a glob pattern in Unix shells. Wrap the extras in quotes to prevent this:

- python3 -m pip install .[dev]
+ python3 -m pip install ".[dev]"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0529202 and 5d32d29.

📒 Files selected for processing (4)
  • .github/workflows/python-test.yml (1 hunks)
  • .gitpod.yml (1 hunks)
  • pyproject.toml (1 hunks)
  • requirements-dev.txt (0 hunks)
💤 Files with no reviewable changes (1)
  • requirements-dev.txt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.gitpod.yml (1)

7-7:

❌ Incorrect review comment

Verify Gitpod task key for dependency installation.
The before field may not be a valid key in Gitpod’s tasks spec. Please confirm it executes as intended; otherwise, move the pip install -e .[dev] step into a supported stage (e.g., init or command) to ensure dependencies are installed reliably.


Sure—let’s inspect the .gitpod.yml around the tasks: and before: lines to confirm how it’s defined.


🏁 Script executed:

#!/bin/bash
set -e

# Show the 'tasks:' block and surrounding lines
rg -n "tasks:" .gitpod.yml -C5 || true

# Show any 'before:' entries nearby
rg -n "before:" .gitpod.yml -C2 || true

Length of output: 523


To confirm whether before is valid in the Gitpod tasks spec, let’s check the official Gitpod docs:


🌐 Web query:

Does Gitpod .gitpod.yml tasks support a 'before' key?

💡 Result:

Yes, Gitpod's .gitpod.yml tasks support a before key. This key is used to define preparatory steps that should run before the init and command tasks. For example, you can use the before task to set up tools or permissions necessary for your project. (gitpod.io)

Here's an example of how to use the before key in your .gitpod.yml file:

tasks:
  - before: |
      echo 'Running preparatory steps...'
      # Add your preparatory commands here
  - init: |
      echo 'Running initialization steps...'
      # Add your initialization commands here
  - command: |
      echo 'Running main command...'
      # Add your main command here

In this configuration, the before task runs first, followed by the init task, and then the command task. Each task runs in its own terminal, and the before task is expected to terminate upon completion. (gitpod.io)

For more detailed information on configuring tasks in Gitpod, you can refer to the official documentation. (gitpod.io)

Citations:


No action needed: before is valid in Gitpod tasks
The Gitpod tasks spec supports a before key for preparatory steps, so keeping

tasks:
  - name: Setup & Install
    before: pip install -e .[dev]
    init: pre-commit install

is correct.

Likely an incorrect or invalid review comment.

@shenxianpeng shenxianpeng merged commit 2b9e3ec into main Jun 2, 2025
59 checks passed
@shenxianpeng shenxianpeng deleted the drop-requirement-txt branch June 2, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant