Skip to content

Conversation

@fschuch
Copy link
Owner

@fschuch fschuch commented Apr 22, 2025

Summary by CodeRabbit

  • Chores
    • Updated dependency grouping in configuration files for improved management of Python package updates.
    • Centralized and organized optional dependencies for testing and documentation, streamlining environment setup for development and documentation builds.

@coderabbitai
Copy link

coderabbitai bot commented Apr 22, 2025

Walkthrough

This update modifies two configuration files related to dependency management. In the Dependabot configuration, the group name for pip dependencies is changed from "actions" to "pip-dependencies." In the pyproject.toml, optional dependency groups for tests and documentation are introduced, and environment configurations are refactored to reference these groups via features. Explicit dependency lists are removed from environment sections, consolidating dependency management under the new optional dependency groups.

Changes

File(s) Change Summary
.github/dependabot.yml Renamed the pip dependency group from "actions" to "pip-dependencies".
pyproject.toml Added [project.optional-dependencies] for tests, extra tests, and docs. Updated Hatch environment configs to use features referencing these groups, removing explicit dependency and extra-dependency lists. Removed template and install keys from docs env.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Hatch
    participant pyproject.toml

    User->>Hatch: Activate environment (default, test, or docs)
    Hatch->>pyproject.toml: Read features for environment
    pyproject.toml->>Hatch: Provide optional dependency groups (tests, tests-extra, docs)
    Hatch->>User: Set up environment with grouped dependencies
Loading

Poem

In the garden of configs, a tidy new way,
Pip groups renamed, dependencies at play.
Tests and docs now gather in flocks,
With features and groups, no more scattered blocks.
A rabbit hops by, with a wink and a cheer—
"Centralized dependencies, spring cleaning is here!" 🐇✨


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.
    • 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 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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 92de449 and 8044d73.

📒 Files selected for processing (2)
  • .github/dependabot.yml (1 hunks)
  • pyproject.toml (4 hunks)
🔇 Additional comments (1)
.github/dependabot.yml (1)

16-18: Dependabot pip group renamed
Renaming the pip ecosystem group to pip-dependencies aligns nicely with the new optional‑dependencies layout in pyproject.toml. This update looks correct and cohesive.

Comment on lines 100 to 103
[tool.hatch.envs.default]
description = "Base development environment"
features = ["tests"]
installer = "uv"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Include dev group in default environment
After introducing a dev optional-dependencies group, update your default env to install both test and dev tools:

 [tool.hatch.envs.default]
-description = "Base development environment"
-features    = ["tests"]
+features    = ["tests", "dev"]
 installer   = "uv"

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +28 to +45
[project.optional-dependencies]
tests = [
"coverage[toml]>=7.5.3",
"pre-commit>=3.5.0",
"pytest-cov>=5.0.0",
"pytest>=8.2.2",
]
tests-extra = [
"pytest-randomly==3.16.0",
"pytest-rerunfailures==15.0",
"pytest-xdist==3.6.1",
]
docs = [
"docutils==0.20.1",
"jupyter-book==1.0.0",
"sphinx-autobuild==2024.4.16",
"sphinx==7.3.7",
]
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Missing dev and lint tool dependencies
The new optional-dependencies section defines tests, tests-extra, and docs groups but does not include dev tools (e.g., ruff, mypy, codespell). As a result, the default development environment will install only test-related packages and break the lint/type‐check scripts defined under tool.hatch.envs.default.scripts.

Consider adding a dev group to centralize your lint/format/type‑check tools. For example:

 [project.optional-dependencies]
 tests = [
     "coverage[toml]>=7.5.3",
     "pre-commit>=3.5.0",
     "pytest-cov>=5.0.0",
     "pytest>=8.2.2",
 ]
 tests-extra = [
     "pytest-randomly==3.16.0",
     "pytest-rerunfailures==15.0",
     "pytest-xdist==3.6.1",
 ]
 docs = [
     "docutils==0.20.1",
     "jupyter-book==1.0.0",
     "sphinx-autobuild==2024.4.16",
     "sphinx==7.3.7",
 ]
+dev = [
+    "ruff>=0.0.288",
+    "mypy>=1.5.1",
+    "codespell>=2.1.0",
+]

Let me know if you need help determining the exact versions or refining the group contents.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[project.optional-dependencies]
tests = [
"coverage[toml]>=7.5.3",
"pre-commit>=3.5.0",
"pytest-cov>=5.0.0",
"pytest>=8.2.2",
]
tests-extra = [
"pytest-randomly==3.16.0",
"pytest-rerunfailures==15.0",
"pytest-xdist==3.6.1",
]
docs = [
"docutils==0.20.1",
"jupyter-book==1.0.0",
"sphinx-autobuild==2024.4.16",
"sphinx==7.3.7",
]
[project.optional-dependencies]
tests = [
"coverage[toml]>=7.5.3",
"pre-commit>=3.5.0",
"pytest-cov>=5.0.0",
"pytest>=8.2.2",
]
tests-extra = [
"pytest-randomly==3.16.0",
"pytest-rerunfailures==15.0",
"pytest-xdist==3.6.1",
]
docs = [
"docutils==0.20.1",
"jupyter-book==1.0.0",
"sphinx-autobuild==2024.4.16",
"sphinx==7.3.7",
]
dev = [
"ruff>=0.0.288",
"mypy>=1.5.1",
"codespell>=2.1.0",
]

@fschuch
Copy link
Owner Author

fschuch commented Apr 22, 2025

The main goal is to make all environment-specific dependencies work with tools other than hatch, like dependabot.

@fschuch fschuch merged commit b2b678e into main Apr 22, 2025
24 checks passed
@fschuch fschuch deleted the chore/refactor-optional-dependencies-for-support-environments branch April 22, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants