[PR #17489] chore: add script for running mypy type checks and speed up mypy checks in CI jobs #28711

Closed
opened 2026-02-21 20:43:58 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/17489

State: closed
Merged: Yes


Summary

  • to close comfyui tool cant read sys.files variable. (#17501)
  • Add a development script dev/run-mypy for running mypy type checks
    • Enable develpers to re-run mypy checks locally
    • As caching enabled by default in mypy, only 3-5s execution time cost
  • Properly cache mypy files for incremental checks to speed up style CI workflow
  • Update the list and versions of stubs libraries types-* as required by mypy
    • added from the mypy output
Installing collected packages: lxml-stubs, types-ujson, types-six, types-simplejson, types-shapely, types-requests, types-regex, types-PyYAML, types-pywin32, types-python-dateutil, types-PyMySQL, types-psycopg2, types-psutil, types-protobuf, types-pexpect, types-openpyxl, types-olefile, types-objgraph, types-oauthlib, types-Markdown, types-html5lib, types-greenlet, types-docutils, types-Deprecated, types-defusedxml, types-colorama, types-cachetools, types-aiofiles, types-tqdm, types-tensorflow, types-requests-oauthlib, types-Pygments, types-gevent, types-beautifulsoup4, types-Flask-Cors, types-Flask-Migrate
Successfully installed lxml-stubs-0.5.1 types-Deprecated-1.2.15.20250304 types-Flask-Cors-5.0.0.20240902 types-Flask-Migrate-4.1.0.20250112 types-Markdown-3.7.0.20250322 types-PyMySQL-1.1.0.20241103 types-PyYAML-6.0.12.20250402 types-Pygments-2.19.0.20250305 types-aiofiles-24.1.0.20250326 types-beautifulsoup4-4.12.0.20250204 types-cachetools-5.5.0.20240820 types-colorama-0.4.15.20240311 types-defusedxml-0.7.0.20240218 types-docutils-0.21.0.20241128 types-gevent-24.11.0.20250401 types-greenlet-3.1.0.20250401 types-html5lib-1.1.11.20241018 types-oauthlib-3.2.0.20250403 types-objgraph-3.6.0.20240907 types-olefile-0.47.0.20240806 types-openpyxl-3.1.5.20250306 types-pexpect-4.9.0.20241208 types-protobuf-5.29.1.20250403 types-psutil-7.0.0.20250401 types-psycopg2-2.9.21.20250318 types-python-dateutil-2.9.0.20241206 types-pywin32-310.0.0.20250319 types-regex-2024.11.6.20250403 types-requests-2.32.0.20250328 types-requests-oauthlib-2.0.0.20250306 types-shapely-2.0.0.20250404 types-simplejson-3.20.0.20250326 types-six-1.17.0.20250403 types-tensorflow-2.18.0.20250404 types-tqdm-4.67.0.20250404 types-ujson-5.10.0.20250326

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • 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
**Original Pull Request:** https://github.com/langgenius/dify/pull/17489 **State:** closed **Merged:** Yes --- # Summary - to close #17501 - Add a development script `dev/run-mypy` for running mypy type checks - Enable develpers to re-run mypy checks locally - As caching enabled by default in mypy, only 3-5s execution time cost - Properly cache mypy files for incremental checks to speed up style CI workflow - Update the list and versions of stubs libraries `types-*` as required by mypy - added from the mypy output ``` Installing collected packages: lxml-stubs, types-ujson, types-six, types-simplejson, types-shapely, types-requests, types-regex, types-PyYAML, types-pywin32, types-python-dateutil, types-PyMySQL, types-psycopg2, types-psutil, types-protobuf, types-pexpect, types-openpyxl, types-olefile, types-objgraph, types-oauthlib, types-Markdown, types-html5lib, types-greenlet, types-docutils, types-Deprecated, types-defusedxml, types-colorama, types-cachetools, types-aiofiles, types-tqdm, types-tensorflow, types-requests-oauthlib, types-Pygments, types-gevent, types-beautifulsoup4, types-Flask-Cors, types-Flask-Migrate Successfully installed lxml-stubs-0.5.1 types-Deprecated-1.2.15.20250304 types-Flask-Cors-5.0.0.20240902 types-Flask-Migrate-4.1.0.20250112 types-Markdown-3.7.0.20250322 types-PyMySQL-1.1.0.20241103 types-PyYAML-6.0.12.20250402 types-Pygments-2.19.0.20250305 types-aiofiles-24.1.0.20250326 types-beautifulsoup4-4.12.0.20250204 types-cachetools-5.5.0.20240820 types-colorama-0.4.15.20240311 types-defusedxml-0.7.0.20240218 types-docutils-0.21.0.20241128 types-gevent-24.11.0.20250401 types-greenlet-3.1.0.20250401 types-html5lib-1.1.11.20241018 types-oauthlib-3.2.0.20250403 types-objgraph-3.6.0.20240907 types-olefile-0.47.0.20240806 types-openpyxl-3.1.5.20250306 types-pexpect-4.9.0.20241208 types-protobuf-5.29.1.20250403 types-psutil-7.0.0.20250401 types-psycopg2-2.9.21.20250318 types-python-dateutil-2.9.0.20241206 types-pywin32-310.0.0.20250319 types-regex-2024.11.6.20250403 types-requests-2.32.0.20250328 types-requests-oauthlib-2.0.0.20250306 types-shapely-2.0.0.20250404 types-simplejson-3.20.0.20250326 types-six-1.17.0.20250403 types-tensorflow-2.18.0.20250404 types-tqdm-4.67.0.20250404 types-ujson-5.10.0.20250326 ``` # Screenshots | Before | After | |--------|-------| | ... | ... | # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:43:58 -05:00
yindo closed this issue 2026-02-21 20:43:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#28711