pyproject.toml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. [project]
  2. name = "backend"
  3. version = "1.0.0"
  4. description = "xjz-payment-platform后端工程"
  5. readme = "README.md"
  6. requires-python = ">=3.10"
  7. dependencies = [
  8. "agno==2.5.8",
  9. "aiofiles==24.1.0", # 文件操作
  10. "aiosqlite==0.17.0", # sqlite 异步操作数据库
  11. "alembic==1.15.1", # 数据库迁移
  12. "apscheduler==3.11.0", # 定时任务
  13. "asyncmy==0.2.11", # mysql 异步操作数据库:基于 mysqlclient:asyncmy 是 mysqlclient 的异步版本,mysqlclient 是一个 C 语言编写的 MySQL 客户端,性能较高。性能:asyncmy 通常在性能上优于 aiomysql,特别是在高并发和大数据量的场景下。
  14. "asyncpg==0.30.0", # postgresql 异步操作数据库基于 psycopg2:asyncpg 是 psycopg2 的异步版本,psycopg2 是一个 pure-Python PostgreSQL 数据库适配器。性能:asyncpg 通常在性能上优于 psycopg2,特别是在高并发和大数据量的场景下。
  15. "bcrypt==4.0.1", # 密码加密解析,切勿升级,如果升级,请同时升级python版本
  16. "bleach==6.3.0", # 过滤 HTML 标签
  17. "click==8.1.7", # 命令行参数解析
  18. "croniter>=1.0.12,<5.0.0", # cron(与 prefect 约束一致;部署 requirements.txt 同源)
  19. "cryptography==45.0.2", # mysql8 密码加密
  20. "fastapi==0.115.2", # fastapi 框架
  21. "fastapi-limiter==0.1.6", # 接口限流
  22. "greenlet==3.1.1", # 协程框架
  23. "gunicorn==23.0.0", # 协程框架
  24. "httpx==0.27.2", # HTTP 客户端
  25. "itsdangerous==2.2.0", # 用于安全处理各种数据,如密码、密钥等
  26. "jinja2==3.1.6", # 模板引擎
  27. "loguru==0.7.3", # 日志
  28. "openai==2.28.0",
  29. "openpyxl==3.1.5", # Excel
  30. "pandas==2.2.3", # 数据处理
  31. "passlib==1.7.4", # 密码加密
  32. "prefect>=3.5.0,<4", # 工作流编排(与 typer>=0.19 兼容;部署与 requirements.txt 一致)
  33. "pillow==11.0.0", # 图片处理
  34. "psutil==6.1.0", # 系统信息
  35. "psycopg==3.3.2", # postgresql 同步操作数据库基于 psycopg是psycopg2升级版:psycopg2 是一个 pure-Python PostgreSQL 适配器。
  36. "psycopg-binary==3.3.2", # postgresql 异步操作数据库基于 psycopg2:asyncpg 是 psycopg2 的异步版本,psycopg2 是一个 pure-Python PostgreSQL 数据库适配器。
  37. "pydantic-settings==2.5.2", # 配置设置
  38. "pydantic-validation-decorator==0.1.4", # 模型验证
  39. "pyjwt==2.9.0", # OAuth2
  40. "pymysql==1.1.2", # mysql 同步步操作数据库基于 pymysql:aiomysql 是 pymysql 的异步版本,pymysql 是一个纯 Python 实现的 MySQL 客户端。成熟度:aiomysql 相对较为成熟,社区支持较好,文档也比较完善。
  41. "python-multipart==0.0.9", # request.form() 对表单进行「解析」时安装
  42. "redis==7.1.0", # redis 同/异步操作数据库(用户celery配套使用)redis 异步操作数据库 redis已经完全具备了aioredis的功能,无需重复安全,且aioredis已经不再维护也不兼容3.10+的版本
  43. "rich==13.9.4", # 终端打印美化
  44. "tomli>=2.0.1 ; python_full_version < '3.11'", # 解析 plugin.toml(3.11+ 用标准库 tomllib)
  45. "sqlalchemy==2.0.45", # 数据库ORM
  46. "sqlglot[rs]==27.8.0", # sql 解析
  47. "typer==0.19.0", # 命令行工具
  48. "user-agents==2.2.0", # 获取用户UA
  49. "uvicorn==0.30.6", # uvicorn web 框架
  50. "websockets>=15.0.1,<16.0", # websocket(prefect>=3.5 需 >=15.0.1;与部署 requirements.txt 一致)
  51. "alipay-sdk-python>=3.7.1018", # 支付宝支付SDK
  52. "pyzbar>=0.1.9",
  53. "opencv-python>=4.13.0.92",
  54. "alibabacloud-dysmsapi20180501==1.0.10",
  55. "alibabacloud-dysmsapi20170525==4.5.1",
  56. "aiohttp>=3.13.5",
  57. ]
  58. [dependency-groups]
  59. dev = [
  60. "fakeredis>=2.21.0,<3", # 测试:内存 Redis,配合 TESTING
  61. "pytest==9.0.2",
  62. "ruff==0.14.13", # 代码检查/格式化
  63. ]
  64. [tool.uv]
  65. default-groups = ["dev"] # 本地 uv sync 含 dev;生产 pip -r requirements.txt 不含 pytest/ruff/fakeredis
  66. [[tool.uv.index]]
  67. name = "tuna"
  68. url = "https://pypi.tuna.tsinghua.edu.cn/simple"
  69. [tool.ruff]
  70. line-length = 100
  71. indent-width = 4
  72. preview = true
  73. fix = true
  74. show-fixes = true
  75. exclude = [
  76. ".bzr",
  77. ".direnv",
  78. ".eggs",
  79. ".git",
  80. ".git-rewrite",
  81. ".hg",
  82. ".ipynb_checkpoints",
  83. ".mypy_cache",
  84. ".nox",
  85. ".pants.d",
  86. ".pyenv",
  87. ".pytest_cache",
  88. ".pytype",
  89. ".ruff_cache",
  90. ".svn",
  91. ".tox",
  92. ".venv",
  93. ".vscode",
  94. "__pypackages__",
  95. "_build",
  96. "buck-out",
  97. "build",
  98. "dist",
  99. "node_modules",
  100. "site-packages",
  101. "venv",
  102. ]
  103. extend-include = ["*.pyw"]
  104. [tool.ruff.lint]
  105. select = [
  106. "FAST",
  107. "F",
  108. "E",
  109. "W",
  110. "F",
  111. "I",
  112. "B",
  113. "C4",
  114. "UP",
  115. ]
  116. ignore = [
  117. "E501", # line too long, handled by black
  118. "B008", # do not perform function calls in argument defaults
  119. "C901", # too complex
  120. "W191", # indentation contains tabs
  121. "B904", # Within an `except` clause
  122. "B010", # Do not call with a constant attribute value.
  123. ]
  124. [tool.ruff.lint.per-file-ignores]
  125. "tests/conftest.py" = ["E402"] # 先设置 TESTING/SQLite 环境再 import 应用
  126. [tool.ruff.format]
  127. docstring-code-format = true
  128. preview = true
  129. quote-style = "double"
  130. indent-style = "space"
  131. skip-magic-trailing-comma = false
  132. line-ending = "auto"