Skip to content

feat(python): add mypy_exclude config option#11505

Merged
fern-support merged 11 commits intomainfrom
devin/1768249168-fix-python-sdk-mypy-exclude
Jan 22, 2026
Merged

feat(python): add mypy_exclude config option#11505
fern-support merged 11 commits intomainfrom
devin/1768249168-fix-python-sdk-mypy-exclude

Conversation

@jsklan
Copy link
Copy Markdown
Contributor

@jsklan jsklan commented Jan 12, 2026

Description

Refs: Customer request for Square API SDK generation

Adds a new mypy_exclude custom config option to the Python SDK generator.

Link to Devin run: https://app.devin.ai/sessions/30e24064a098405eb1a1a2949e4a95c0
Requested by: @jsklan

Changes Made

  • Add mypy_exclude custom config option that generates exclude = [...] in the [tool.mypy] section of pyproject.toml
  • This is useful when .fernignore preserves directories (like legacy/ or tests/integration/) that contain code incompatible with the generated SDK
  • Add python-mypy-exclude test fixture with two variants demonstrating the feature
  • Bump version to 4.49.0 (minor version bump required for feat change type)

Example usage in generators.yml:

config:
  mypy_exclude:
    - "legacy/"
    - "tests/integration/"

Generated output in pyproject.toml:

[tool.mypy]
plugins = ["pydantic.mypy"]
exclude = ["legacy/", "tests/integration/"]

Testing

  • Added python-mypy-exclude fixture with no-custom-config and with-mypy-exclude variants
  • Seed tests pass for both variants
  • Pre-commit hooks pass

Human Review Checklist

  • Verify the exclude patterns are correctly formatted in the generated pyproject.toml
  • Confirm the config flows correctly through abstract_generator.py → project.py → pyproject_toml.py

devin-ai-integration bot and others added 3 commits January 12, 2026 20:22
Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
…uence

- Add mypy_exclude custom config option to exclude directories from mypy type checking
- Fix SyntaxWarning for invalid escape sequence in generator's own docstring (Python 3.12+)
- Pass mypy_exclude through abstract_generator -> Project -> PyProjectToml -> PluginConfigurationBlock

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
- Add with-mypy-exclude variant output showing mypy exclude configuration
- pyproject.toml now includes exclude = ["legacy/", "tests/integration/"] in [tool.mypy]

Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot changed the title fix(python-sdk): add mypy_exclude config and fix docstring escape sequence fix(python): add mypy_exclude config and fix docstring escape sequence Jan 12, 2026
devin-ai-integration bot and others added 3 commits January 12, 2026 22:18
Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
# Conflicts:
#	generators/python/sdk/versions.yml
#	seed/python-sdk/seed.yml
Co-Authored-By: judah@buildwithfern.com <jsklan.development@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title fix(python): add mypy_exclude config and fix docstring escape sequence feat(python): add mypy_exclude config option Jan 20, 2026
@fern-support fern-support merged commit 198c771 into main Jan 22, 2026
262 checks passed
@fern-support fern-support deleted the devin/1768249168-fix-python-sdk-mypy-exclude branch January 22, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants