pyproject.toml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. [project]
  2. requires-python = ">=3.10,<3.13"
  3. [build-system]
  4. requires = ["poetry-core"]
  5. build-backend = "poetry.core.masonry.api"
  6. [tool.ruff]
  7. exclude=[
  8. "migrations/*",
  9. ]
  10. line-length = 120
  11. [tool.ruff.lint]
  12. preview = true
  13. select = [
  14. "B", # flake8-bugbear rules
  15. "C4", # flake8-comprehensions
  16. "E", # pycodestyle E rules
  17. "F", # pyflakes rules
  18. "FURB", # refurb rules
  19. "I", # isort rules
  20. "N", # pep8-naming
  21. "PT", # flake8-pytest-style rules
  22. "PLC0208", # iteration-over-set
  23. "PLC2801", # unnecessary-dunder-call
  24. "PLC0414", # useless-import-alias
  25. "PLR0402", # manual-from-import
  26. "PLR1711", # useless-return
  27. "PLR1714", # repeated-equality-comparison
  28. "RUF013", # implicit-optional
  29. "RUF019", # unnecessary-key-check
  30. "RUF100", # unused-noqa
  31. "RUF101", # redirected-noqa
  32. "S506", # unsafe-yaml-load
  33. "SIM", # flake8-simplify rules
  34. "UP", # pyupgrade rules
  35. "W191", # tab-indentation
  36. "W605", # invalid-escape-sequence
  37. ]
  38. ignore = [
  39. "E402", # module-import-not-at-top-of-file
  40. "E711", # none-comparison
  41. "E712", # true-false-comparison
  42. "E721", # type-comparison
  43. "E722", # bare-except
  44. "E731", # lambda-assignment
  45. "F821", # undefined-name
  46. "F841", # unused-variable
  47. "FURB113", # repeated-append
  48. "FURB152", # math-constant
  49. "UP007", # non-pep604-annotation
  50. "UP032", # f-string
  51. "B005", # strip-with-multi-characters
  52. "B006", # mutable-argument-default
  53. "B007", # unused-loop-control-variable
  54. "B026", # star-arg-unpacking-after-keyword-arg
  55. "B904", # raise-without-from-inside-except
  56. "B905", # zip-without-explicit-strict
  57. "N806", # non-lowercase-variable-in-function
  58. "N815", # mixed-case-variable-in-class-scope
  59. "PT011", # pytest-raises-too-broad
  60. "SIM102", # collapsible-if
  61. "SIM103", # needless-bool
  62. "SIM105", # suppressible-exception
  63. "SIM107", # return-in-try-except-finally
  64. "SIM108", # if-else-block-instead-of-if-exp
  65. "SIM113", # eumerate-for-loop
  66. "SIM117", # multiple-with-statements
  67. "SIM210", # if-expr-with-true-false
  68. "SIM300", # yoda-conditions,
  69. ]
  70. [tool.ruff.lint.per-file-ignores]
  71. "app.py" = [
  72. ]
  73. "__init__.py" = [
  74. "F401", # unused-import
  75. "F811", # redefined-while-unused
  76. ]
  77. "configs/*" = [
  78. "N802", # invalid-function-name
  79. ]
  80. "libs/gmpy2_pkcs10aep_cipher.py" = [
  81. "N803", # invalid-argument-name
  82. ]
  83. "tests/*" = [
  84. "F811", # redefined-while-unused
  85. "F401", # unused-import
  86. "PT001", # missing-function-docstring
  87. "PT004", # missing-parameter-docstring
  88. ]
  89. "core/rag/extractor/word_extractor.py" = [
  90. "RUF100", # Unused `noqa` directive
  91. ]
  92. "core/tools/provider/builtin/gitlab/tools/gitlab_commits.py" = [
  93. "PLR1714", # Consider merging multiple comparisons
  94. ]
  95. [tool.ruff.lint.pyflakes]
  96. extend-generics=[
  97. "_pytest.monkeypatch",
  98. "tests.integration_tests",
  99. ]
  100. [tool.ruff.format]
  101. exclude = [
  102. ]
  103. [tool.poetry]
  104. name = "dify-api"
  105. package-mode = false
  106. ############################################################
  107. # [ Main ] Dependency group
  108. ############################################################
  109. [tool.poetry.dependencies]
  110. anthropic = "~0.23.1"
  111. authlib = "1.3.1"
  112. azure-ai-inference = "~1.0.0b3"
  113. azure-ai-ml = "~1.20.0"
  114. azure-identity = "1.16.1"
  115. beautifulsoup4 = "4.12.2"
  116. boto3 = "1.35.17"
  117. bs4 = "~0.0.1"
  118. cachetools = "~5.3.0"
  119. celery = "~5.3.6"
  120. chardet = "~5.1.0"
  121. cohere = "~5.2.4"
  122. dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
  123. flask = "~3.0.1"
  124. flask-compress = "~1.14"
  125. flask-cors = "~4.0.0"
  126. flask-login = "~0.6.3"
  127. flask-migrate = "~4.0.5"
  128. flask-restful = "~0.3.10"
  129. flask-sqlalchemy = "~3.1.1"
  130. gevent = "~23.9.1"
  131. gmpy2 = "~2.2.1"
  132. google-ai-generativelanguage = "0.6.9"
  133. google-api-core = "2.18.0"
  134. google-api-python-client = "2.90.0"
  135. google-auth = "2.29.0"
  136. google-auth-httplib2 = "0.2.0"
  137. google-cloud-aiplatform = "1.49.0"
  138. google-generativeai = "0.8.1"
  139. googleapis-common-protos = "1.63.0"
  140. gunicorn = "~22.0.0"
  141. httpx = { version = "~0.27.0", extras = ["socks"] }
  142. huggingface-hub = "~0.16.4"
  143. jieba = "0.42.1"
  144. langfuse = "~2.51.3"
  145. langsmith = "~0.1.77"
  146. mailchimp-transactional = "~1.0.50"
  147. markdown = "~3.5.1"
  148. nomic = "~3.1.2"
  149. novita-client = "~0.5.7"
  150. numpy = "~1.26.4"
  151. oci = "~2.135.1"
  152. openai = "~1.51.2"
  153. openpyxl = "~3.1.5"
  154. pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
  155. psycopg2-binary = "~2.9.6"
  156. pycryptodome = "3.19.1"
  157. pydantic = "~2.8.2"
  158. pydantic-settings = "~2.4.0"
  159. pydantic_extra_types = "~2.9.0"
  160. pyjwt = "~2.8.0"
  161. pypdfium2 = "~4.17.0"
  162. python = ">=3.10,<3.13"
  163. python-docx = "~1.1.0"
  164. python-dotenv = "1.0.0"
  165. pyyaml = "~6.0.1"
  166. readabilipy = "0.2.0"
  167. redis = { version = "~5.0.3", extras = ["hiredis"] }
  168. replicate = "~0.22.0"
  169. resend = "~0.7.0"
  170. sagemaker = "2.231.0"
  171. scikit-learn = "~1.5.1"
  172. sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
  173. sqlalchemy = "~2.0.29"
  174. tencentcloud-sdk-python-hunyuan = "~3.0.1158"
  175. tiktoken = "~0.8.0"
  176. tokenizers = "~0.15.0"
  177. transformers = "~4.35.0"
  178. unstructured = { version = "~0.10.27", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
  179. validators = "0.21.0"
  180. volcengine-python-sdk = {extras = ["ark"], version = "~1.0.98"}
  181. websocket-client = "~1.7.0"
  182. werkzeug = "~3.0.1"
  183. xinference-client = "0.15.2"
  184. yarl = "~1.9.4"
  185. zhipuai = "~2.1.5"
  186. # Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
  187. ############################################################
  188. # [ Indirect ] dependency group
  189. # Related transparent dependencies with pinned version
  190. # required by main implementations
  191. ############################################################
  192. [tool.poetry.group.indirect.dependencies]
  193. kaleido = "0.2.1"
  194. rank-bm25 = "~0.2.2"
  195. safetensors = "~0.4.3"
  196. ############################################################
  197. # [ Tools ] dependency group
  198. ############################################################
  199. [tool.poetry.group.tools.dependencies]
  200. arxiv = "2.1.0"
  201. cloudscraper = "1.2.71"
  202. duckduckgo-search = "~6.3.0"
  203. jsonpath-ng = "1.6.1"
  204. matplotlib = "~3.8.2"
  205. newspaper3k = "0.2.8"
  206. nltk = "3.8.1"
  207. numexpr = "~2.9.0"
  208. qrcode = "~7.4.2"
  209. twilio = "~9.0.4"
  210. vanna = { version = "0.7.3", extras = ["postgres", "mysql", "clickhouse", "duckdb"] }
  211. wikipedia = "1.4.0"
  212. yfinance = "~0.2.40"
  213. ############################################################
  214. # [ Storage ] dependency group
  215. # Required for storage clients
  216. ############################################################
  217. [tool.poetry.group.storage.dependencies]
  218. azure-storage-blob = "12.13.0"
  219. bce-python-sdk = "~0.9.23"
  220. cos-python-sdk-v5 = "1.9.30"
  221. esdk-obs-python = "3.24.6.1"
  222. google-cloud-storage = "2.16.0"
  223. oss2 = "2.18.5"
  224. supabase = "~2.8.1"
  225. tos = "~2.7.1"
  226. ############################################################
  227. # [ VDB ] dependency group
  228. # Required by vector store clients
  229. ############################################################
  230. [tool.poetry.group.vdb.dependencies]
  231. alibabacloud_gpdb20160503 = "~3.8.0"
  232. alibabacloud_tea_openapi = "~0.3.9"
  233. chromadb = "0.5.1"
  234. clickhouse-connect = "~0.7.16"
  235. elasticsearch = "8.14.0"
  236. opensearch-py = "2.4.0"
  237. oracledb = "~2.2.1"
  238. pgvecto-rs = { version = "~0.2.1", extras = ['sqlalchemy'] }
  239. pgvector = "0.2.5"
  240. pymilvus = "~2.4.4"
  241. pymochow = "1.3.1"
  242. qdrant-client = "1.7.3"
  243. tcvectordb = "1.3.2"
  244. tidb-vector = "0.0.9"
  245. volcengine-compat = "~1.0.156"
  246. weaviate-client = "~3.21.0"
  247. ############################################################
  248. # [ Dev ] dependency group
  249. # Required for development and running tests
  250. ############################################################
  251. [tool.poetry.group.dev]
  252. optional = true
  253. [tool.poetry.group.dev.dependencies]
  254. coverage = "~7.2.4"
  255. pytest = "~8.3.2"
  256. pytest-benchmark = "~4.0.0"
  257. pytest-env = "~1.1.3"
  258. pytest-mock = "~3.14.0"
  259. ############################################################
  260. # [ Lint ] dependency group
  261. # Required for code style linting
  262. ############################################################
  263. [tool.poetry.group.lint]
  264. optional = true
  265. [tool.poetry.group.lint.dependencies]
  266. dotenv-linter = "~0.5.0"
  267. ruff = "~0.6.9"