Repository navigation
refactor: simplify send-request plumbing; wire mypy into pre-commit - #19
Merged
Merged
Conversation
mypy was configured strict=true in pyproject.toml and listed as a dev dependency, but nothing actually invoked it — pre-commit had no mypy hook. Add a local repo hook that runs mypy on src/ during pre-commit (and thus in CI's `pre-commit run --all-files` lint job). Enabling it surfaced two pre-existing issues in client.py, both fixed: - customerio's SDK ships no type stubs/py.typed marker, causing import-untyped errors; added a `[[tool.mypy.overrides]]` for `customerio.*` with ignore_missing_imports = true. - _get_regions_class() returned an Any-typed symbol from the untyped customerio import where a type[Regions] was declared; added an explicit cast. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…rough as one _build_email_request drops None values with a dict comprehension instead of eleven if-blocks, and the pass-through fields (preheader, headers, send_to_unsubscribed, tracked, disable_message_retention) travel through _send_inline as a typed **options, so a new field can't be silently dropped in the middle layer. Also covers tracked/disable_message_retention on send_text/send_html for True, False and unset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CDMxuV2fXnLmpJG3tgv2Yu
language: system ran whatever mypy was on PATH, which is nothing outside the Poetry venv, so a plain git commit failed with "Executable mypy not found". poetry run uses the locked mypy and customerio SDK, so local runs match CI. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CDMxuV2fXnLmpJG3tgv2Yu
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.
Follow-up to #17.
abecbf6): this commit was sitting unpushed on a local main; it now goes through review._build_email_request: one dict with theNonevalues filtered out, replacing elevenif x is not Noneblocks.Falseis still forwarded.preheader,headers,send_to_unsubscribed,trackedanddisable_message_retentionpass through_send_inlineas a typed**options: Unpack[_RequestOptions], so mypy still checks the keys and a new field can't be dropped in the middle layer. Public signatures are unchanged.tracked/disable_message_retentiononsend_text/send_htmlfor True, False and unset. Removing the forwarding in_send_inlinemakes 10 tests fail.128 tests pass; mypy and ruff are clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CDMxuV2fXnLmpJG3tgv2Yu