添加uv环境支持:1. 创建pyproject.toml配置文件 2. 更新README.md添加uv环境使用说明

This commit is contained in:
陆程杰 2026-01-08 22:18:11 +08:00
parent 0b3a6a58e6
commit 8c93e47a5b
2 changed files with 59 additions and 0 deletions

View File

@ -82,12 +82,32 @@
python --version 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. 安装依赖 ### 2. 安装依赖
使用pip
```bash ```bash
pip install -r requirements.txt pip install -r requirements.txt
``` ```
使用uv
```bash
uv install
```
### 3. 配置API密钥 ### 3. 配置API密钥
编辑`config.py`文件: 编辑`config.py`文件:
@ -98,10 +118,24 @@ DEEPSEEK_API_KEY = ""
### 4. 启动应用 ### 4. 启动应用
使用Python直接运行
```bash ```bash
python app.py python app.py
``` ```
使用uv运行
```bash
uv run python app.py
```
使用uv的脚本命令需要在pyproject.toml中配置
```bash
uv run start
```
### 5. 访问应用 ### 5. 访问应用
打开浏览器访问http://localhost:5000 打开浏览器访问http://localhost:5000

25
pyproject.toml Normal file
View File

@ -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"