Always include tools as dev deps even when using pre-commit#1251
Conversation
This only affects a couple of tools; codespell and pyproject-fmt
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1020 by ensuring that certain tools (codespell and pyproject-fmt) are always installed as dev dependencies, even when using pre-commit. Previously, these tools were only added as pre-commit hooks without being installed as dev dependencies, which could cause issues with IDE integrations and local development workflows.
Key Changes:
- Modified
use_codespell()anduse_pyproject_fmt()to always add dev dependencies regardless of pre-commit usage - Removed logic from
migrate_config_to_pre_commit()andmigrate_config_from_pre_commit()that conditionally managed dev dependencies - Updated test assertions to expect dev dependencies to be present when using pre-commit
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/usethis/_core/tool.py |
Moved tool.add_dev_deps() calls outside of the pre-commit conditional check for codespell and pyproject-fmt |
src/usethis/_tool/base.py |
Removed conditional dev dependency management logic from migration methods |
tests/usethis/_core/test_core_tool.py |
Updated test assertions to verify dev dependencies are present with pre-commit, added migration tests, and updated expected output messages |
Comments suppressed due to low confidence (1)
tests/usethis/_core/test_core_tool.py:2118
- Corrected spelling of 'codepsell' to 'codespell'.
def test_codepsell_used(
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1251 will not alter performanceComparing Summary
|
This only affects a couple of tools; codespell and pyproject-fmt