Split usethis._tool.impl into spec/ and base/ submodules#1357
Closed
Split usethis._tool.impl into spec/ and base/ submodules#1357
usethis._tool.impl into spec/ and base/ submodules#1357Conversation
- Create src/usethis/_tool/impl/spec/ with *ToolSpec classes - Create src/usethis/_tool/impl/base/ with *Tool classes - Update original impl/*.py files as re-export shims for backward compat - Update circular lazy imports (pytest/coverage_py) to point to base/ - Update base/pyproject_toml.py to import from base/ directly - Fix test_pytest.py monkeypatch to target new base.pytest module Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Import SetupCFGManager from usethis._file.setup_cfg.io_ in base/codespell.py - Normalize 'to avoid circularity' comment style to end with period Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Split the usethis._tool.impl layer into spec and base layers
Split Mar 11, 2026
usethis._tool.impl into spec/ and base/ submodules
This was referenced Mar 11, 2026
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Collaborator
|
@copilot I have added a skill called |
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each module in
usethis._tool.implcontained both a*ToolSpecclass (static metadata, deps, pre-commit config) and a*Toolclass (runtime behavior). This PR splits them into parallel submodules and removes the original flat modules.Changes
impl/spec/— one file per tool, containing only*ToolSpecsubclasses and their supporting constants/helpers (e.g._RUFF_VERSION,_importlinter_warn_no_packages_found)impl/base/— one file per tool, containing only*Toolsubclasses; each imports its*ToolSpecfromspec/impl/*.pyflat modules removed — all imports across the codebase updated to use the newspec/orbase/paths directly.importlinterupdated — new contracts forusethis._tool.impl,usethis._tool.impl.spec, andusethis._tool.impl.basereflecting the clean layered architecture (basestrictly abovespec)New import paths
Original prompt
usethis._tool.impllayer intousethis._tool.impl.specandusethis._tool.impl.baselayers #1356💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.