Skip to content

Run non-provider mypy as regular prek static checks instead of separate CI jobs#64780

Merged
potiuk merged 1 commit intoapache:mainfrom
potiuk:run-mypy-locally-for-non-providers
Apr 6, 2026
Merged

Run non-provider mypy as regular prek static checks instead of separate CI jobs#64780
potiuk merged 1 commit intoapache:mainfrom
potiuk:run-mypy-locally-for-non-providers

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 6, 2026

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts, devel-common) now run
locally via uv as regular prek hooks in the pre-commit stage. They run as part of the regular
static checks job in CI and automatically on every local commit — no separate mypy CI jobs needed.

The folder-level mypy checks (which check entire directories at once for comprehensive cross-file
type checking) replace the previous file-level incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded directly in the main
CI workflow (ci-amd-arm.yml) instead of being dispatched through the ci-image-checks reusable
workflow. The mypy-checks selective check output is replaced by a simpler run-mypy-providers
boolean.

Changes:

  • Promoted folder-level mypy prek hooks from manual to pre-commit stage for non-provider projects
  • Removed file-level incremental mypy hooks and mypy_local.py (superseded by folder-level checks)
  • Moved provider mypy job from ci-image-checks.yml into ci-amd-arm.yml directly
  • Removed mypy-checks / run-mypy inputs from ci-image-checks.yml
  • Replaced mypy_checks list and run_mypy with single run_mypy_providers boolean in selective checks
  • Added non-provider mypy skip logic in skip_prek_hooks (skips when relevant files unchanged)
  • Updated contributing-docs/08_static_code_checks.rst
  • Fixed pre-existing mypy errors surfaced by running locally on macOS:
    • type: ignore[no-redef] on tomllib compat imports (12 files)
    • type: ignore[attr-defined] for Linux-only os.posix_fadvise

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Claude Opus 4.6)

Generated-by: Claude Code (Claude Opus 4.6) following the guidelines

Comment thread contributing-docs/08_static_code_checks.rst Outdated
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Cool!

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 6, 2026

Actually - we can remove a lot more code now - let me update the PR shortly

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 6, 2026

We will also get rid of most of the mypy ambiguity this way.

@potiuk potiuk changed the title Run mypy locally via uv for non-provider projects Run non-provider mypy as regular prek static checks instead of separate CI jobs Apr 6, 2026
@potiuk potiuk force-pushed the run-mypy-locally-for-non-providers branch 3 times, most recently from dfc4ce7 to a73c93a Compare April 6, 2026 18:35
… separate CI jobs

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
@potiuk potiuk force-pushed the run-mypy-locally-for-non-providers branch from a73c93a to 01a0962 Compare April 6, 2026 18:44
@potiuk potiuk merged commit 0ce1dd7 into apache:main Apr 6, 2026
143 checks passed
@potiuk potiuk deleted the run-mypy-locally-for-non-providers branch April 6, 2026 20:10
@github-project-automation github-project-automation bot moved this from Backlog to Done in Airflow Registry Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Backport failed to create: v3-2-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 0ce1dd7 v3-2-test

This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

potiuk added a commit to potiuk/airflow that referenced this pull request Apr 6, 2026
…s instead of separate CI jobs (apache#64780)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
(cherry picked from commit 0ce1dd7)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
potiuk added a commit that referenced this pull request Apr 6, 2026
…s instead of separate CI jobs (#64780) (#64810)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
(cherry picked from commit 0ce1dd7)
shivaam pushed a commit to shivaam/airflow that referenced this pull request Apr 8, 2026
… separate CI jobs (apache#64780)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
vatsrahul1001 pushed a commit that referenced this pull request Apr 8, 2026
…s instead of separate CI jobs (#64780) (#64810)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
(cherry picked from commit 0ce1dd7)
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…s instead of separate CI jobs (#64780) (#64810)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
(cherry picked from commit 0ce1dd7)
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…s instead of separate CI jobs (#64780) (#64810)

Non-provider mypy checks (airflow-core, task-sdk, airflow-ctl, dev, scripts,
devel-common) now run locally via uv as regular prek hooks in the pre-commit
stage, instead of running as separate mypy CI jobs in the CI image checks
workflow. This means they run as part of the regular static checks job in CI
and automatically on every local commit.

The folder-level mypy checks (which check entire directories at once for
comprehensive cross-file type checking) replace the previous file-level
incremental checks.

Provider mypy checks still run via breeze as a dedicated CI job, now embedded
directly in the main CI workflow (ci-amd-arm.yml) instead of being dispatched
through the ci-image-checks reusable workflow.

The selective checks logic skips non-provider mypy hooks when their relevant
files haven't changed, unless devel-common/pyproject.toml changes on main
(which affects all mypy configurations).
(cherry picked from commit 0ce1dd7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants