-
Notifications
You must be signed in to change notification settings - Fork 1
Reorganize optional dependencies in pyproject.toml #49
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
Reorganize optional dependencies in pyproject.toml #49
Conversation
WalkthroughThis 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 Changes
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
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📒 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 topip-dependenciesaligns nicely with the new optional‑dependencies layout inpyproject.toml. This update looks correct and cohesive.
| [tool.hatch.envs.default] | ||
| description = "Base development environment" | ||
| features = ["tests"] | ||
| installer = "uv" |
There was a problem hiding this comment.
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.
| [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", | ||
| ] |
There was a problem hiding this comment.
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.
| [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", | |
| ] |
|
The main goal is to make all environment-specific dependencies work with tools other than hatch, like dependabot. |
Summary by CodeRabbit