Skip to content

Conversation

bowenliang123
Copy link
Contributor

@bowenliang123 bowenliang123 commented Apr 6, 2025

Summary

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

@bowenliang123 bowenliang123 force-pushed the mypy-script branch 3 times, most recently from 12bebe5 to 076431d Compare April 6, 2025 12:57
@bowenliang123 bowenliang123 changed the title [WIP] chore: add script for running mypy checks and simplify type dependencies chore: add script for running mypy type checks and remove stub type dependencies Apr 6, 2025
@bowenliang123 bowenliang123 marked this pull request as ready for review April 6, 2025 14:23
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. dependencies Pull requests that update a dependency file labels Apr 6, 2025
@bowenliang123
Copy link
Contributor Author

cc @laipz8200

@laipz8200
Copy link
Member

if you remove stubs from the lock file, they will be removed when you run poetry sync.

@bowenliang123
Copy link
Contributor Author

With the latest dev script to rerun the mypy checks, all the required stub dependencies will be automately installed again from pip cache, which takes very little time. It's also worth to pay attention is that currently pinned sub versions in pyproject.toml and the Poetry lockfile are not fully satisfied for mypy checks, and there still requires auto installing in testing runtime.

@bowenliang123
Copy link
Contributor Author

Or shall I leave the stub versions pinned, and only adding the script to run mypy checks? I'll follow your advice.

@bowenliang123
Copy link
Contributor Author

bowenliang123 commented Apr 7, 2025

Hi @laipz8200 , after the offline disscussion with you, I have completed these changes:

  • bring back and update the list and version of stub file dependencies to pyproject.toml and poetry.lock
  • append the execution of dev/run-py scirpt in dev/reformat script

And the time cost of the repeated mypy checks in CI workflow has been shrinked down to 3-5 seconds, with stub files installed and properly cached mypy files.

@bowenliang123 bowenliang123 changed the title chore: add script for running mypy type checks and remove stub type dependencies chore: add script for running mypy type checks and speed up mypy checks in CI jobs Apr 7, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 9, 2025
@laipz8200 laipz8200 merged commit 0b1259f into langgenius:main Apr 9, 2025
8 checks passed
@bowenliang123 bowenliang123 deleted the mypy-script branch April 9, 2025 05:04
Scorpion1221 added a commit to yybht155/dify that referenced this pull request Apr 15, 2025
* commit '2c2efe2e1e46751206dfa5972790cef6ad31a93f': (169 commits)
  chore(*): bump version to 1.2.0 (langgenius#17675)
  feat(graph_engine): yield control to other threads before node run. (langgenius#17689)
  chore: find code with high complexity (langgenius#17679)
  Chore: remove beta tag of app type (langgenius#17676)
  fix: Account.query => db.session.query(Account) (langgenius#17667)
  feat: add plugin daemon oss env config (langgenius#17663)
  chore: add script for running mypy type checks and speed up mypy checks in CI jobs (langgenius#17489)
  optimize: docker-compose.middleware.yaml update env_file dependence (langgenius#17646)
  chore: add `'no-empty-function': 'error'` to `eslint.config.mjs` (langgenius#17656)
  Fix Performance Issues:  (langgenius#17083)
  Accelerate migration (langgenius#17088)
  chore: bump Nodejs in web image from 20 to 22 LTS (langgenius#13341)
  Fixed the model-modal titles not being clearly distinguished between "Add" and "Setup" (langgenius#17634)
  feat: enhance index type handling and add error notification for missing embedding model (langgenius#16836)
  chore: bump pnpm to v10 in web dockerfile (langgenius#17611)
  chore: add unit test to high frequency hooks (langgenius#17617)
  fix(transport): add missing verify parameter to httpx.HTTPTransport (langgenius#17612)
  fix: Sass @import warning (langgenius#17604)
  fix: Extract docx file fails when the file contains an invalid link (langgenius#17576)
  fix: segment keywords bug (langgenius#17599)
  ...

# Conflicts:
#	api/poetry.lock
jsincorporated pushed a commit to jsincorporated/asaAi that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide development script for running Mypy type checks and remove pinned stub dependencies version
2 participants