Skip to content

Add mypy workflow and config to template#6

Open
joa-adhoc wants to merge 1 commit intomainfrom
t-mypy-workflow
Open

Add mypy workflow and config to template#6
joa-adhoc wants to merge 1 commit intomainfrom
t-mypy-workflow

Conversation

@joa-adhoc
Copy link
Copy Markdown
Contributor

Introduce a [tool.mypy] section in pyproject.toml mirroring the configuration used in ingadhoc-odoo-saas-adhoc, plus no-redef disabled to accommodate the common Odoo pattern of extending a class with the same name. Add a matching mypy.yml workflow that runs mypy . on pushes and pull_request_target against 18.0+ branches.

Introduce a [tool.mypy] section in pyproject.toml mirroring the
configuration used in ingadhoc-odoo-saas-adhoc, plus no-redef disabled
to accommodate the common Odoo pattern of extending a class with the
same name. Add a matching mypy.yml workflow that runs `mypy .` on
pushes and pull_request_target against 18.0+ branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 22, 2026 21:28
Copy link
Copy Markdown

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

Adds baseline mypy configuration and CI workflow to the template so downstream repos can run type-checking similarly to ingadhoc-odoo-saas-adhoc, including allowances for common Odoo patterns (e.g., class redefinition).

Changes:

  • Add a [tool.mypy] section to pyproject.toml with project-default mypy settings.
  • Add a mypy.yml GitHub Actions workflow to run mypy . on pushes and pull_request_target for 18.0+ branches.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/pyproject.toml Introduces mypy configuration in the template’s central tooling config.
src/.github/workflows/mypy.yml Adds a CI workflow to run mypy and post a commit status for PRs.

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

Comment on lines +20 to +26
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
-
Comment on lines +46 to +52
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
-d '{"state":"${{ steps.mypy.outcome }}","context":"mergebot/mypy"}' \
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.

2 participants