添加uv环境支持:1. 创建pyproject.toml配置文件 2. 更新README.md添加uv环境使用说明
This commit is contained in:
parent
0b3a6a58e6
commit
8c93e47a5b
34
README.md
34
README.md
@ -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
25
pyproject.toml
Normal 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"
|
||||||
Loading…
Reference in New Issue
Block a user