build: try uv.

This commit is contained in:
liqiang-fit2cloud 2025-08-19 15:50:41 +08:00
parent 354f85ddb6
commit b9fcd68418
2 changed files with 72 additions and 87 deletions

View File

@ -21,10 +21,9 @@ COPY --chmod=700 . /opt/maxkb-app
WORKDIR /opt/maxkb-app WORKDIR /opt/maxkb-app
RUN rm -rf /opt/maxkb-app/ui && \ RUN rm -rf /opt/maxkb-app/ui && \
python3 -m venv /opt/py3 && \ python3 -m venv /opt/py3 && \
pip install poetry==2.0.0 --break-system-packages && \ pip install uv --break-system-packages && \
poetry config virtualenvs.create false && \
. /opt/py3/bin/activate && \ . /opt/py3/bin/activate && \
poetry install && \ uv sync && \
find /opt/maxkb-app -depth \( -name ".git*" -o -name ".docker*" -o -name ".idea*" -o -name ".editorconfig*" -o -name ".prettierrc*" -o -name "README.md" -o -name "poetry.lock" -o -name "pyproject.toml" \) -exec rm -rf {} + && \ find /opt/maxkb-app -depth \( -name ".git*" -o -name ".docker*" -o -name ".idea*" -o -name ".editorconfig*" -o -name ".prettierrc*" -o -name "README.md" -o -name "poetry.lock" -o -name "pyproject.toml" \) -exec rm -rf {} + && \
export MAXKB_CONFIG_TYPE=ENV && python3 /opt/maxkb-app/apps/manage.py compilemessages && \ export MAXKB_CONFIG_TYPE=ENV && python3 /opt/maxkb-app/apps/manage.py compilemessages && \
export PIP_TARGET=/opt/maxkb-app/sandbox/python-packages && \ export PIP_TARGET=/opt/maxkb-app/sandbox/python-packages && \

View File

@ -1,93 +1,79 @@
[tool.poetry] [project]
name = "maxkb" name = "maxkb"
version = "2.0.0" version = "2.0.0"
description = "强大易用的开源企业级智能体平台" description = "强大易用的开源企业级智能体平台"
authors = ["shaohuzhang1 <shaohu.zhang@fit2cloud.com>"] authors = [{ name = "shaohuzhang1", email = "shaohu.zhang@fit2cloud.com" }]
requires-python = "~=3.11.0"
readme = "README.md" readme = "README.md"
package-mode = false dependencies = [
"django==5.2.4",
[tool.poetry.dependencies] "drf-spectacular[sidecar]==0.28.0",
python = "^3.11" "django-redis==6.0.0",
"django-db-connection-pool==1.2.6",
# Web框架 "django-mptt==0.17.0",
django = "5.2.4" "psycopg[binary]==3.2.9",
drf-spectacular = { extras = ["sidecar"], version = "0.28.0" } "python-dotenv==1.1.1",
django-redis = "6.0.0" "uuid-utils==0.11.0",
django-db-connection-pool = "1.2.6" "captcha==0.7.1",
django-mptt = "0.17.0" "pytz==2025.2",
psycopg = { extras = ["binary"], version = "3.2.9" } "psutil==7.0.0",
"cffi==1.17.1",
# 工具库 "beautifulsoup4==4.13.4",
python-dotenv = "1.1.1" "jieba==0.42.1",
uuid-utils = "0.11.0" "langchain-openai==0.3.27",
captcha = "0.7.1" "langchain-anthropic==0.3.17",
pytz = "2025.2" "langchain-community==0.3.27",
psutil = "7.0.0" "langchain-deepseek==0.1.3",
cffi = "1.17.1" "langchain-google-genai==2.1.7",
beautifulsoup4 = "4.13.4" "langchain-mcp-adapters==0.1.9",
jieba = "0.42.1" "langchain-huggingface==0.3.0",
"langchain-ollama==0.3.4",
# LLM及AI相关 "langgraph==0.5.3",
langchain-openai = "0.3.27" "torch=2.8.0",
langchain-anthropic = "0.3.17" "sentence-transformers==5.0.0",
langchain-community = "0.3.27" "qianfan==0.4.12.3",
langchain-deepseek = "0.1.3" "zhipuai==2.1.5.20250708",
langchain-google-genai = "2.1.7" "volcengine-python-sdk[ark]==4.0.5",
langchain-mcp-adapters = "0.1.9" "boto3==1.39.4",
langchain-huggingface = "0.3.0" "tencentcloud-sdk-python==3.0.1420",
langchain-ollama = "0.3.4" "tencentcloud-sdk-python-asr==3.0.1416",
langgraph = "0.5.3" "xinference-client==1.7.1.post1",
torch = [ "anthropic==0.57.1",
{ version = "2.8.0+cpu", markers = "sys_platform == 'linux'", source = "pytorch" }, "dashscope==1.23.8",
{ version = "2.8.0+cpu", markers = "sys_platform == 'win'", source = "pytorch" }, "celery[sqlalchemy]==5.5.3",
{ url = "https://download.pytorch.org/whl/cpu/torch-2.8.0-cp311-none-macosx_11_0_arm64.whl", markers = "sys_platform == 'darwin'" }, "django-celery-beat==2.8.1",
"celery-once==3.0.1",
"django-apscheduler==0.7.0",
"html2text==2025.4.15",
"openpyxl==3.1.5",
"python-docx==1.2.0",
"xlrd==2.0.2",
"xlwt==1.3.0",
"pymupdf==1.26.3",
"pypdf==6.0.0",
"pydub==0.25.1",
"pysilk==0.0.1",
"gunicorn==23.0.0",
"python-daemon==3.1.2",
"websockets==15.0.1",
"pylint==3.3.7",
] ]
sentence-transformers = "5.0.0"
# 云服务SDK [tool.uv]
qianfan = "0.4.12.3" package = false
zhipuai = "2.1.5.20250708"
volcengine-python-sdk = {version = "4.0.5", extras = ["ark"]}
boto3 = "1.39.4"
tencentcloud-sdk-python = "3.0.1420"
tencentcloud-sdk-python-asr = "3.0.1416"
xinference-client = "1.7.1.post1"
anthropic = "0.57.1"
dashscope = "1.23.8"
# 异步任务 [[tool.uv.index]]
celery = { extras = ["sqlalchemy"], version = "5.5.3" }
django-celery-beat = "2.8.1"
celery-once = "3.0.1"
django-apscheduler = "0.7.0"
# 文档处理
html2text = "2025.4.15"
openpyxl = "3.1.5"
python-docx = "1.2.0"
xlrd = "2.0.2"
xlwt = "1.3.0"
pymupdf = "1.26.3"
pypdf = "6.0.0"
# 音频处理
pydub = "0.25.1"
pysilk = "0.0.1"
# 部署工具
gunicorn = "23.0.0"
python-daemon = "3.1.2"
websockets = "15.0.1"
# 开发工具
pylint = "3.3.7"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry.source]]
name = "pytorch" name = "pytorch"
url = "https://download.pytorch.org/whl/cpu" url = "https://download.pytorch.org/whl/cpu"
priority = "explicit" explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch", marker = "sys_platform == 'linux'" },
{ index = "pytorch", marker = "sys_platform == 'win'" },
{ url = "https://download.pytorch.org/whl/cpu/torch-2.8.0-cp311-none-macosx_11_0_arm64.whl", marker = "sys_platform == 'darwin'" },
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"