Skip to content

ci(devtool): Add mypy and pytest to devtool#6770

Draft
danieljanes wants to merge 1 commit intoadd-tooling-to-devtoolfrom
add-mypy-to-devtool
Draft

ci(devtool): Add mypy and pytest to devtool#6770
danieljanes wants to merge 1 commit intoadd-tooling-to-devtoolfrom
add-mypy-to-devtool

Conversation

@danieljanes
Copy link
Collaborator

Merge after #6768

This PR

  • Adds mypy (strict mode)
  • Adds pytest
  • Adds one example test
  • Updates Python scripts under devtool to comply with mypy strict mode

Copilot AI review requested due to automatic review settings March 14, 2026 18:28
@danieljanes danieljanes marked this pull request as draft March 14, 2026 18:28
@github-actions github-actions bot added the Contributor Used to determine what PRs (mainly) come from external contributors. label Mar 14, 2026
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 updates the devtool developer tooling package and its CI wiring by adding new lint dependencies/configuration, introducing dedicated devtool format/test scripts, and adjusting several existing devtool Python utilities and bootstrap scripts.

Changes:

  • Add tomli (Py<3.11 fallback) and pylint to devtool, update related uv.lock files, and configure isort/black/pylint in dev/pyproject.toml.
  • Add dev/test-devtool.sh + dev/format-devtool.sh and a new GitHub Actions workflow to lint devtool on PRs/pushes.
  • Refactor various devtool Python scripts for argument validation and minor style/robustness tweaks (e.g., tomllib fallback, encoding).

Reviewed changes

Copilot reviewed 15 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
framework/uv.lock Propagates updated editable devtool deps (e.g., tomli, pylint) into framework lock metadata.
dev/venv-reset.sh Makes paths robust via SCRIPT_DIR/REPO_ROOT/FRAMEWORK_ROOT and uses absolute script paths.
dev/uv.lock Updates devtool environment lock (resolution markers, adds pylint dependency tree, tomli markers).
dev/test-devtool.sh Adds dedicated devtool lint script (isort/black/pylint).
dev/pyproject.toml Adds tomli + pylint, updates isort/black targets, and configures pylint disables.
dev/format-devtool.sh Adds dedicated devtool formatter script (isort/black).
dev/devtool/init_py_fix.py Updates CLI arg validation and adjusts unused return handling.
dev/devtool/init_py_check.py Updates CLI arg validation.
dev/devtool/fix_copyright.py Updates CLI arg validation and adjusts unused return handling.
dev/devtool/check_pr_title.py Adds tomllib/tomli fallback and minor control-flow/docstring improvements.
dev/devtool/check_copyright.py Simplifies regex definition, updates CLI arg validation and adjusts unused return handling.
dev/devtool/build_example_docs.py Refactors constants/naming, improves formatting, and uses explicit UTF-8 encoding for file IO.
dev/changelog_config.toml Allows devtool as a valid <PR_PROJECT> in PR title checks.
dev/bootstrap.sh Makes paths robust and ensures operations run relative to the framework directory.
dev/bootstrap-uv.sh Makes paths robust and ensures uv sync runs from the framework directory.
dev/README.md Documents the new devtool-only test/format scripts.
datasets/uv.lock Propagates updated editable devtool deps (e.g., tomli, pylint) into datasets lock metadata.
.gitignore Ignores local pylint cache directory .pylint.d/.
.github/workflows/devtool-test.yml Adds CI workflow to lint devtool across Python 3.10–3.13 using uv.
Comments suppressed due to low confidence (1)

dev/devtool/init_py_check.py:125

  • The CLI arg loop iterates over sys.argv (including argv[0], the script/module name). Given the "len(sys.argv) < 2" validation, this should iterate over sys.argv[1:] to avoid treating the module name as a path.
if __name__ == "__main__":
    if len(sys.argv) < 2:
        raise ValueError(
            "Please provide at least one directory path relative "
            "to your current working directory."
        )
    for i, _ in enumerate(sys.argv):
        abs_path: str = os.path.abspath(os.path.join(os.getcwd(), sys.argv[i]))

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@danieljanes danieljanes changed the base branch from main to add-tooling-to-devtool March 14, 2026 19:20
@danieljanes danieljanes changed the title Add mypy to devtool ci(devtool): Add mypy and pytest to devtool Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contributor Used to determine what PRs (mainly) come from external contributors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants