From 8c93e47a5bc43a7678348c64c7e79bd2b68bf04a Mon Sep 17 00:00:00 2001 From: st2411020124 Date: Thu, 8 Jan 2026 22:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0uv=E7=8E=AF=E5=A2=83=E6=94=AF?= =?UTF-8?q?=E6=8C=81=EF=BC=9A1.=20=E5=88=9B=E5=BB=BApyproject.toml?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=202.=20=E6=9B=B4=E6=96=B0R?= =?UTF-8?q?EADME.md=E6=B7=BB=E5=8A=A0uv=E7=8E=AF=E5=A2=83=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 ++++++++++++++++++++++++++++++++++ pyproject.toml | 25 +++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 4edc843..c03c1ff 100644 --- a/README.md +++ b/README.md @@ -82,12 +82,32 @@ python --version ``` +#### 使用uv环境(推荐) + +安装uv: + +```bash +# Windows +powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + +# macOS/Linux +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + ### 2. 安装依赖 +使用pip: + ```bash pip install -r requirements.txt ``` +使用uv: + +```bash +uv install +``` + ### 3. 配置API密钥 编辑`config.py`文件: @@ -98,10 +118,24 @@ DEEPSEEK_API_KEY = "" ### 4. 启动应用 +使用Python直接运行: + ```bash python app.py ``` +使用uv运行: + +```bash +uv run python app.py +``` + +使用uv的脚本命令(需要在pyproject.toml中配置): + +```bash +uv run start +``` + ### 5. 访问应用 打开浏览器访问:http://localhost:5000 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ddf631d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[project] +name = "interview-system" +version = "0.1.0" +description = "AI面试官系统" +authors = [ + { name = "Your Name", email = "your.email@example.com" }, +] +requires-python = ">=3.8" +dependencies = [ + "flask>=2.3.0", + "requests>=2.31.0", + "python-dotenv>=1.0.0", + "gunicorn>=21.0.0", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project.scripts] +start = "app:app" +serve = "gunicorn:run" + +[tool.uv] +python-version = "3.8"