Skip to content

Implement usethis tool mkdocs#823

Merged
nathanjmcdougall merged 18 commits intomainfrom
188-implement-usethis-tool-mkdocs
Jul 15, 2025
Merged

Implement usethis tool mkdocs#823
nathanjmcdougall merged 18 commits intomainfrom
188-implement-usethis-tool-mkdocs

Conversation

@nathanjmcdougall
Copy link
Collaborator

No description provided.

@nathanjmcdougall nathanjmcdougall linked an issue Jun 28, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 13, 2025

CodSpeed Instrumentation Performance Report

Merging #823 will degrade performances by 8.07%

Comparing 188-implement-usethis-tool-mkdocs (08620ef) with main (c694f81)

Summary

❌ 1 (👁 1) regressions
✅ 1 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
👁 test_help_flag 35.9 ms 39.1 ms -8.07%

@nathanjmcdougall
Copy link
Collaborator Author

Next steps:

  1. Raise test coverage
  2. Implement and test the --remove method

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review July 15, 2025 10:20
@nathanjmcdougall nathanjmcdougall requested a review from Copilot July 15, 2025 10:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for a new mkdocs tool in usethis, including core logic, CLI integration, dependency management, configuration handling, and tests.

  • Introduce MkDocsTool with usage printing, dependency and config spec
  • Implement add_docs_dir integration and register file manager
  • Wire up use_mkdocs in core logic and add CLI command

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/usethis/_tool/impl/test_mkdocs.py Unit tests for MkDocsTool usage printing
tests/usethis/_integrations/mkdocs/test_core.py Integration tests for add_docs_dir behavior
tests/usethis/_core/test_list.py Include MkDocs in tool listing tests
tests/usethis/_core/test_core_tool.py Add use_mkdocs add/remove/how tests in core tool
src/usethis/_tool/impl/pyproject_toml.py Register MkDocsTool among other tools
src/usethis/_tool/impl/mkdocs.py Implement MkDocsTool: usage, deps, config spec, file management
src/usethis/_tool/base.py Add get_doc_deps, add_doc_deps, remove_doc_deps to base tool
src/usethis/tool/all.py Include MkDocsTool in ALL_TOOLS list
src/usethis/_interface/tool.py Add mkdocs CLI command and register in runner
src/usethis/_integrations/mkdocs/core.py Create add_docs_dir helper for docs directory
src/usethis/_core/tool.py Add use_mkdocs orchestration to core tool logic
src/usethis/_config_file.py Add MkDocsYMLManager and include it in files_manager
pyproject.toml Update tool layering to include mkdocs
Comments suppressed due to low confidence (4)

src/usethis/_tool/base.py:199

  • [nitpick] Consider adding a docstring for add_doc_deps to explain its behavior and purpose, for consistency with other Tool base methods.
    def add_doc_deps(self) -> None:

src/usethis/_tool/base.py:202

  • [nitpick] Consider adding a docstring for remove_doc_deps to describe what dependencies are removed and under what conditions.
    def remove_doc_deps(self) -> None:

src/usethis/_tool/impl/mkdocs.py:33

  • Add a unit test for the unconditional=True branch of get_doc_deps, verifying it returns both 'mkdocs' and 'mkdocs-material'.
    def get_doc_deps(self, *, unconditional: bool = False) -> list[Dependency]:

src/usethis/_core/tool.py:169

  • The call to ensure_pyproject_toml() will fail because only ensure_pyproject_validity is imported. Either import ensure_pyproject_toml or change this call to ensure_pyproject_validity().
        ensure_pyproject_toml()

@nathanjmcdougall nathanjmcdougall merged commit 4731365 into main Jul 15, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 188-implement-usethis-tool-mkdocs branch July 15, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement usethis tool mkdocs

2 participants