Skip to content
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

Enable mypy type checks for the Python CDK #31356

Merged
merged 33 commits into from
Oct 16, 2023
Merged

Enable mypy type checks for the Python CDK #31356

merged 33 commits into from
Oct 16, 2023

Conversation

girarda
Copy link
Contributor

@girarda girarda commented Oct 12, 2023

What

  • Run mypy on modified Python CDK files
    • This was removed from the gradle build as part of the gradle cleanup
    • We're intentionally not adding this step to gradle to avoid introducing a dependency on git as it would prevent us from moving the build step to dagger
    • CDK developers can still run mypy locally using bin/run-mypy-on-modified-files.sh

@vercel
Copy link

vercel bot commented Oct 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2023 5:16pm

@github-actions
Copy link
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@girarda girarda changed the title Alex/cdk mypy Enable mypy type checks for the Python CDK Oct 13, 2023
@girarda girarda marked this pull request as ready for review October 13, 2023 22:32
@girarda girarda requested review from a team as code owners October 13, 2023 22:32
@girarda girarda requested review from postamar and removed request for a team October 13, 2023 22:33
@postamar
Copy link
Contributor

@girarda can we instead configure mypyCheck to run using a whitelist or a blacklist? To be clear: I have no issue with using run-mypy-on-modified-files.sh for local development and/or having a gradle task wrap it. I strongly believe that you and your team should modify these tasks to suit your own needs!

What I find problematic is that this script assumes git is present and available, but that's not always the case. In local development it obviously is, but mypyCheck is a dependency of check which may (soon) be run in a dagger container.

@girarda girarda marked this pull request as draft October 14, 2023 00:07
@octavia-squidington-iii octavia-squidington-iii removed area/connectors Connector related issues CDK Connector Development Kit normalization area/octavia-cli labels Oct 14, 2023
@girarda girarda marked this pull request as ready for review October 14, 2023 00:39
@@ -0,0 +1,30 @@
name: Run mymy on modified cdk files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/mymy/mypy :)

Also, there might be a naming convention these days for gha, check with @airbytehq/connector-operations

on:
pull_request:
paths:
- "airbyte-cdk/python/airbyte_cdk/**"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the globber support **/*.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, updated!

- run: pip install mypy==1.6.0
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/changed-files@v23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Oct 16, 2023
@octavia-squidington-iii octavia-squidington-iii removed the CDK Connector Development Kit label Oct 16, 2023
@girarda girarda merged commit 5724ef0 into master Oct 16, 2023
16 checks passed
@girarda girarda deleted the alex/cdk_mypy branch October 16, 2023 18:45
ariesgun pushed a commit to ariesgun/airbyte that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants