-
Notifications
You must be signed in to change notification settings - Fork 32
chore: Replacemypy with pyrefly type checker (do not merge)
#678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Replace mypy dependency with pyrefly ^0.26.0 - Update CI workflow from mypy-check to pyrefly-check - Update type-check Poe task to use pyrefly - Add pyrefly configuration with python_version and project_excludes - Use pyrefly --suppress-errors to auto-add noqa comments for legacy code - Test integration shows 0 errors with 530 ignored violations Co-Authored-By: AJ Steers <[email protected]>
|
Original prompt from AJ Steers: |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1753838067-test-pyrefly-type-checker#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1753838067-test-pyrefly-type-checkerHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
- Fix pyrefly suppression comments displaced by ruff formatting - Move suppression comments to correct lines for type errors - Apply ruff format fixes to maintain code style consistency - Verify pyrefly still works: 0 errors (528 ignored) Co-Authored-By: AJ Steers <[email protected]>
…ment - Move pyrefly suppression comment to correct line after ruff formatting - Verify both ruff format --check and pyrefly type-check pass locally - Final fix for Ruff Format Check CI failure Co-Authored-By: AJ Steers <[email protected]>
mpyp with pyrefly type checker (do not merge)
mpyp with pyrefly type checker (do not merge)mypy with pyrefly type checker (do not merge)
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Run pyrefly init to migrate mypy.ini to pyrefly.toml - Auto-suppress 2 errors in bin/ and docs/ files - Remove redundant [tool.pyrefly] section from pyproject.toml - Remove obsolete mypy.ini file - Pyrefly check now shows 0 errors (526 ignored) Co-Authored-By: AJ Steers <[email protected]>
feat: Replace MyPy with pyrefly type checker (do not merge)
Summary
This PR replaces MyPy with Meta's
pyreflytype checker as a test to evaluate pyrefly as a potential MyPy alternative for the airbyte-python-cdk repository. The integration uses pyrefly's--suppress-errorsauto-noqa feature to automatically add suppression comments for existing type violations, allowing us to focus on evaluating the tool's performance and usability rather than fixing legacy type issues.Key Changes:
mypydependency withpyrefly ^0.26.0mypy-checktopyrefly-checktype-checkPoe task to usepyrefly check airbyte_cdkbin,docs, andunit_testsdirectoriesResults: Local testing shows
0 errors (530 ignored)- pyrefly successfully runs with auto-noqa suppression.Review & Testing Checklist for Human
pyrefly-checkjob completes successfully and doesn't timeout# pyrefly: ignorecomments to ensure they're reasonable and not masking critical type safety issuespoetry run poe type-checklocally to confirm the workflow works for developersDiagram
%%{ init : { "theme" : "default" }}%% graph TD pyproject["pyproject.toml<br/>Dependency & Config"]:::major-edit workflow[".github/workflows/<br/>python_lint.yml<br/>CI Pipeline"]:::major-edit poetry_lock["poetry.lock<br/>Lock File"]:::minor-edit airbyte_cdk["airbyte_cdk/<br/>84 Python Files<br/>with Suppressions"]:::minor-edit pyproject -->|"defines pyrefly ^0.26.0"| poetry_lock pyproject -->|"configures tool.pyrefly"| workflow workflow -->|"runs pyrefly check"| airbyte_cdk pyproject -->|"poe type-check task"| airbyte_cdk subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
--suppress-errorsto focus on tool evaluation rather than fixing existing type issuesThe large number of auto-generated suppressions (530) indicates significant type inconsistencies in the legacy codebase that pyrefly detected. This provides valuable insight into the codebase's type safety status while allowing evaluation of pyrefly's capabilities.