Conditionally include tomli as a codespell dep based on Python version#1277
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1277 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Pull request overview
This PR modifies the codespell tool integration to conditionally include the tomli dependency based on the Python version. Since Python 3.11+ includes tomllib in the standard library, tomli is only needed for Python versions below 3.11. The logic checks the project's requires-python field or falls back to the interpreter version to determine whether to include tomli as a dependency.
Key changes:
- Updated
CodespellTool.get_dev_deps()to conditionally includetomlibased on Python version requirements - Modified tests to dynamically check the interpreter version and adjust expected output accordingly
- Added comprehensive test coverage for various
requires-pythonscenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/usethis/_tool/impl/codespell.py | Added logic to conditionally include tomli dependency based on Python version |
| tests/usethis/_tool/impl/test_codespell.py | Added test suite for get_dev_deps method covering various Python version scenarios |
| tests/usethis/_ui/interface/test_spellcheck.py | Updated tests to dynamically check interpreter version and adjust expected output |
| tests/usethis/_ui/interface/test_init.py | Updated test to conditionally expect tomli in output based on interpreter version |
| tests/usethis/_core/test_core_tool.py | Updated tests to check interpreter version and adjust expected dependency messages |
No description provided.