Commit cf19082a by baiquan

使用uv进行包管理

parent 0663eb1f
......@@ -6,12 +6,20 @@
## 安装依赖
在运行项目之前,请确保已经安装了 Python、Redis 和 必要的依赖库。可以使用以下命令安装所需的依赖:
### 使用该命令创建虚拟环境
```bash
pip install -r requirements.txt
uv venv
```
### 使用该命令安装依赖
```bash
uv pip install .
```
## 启动命令
### 激活虚拟环境
```bash
.venv\Scripts\activate
```
### 启动Celery Worker
```bash
celery -A celery_app worker -l info -P gevent
......@@ -19,7 +27,7 @@ celery -A celery_app worker -l info -P gevent
### 启动API服务
```bash
uvicorn api:app --host 0.0.0.0 --port 9001 --reload
uvicorn api:app --host 0.0.0.0 --port 9001 --reload
```
[build-system]
requires = ["setuptools>=64.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "doudian-py"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
[[tool.uv.index]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true
dependencies = [
"requests~=2.32.3",
"PyExecJS~=1.5.1",
"loguru~=0.7.3",
"celery~=5.5.0",
"fastapi~=0.115.11",
"pydantic~=2.10.6",
"curl_cffi~=0.10.0",
"DrissionPage~=4.1.0.18",
"dynaconf~=3.2.10",
"ddddocr~=1.5.6",
"playwright~=1.50.0",
"opencv-python~=4.11.0.86",
"tenacity~=9.1.2",
"tqdm~=4.67.1",
"gevent~=25.5.1",
"redis",
"uvicorn",
"pandas~=2.2.3",
"PyYAML~=6.0.2",
"PyMySQL~=1.1.1",
"mysql~=0.0.3",
"mysql-connector-python~=9.3.0",
"retrying~=1.4.0"
]
[tool.setuptools]
# 明确指定项目中的所有包
packages = [
"dao",
"js",
"logs",
"service",
"video"
]
# 指定包目录结构(根目录)
package-dir = {"" = "."}
\ No newline at end of file
......@@ -107,6 +107,8 @@ def listen_login(tab):
if 'account_login/v2/' in packet.url:
login_res = packet.response.body
logger.info(f'获取登录数据:{login_res}')
if not login_res:
continue
if login_res['description'] == '滑动滑块进行验证':
verify_captcha(tab)
elif login_res['description'] == '':
......@@ -114,6 +116,7 @@ def listen_login(tab):
break
else:
raise AppError(f"登录失败 {login_res['description']}")
raise AppError("登录失败-->未获取到登录数据")
def listen_check_login(tab):
check_result = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment