pyproject.toml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. "TRY400", # error-instead-of-exception
  35. "TRY401", # verbose-log-message
  36. "UP", # pyupgrade rules
  37. "W191", # tab-indentation
  38. "W605", # invalid-escape-sequence
  39. ]
  40. ignore = [
  41. "E402", # module-import-not-at-top-of-file
  42. "E711", # none-comparison
  43. "E712", # true-false-comparison
  44. "E721", # type-comparison
  45. "E722", # bare-except
  46. "E731", # lambda-assignment
  47. "F821", # undefined-name
  48. "F841", # unused-variable
  49. "FURB113", # repeated-append
  50. "FURB152", # math-constant
  51. "UP007", # non-pep604-annotation
  52. "UP032", # f-string
  53. "B005", # strip-with-multi-characters
  54. "B006", # mutable-argument-default
  55. "B007", # unused-loop-control-variable
  56. "B026", # star-arg-unpacking-after-keyword-arg
  57. "B904", # raise-without-from-inside-except
  58. "B905", # zip-without-explicit-strict
  59. "N806", # non-lowercase-variable-in-function
  60. "N815", # mixed-case-variable-in-class-scope
  61. "PT011", # pytest-raises-too-broad
  62. "SIM102", # collapsible-if
  63. "SIM103", # needless-bool
  64. "SIM105", # suppressible-exception
  65. "SIM107", # return-in-try-except-finally
  66. "SIM108", # if-else-block-instead-of-if-exp
  67. "SIM113", # eumerate-for-loop
  68. "SIM117", # multiple-with-statements
  69. "SIM210", # if-expr-with-true-false
  70. "SIM300", # yoda-conditions,
  71. ]
  72. [tool.ruff.lint.per-file-ignores]
  73. "app.py" = [
  74. ]
  75. "__init__.py" = [
  76. "F401", # unused-import
  77. "F811", # redefined-while-unused
  78. ]
  79. "configs/*" = [
  80. "N802", # invalid-function-name
  81. ]
  82. "libs/gmpy2_pkcs10aep_cipher.py" = [
  83. "N803", # invalid-argument-name
  84. ]
  85. "tests/*" = [
  86. "F811", # redefined-while-unused
  87. "F401", # unused-import
  88. ]
  89. [tool.ruff.lint.pyflakes]
  90. extend-generics=[
  91. "_pytest.monkeypatch",
  92. "tests.integration_tests",
  93. ]
  94. [tool.ruff.format]
  95. exclude = [
  96. ]
  97. [tool.poetry]
  98. name = "dify-api"
  99. package-mode = false
  100. ############################################################
  101. # [ Main ] Dependency group
  102. ############################################################
  103. [tool.poetry.dependencies]
  104. anthropic = "~0.23.1"
  105. authlib = "1.3.1"
  106. azure-ai-inference = "~1.0.0b3"
  107. azure-ai-ml = "~1.20.0"
  108. azure-identity = "1.16.1"
  109. beautifulsoup4 = "4.12.2"
  110. boto3 = "1.35.17"
  111. bs4 = "~0.0.1"
  112. cachetools = "~5.3.0"
  113. celery = "~5.4.0"
  114. chardet = "~5.1.0"
  115. cohere = "~5.2.4"
  116. dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
  117. fal-client = "0.5.6"
  118. flask = "~3.0.1"
  119. flask-compress = "~1.14"
  120. flask-cors = "~4.0.0"
  121. flask-login = "~0.6.3"
  122. flask-migrate = "~4.0.5"
  123. flask-restful = "~0.3.10"
  124. flask-sqlalchemy = "~3.1.1"
  125. gevent = "~23.9.1"
  126. gmpy2 = "~2.2.1"
  127. google-ai-generativelanguage = "0.6.9"
  128. google-api-core = "2.18.0"
  129. google-api-python-client = "2.90.0"
  130. google-auth = "2.29.0"
  131. google-auth-httplib2 = "0.2.0"
  132. google-cloud-aiplatform = "1.49.0"
  133. google-generativeai = "0.8.1"
  134. googleapis-common-protos = "1.63.0"
  135. gunicorn = "~22.0.0"
  136. httpx = { version = "~0.27.0", extras = ["socks"] }
  137. huggingface-hub = "~0.16.4"
  138. jieba = "0.42.1"
  139. langfuse = "~2.51.3"
  140. langsmith = "~0.1.77"
  141. mailchimp-transactional = "~1.0.50"
  142. markdown = "~3.5.1"
  143. nomic = "~3.1.2"
  144. novita-client = "~0.5.7"
  145. numpy = "~1.26.4"
  146. oci = "~2.135.1"
  147. openai = "~1.52.0"
  148. openpyxl = "~3.1.5"
  149. pandas = { version = "~2.2.2", extras = ["performance", "excel"] }
  150. psycopg2-binary = "~2.9.6"
  151. pycryptodome = "3.19.1"
  152. pydantic = "~2.9.2"
  153. pydantic-settings = "~2.6.0"
  154. pydantic_extra_types = "~2.9.0"
  155. pyjwt = "~2.8.0"
  156. pypdfium2 = "~4.17.0"
  157. python = ">=3.10,<3.13"
  158. python-docx = "~1.1.0"
  159. python-dotenv = "1.0.0"
  160. pyyaml = "~6.0.1"
  161. readabilipy = "0.2.0"
  162. redis = { version = "~5.0.3", extras = ["hiredis"] }
  163. replicate = "~0.22.0"
  164. resend = "~0.7.0"
  165. sagemaker = "~2.231.0"
  166. scikit-learn = "~1.5.1"
  167. sentry-sdk = { version = "~1.44.1", extras = ["flask"] }
  168. sqlalchemy = "~2.0.29"
  169. starlette = "0.41.0"
  170. tencentcloud-sdk-python-hunyuan = "~3.0.1158"
  171. tiktoken = "~0.8.0"
  172. tokenizers = "~0.15.0"
  173. transformers = "~4.35.0"
  174. unstructured = { version = "~0.16.1", extras = ["docx", "epub", "md", "msg", "ppt", "pptx"] }
  175. validators = "0.21.0"
  176. volcengine-python-sdk = {extras = ["ark"], version = "~1.0.98"}
  177. websocket-client = "~1.7.0"
  178. werkzeug = "~3.0.1"
  179. xinference-client = "0.15.2"
  180. yarl = "~1.9.4"
  181. youtube-transcript-api = "~0.6.2"
  182. zhipuai = "~2.1.5"
  183. # Before adding new dependency, consider place it in alphabet order (a-z) and suitable group.
  184. ############################################################
  185. # [ Indirect ] dependency group
  186. # Related transparent dependencies with pinned version
  187. # required by main implementations
  188. ############################################################
  189. [tool.poetry.group.indirect.dependencies]
  190. kaleido = "0.2.1"
  191. rank-bm25 = "~0.2.2"
  192. safetensors = "~0.4.3"
  193. ############################################################
  194. # [ Tools ] dependency group
  195. ############################################################
  196. [tool.poetry.group.tools.dependencies]
  197. arxiv = "2.1.0"
  198. cloudscraper = "1.2.71"
  199. duckduckgo-search = "~6.3.0"
  200. jsonpath-ng = "1.6.1"
  201. matplotlib = "~3.8.2"
  202. mplfonts = "~0.0.8"
  203. newspaper3k = "0.2.8"
  204. nltk = "3.9.1"
  205. numexpr = "~2.9.0"
  206. pydub = "~0.25.1"
  207. qrcode = "~7.4.2"
  208. twilio = "~9.0.4"
  209. vanna = { version = "0.7.5", extras = ["postgres", "mysql", "clickhouse", "duckdb", "oracle"] }
  210. wikipedia = "1.4.0"
  211. yfinance = "~0.2.40"
  212. ############################################################
  213. # [ Storage ] dependency group
  214. # Required for storage clients
  215. ############################################################
  216. [tool.poetry.group.storage.dependencies]
  217. azure-storage-blob = "12.13.0"
  218. bce-python-sdk = "~0.9.23"
  219. cos-python-sdk-v5 = "1.9.30"
  220. esdk-obs-python = "3.24.6.1"
  221. google-cloud-storage = "2.16.0"
  222. oss2 = "2.18.5"
  223. supabase = "~2.8.1"
  224. tos = "~2.7.1"
  225. ############################################################
  226. # [ VDB ] dependency group
  227. # Required by vector store clients
  228. ############################################################
  229. [tool.poetry.group.vdb.dependencies]
  230. alibabacloud_gpdb20160503 = "~3.8.0"
  231. alibabacloud_tea_openapi = "~0.3.9"
  232. chromadb = "0.5.1"
  233. clickhouse-connect = "~0.7.16"
  234. couchbase = "~4.3.0"
  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. pyobvector = "~0.1.6"
  243. qdrant-client = "1.7.3"
  244. tcvectordb = "1.3.2"
  245. tidb-vector = "0.0.9"
  246. upstash-vector = "0.6.0"
  247. volcengine-compat = "~1.0.156"
  248. weaviate-client = "~3.21.0"
  249. ############################################################
  250. # [ Dev ] dependency group
  251. # Required for development and running tests
  252. ############################################################
  253. [tool.poetry.group.dev]
  254. optional = true
  255. [tool.poetry.group.dev.dependencies]
  256. coverage = "~7.2.4"
  257. pytest = "~8.3.2"
  258. pytest-benchmark = "~4.0.0"
  259. pytest-env = "~1.1.3"
  260. pytest-mock = "~3.14.0"
  261. ############################################################
  262. # [ Lint ] dependency group
  263. # Required for code style linting
  264. ############################################################
  265. [tool.poetry.group.lint]
  266. optional = true
  267. [tool.poetry.group.lint.dependencies]
  268. dotenv-linter = "~0.5.0"
  269. ruff = "~0.7.3"