Skip to content

ci: compare three type checker#25502

Draft
asukaminato0721 wants to merge 56 commits intolanggenius:mainfrom
asukaminato0721:try-zmypy
Draft

ci: compare three type checker#25502
asukaminato0721 wants to merge 56 commits intolanggenius:mainfrom
asukaminato0721:try-zmypy

Conversation

@asukaminato0721
Copy link
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

fix #25187

Summary

just to test the result.

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@asukaminato0721 asukaminato0721 marked this pull request as ready for review September 10, 2025 15:31
Copilot AI review requested due to automatic review settings September 10, 2025 15:31
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 10, 2025
@asukaminato0721 asukaminato0721 marked this pull request as draft September 10, 2025 15:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the GitHub Actions workflow to use zmypy instead of mypy for Python type checking. The change involves installing the zuban package and replacing the mypy command with zmypy while maintaining all the same command-line arguments and type checking configuration.

  • Replaces the mypy type checking command with zmypy in the CI pipeline
  • Adds installation of the zuban package as a dependency for zmypy

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@asukaminato0721
Copy link
Contributor Author

well

thread 'main' has overflowed its stack
fatal runtime error: stack overflow, aborting

zubanls/zuban#54

@asukaminato0721 asukaminato0721 force-pushed the try-zmypy branch 4 times, most recently from 88646a4 to f9153d5 Compare October 5, 2025 07:40
@asukaminato0721
Copy link
Contributor Author

Prepared 1 package in 1.10s
Installed 1 package in 100ms
 + zuban==0.1.0

thread 'main' panicked at crates/zuban_python/src/type_/operations.rs:1310:43:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@asukaminato0721 asukaminato0721 changed the title ci: Update Mypy command to use zmypy ci: compare three type checker Jan 29, 2026
@asukaminato0721
Copy link
Contributor Author

This project be a profiler

facebook/pyrefly@93fd467

facebook/pyrefly@9cb0525

Copilot AI review requested due to automatic review settings February 5, 2026 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if: steps.changed-files.outputs.any_changed == 'true'
run: dev/basedpyright-check


Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The PR removes the call to make type-check which includes mypy (as shown in Makefile:71-74), but mypy is not being run in the new workflow steps. This means mypy type checking is no longer being executed in CI. If the goal is to compare type checkers while still running the existing checks, consider keeping mypy or explicitly documenting why it was removed. The Makefile's type-check target runs: basedpyright, mypy, and ty.

Suggested change
- name: Run mypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
run: uv run --directory api mypy .

Copilot uses AI. Check for mistakes.
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true

- name: Run zmypy Type Checks
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The step name says "Run zmypy Type Checks" but the command uses the package "zuban". These should be consistent. Based on the issue reference (https://zubanls.com/), the correct package name is "zuban", so the step name should be updated to "Run zuban Type Checks" for clarity and consistency.

Suggested change
- name: Run zmypy Type Checks
- name: Run zuban Type Checks

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +66
run: uv --directory api add ty && uv --directory api run ty check || true

- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true

- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add zuban && uv --directory api run zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped .
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Using uv --directory api add will modify the project's dependencies by adding these packages to pyproject.toml and uv.lock. For testing purposes, consider using uv --directory api run --with ty ty check instead, which installs the package temporarily without modifying the project files. This is more appropriate for experimental CI checks that shouldn't affect the project's dependency declarations.

Suggested change
run: uv --directory api add ty && uv --directory api run ty check || true
- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true
- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add zuban && uv --directory api run zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped .
run: uv --directory api run --with ty ty check || true
- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api run --with pyrefly pyrefly check || true
- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api run --with zuban zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped .

Copilot uses AI. Check for mistakes.
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Using uv --directory api add will modify the project's dependencies by adding these packages to pyproject.toml and uv.lock. For testing purposes, consider using uv --directory api run --with pyrefly pyrefly check instead, which installs the package temporarily without modifying the project files. This is more appropriate for experimental CI checks that shouldn't affect the project's dependency declarations.

Suggested change
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true
run: uv --directory api run --with pyrefly pyrefly check || true

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +66
run: uv --directory api add ty && uv --directory api run ty check || true

- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true

- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add zuban && uv --directory api run zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped .
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Using uv --directory api add will modify the project's dependencies by adding these packages to pyproject.toml and uv.lock. For testing purposes, consider using uv --directory api run --with zuban zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped . instead, which installs the package temporarily without modifying the project files. This is more appropriate for experimental CI checks that shouldn't affect the project's dependency declarations.

Suggested change
run: uv --directory api add ty && uv --directory api run ty check || true
- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true
- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api add zuban && uv --directory api run zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped .
run: uv --directory api run --with ty ty check || true
- name: Run pyrefly Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api run --with pyrefly pyrefly check || true
- name: Run zmypy Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
env:
RUST_BACKTRACE: 1
run: uv --directory api run --with zuban zuban check --exclude '.venv/' --exclude 'tests/' --exclude 'migrations/' --check-untyped-defs --disable-error-code=import-untyped . || true

Copilot uses AI. Check for mistakes.
env:
RUST_BACKTRACE: 1
run: uv --directory api add pyrefly && uv --directory api run pyrefly check || true

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

This line contains trailing whitespace which should be removed for consistency with the project's style standards.

Copilot uses AI. Check for mistakes.
if: steps.changed-files.outputs.any_changed == 'true'
run: dev/basedpyright-check


Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

This line contains trailing whitespace which should be removed for consistency with the project's style standards.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore/Refactor] try zmypy

1 participant