You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current typecheck job in GitHub Actions is useful, but it does not fully cover the Python code we ship and support.
Today the workflow runs:
tox -e typecheck
and the typecheck tox env runs:
mypy emails/
This means the job only checks the main emails package, with several important gaps:
Optional integrations are effectively not type-checked.
emails.template.* is fully ignored in mypy config.
emails.django is fully ignored in mypy config.
Global ignore_missing_imports = true also weakens checks around external dependencies such as cssutils, lxml, premailer, requests, etc.
Shipped non-package Python code is not covered.
scripts/make_rfc822.py is included in distribution but not checked by the CI typecheck job.
setup.py is also outside the current mypy target.
Tests and vendored code are excluded completely.
Excluding vendored DKIM code is reasonable.
Excluding tests may also be intentional, but it means typecheck currently validates only a subset of the repository's Python code.
As a result, the current job verifies the core package only, but does not give confidence for optional public integrations or shipped scripts.
Suggested improvements
Extend the mypy target to include at least:
emails/
scripts/make_rfc822.py
Replace global ignore_missing_imports = true with narrower per-module exceptions where needed.
Add a separate typecheck environment for optional integrations, with the relevant dependencies installed, instead of using ignore_errors = true for:
emails.template.*
emails.django
Keep vendored code excluded if desired, but make that an explicit documented decision.
Expected outcome
After this change, the typecheck job will better reflect the actual supported surface of the project and catch regressions in optional integrations and shipped scripts earlier.
If useful, I can also prepare a follow-up PR with concrete tox.ini, setup.cfg, and workflow changes.
Activity