pyproject.toml 7.7 KB

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