From 320fadc5cb6abe45edfb5e1e47dd66021f790cc8 Mon Sep 17 00:00:00 2001 From: Karako Date: Sat, 3 Sep 2022 00:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E6=9B=B4=E6=8D=A2=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E5=8C=85=E7=AE=A1=E7=90=86=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E4=B8=BA=20`poetry`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 32 ++++++++++++++------------------ pyproject.toml | 31 +++++++++++++++++++++++++++++++ requirements.txt | 24 ------------------------ 3 files changed, 45 insertions(+), 42 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/README.md b/README.md index ff8a946..649dc18 100644 --- a/README.md +++ b/README.md @@ -13,32 +13,28 @@ 项目仅供学习交流使用,严禁用于任何商业用途和非法行为 -## 需求 - -### 环境需求 +## 环境需求 - Python 3.8+ - MySQL - Redis -#### 环境需求需要的注意事项 +## 使用方法 -因为上游 `genshin.py` 的原因 本项目 python 最低版本为 3.8 +### 1. 安装 `poetry` +```bash +pip install --upgrade poetry +``` -### 模块需求 +### 2. 安装依赖 +```bash +poetry update +``` +### 3. 运行 +```bash +python ./main.py +``` -#### 模块需求需要的注意事项 - -`python-telegram-bot` 需要预览版本 即 `20.0a4` - -出现相关的 `telegram` 模块导入的 `ImportError` 错误需要你手动执行 `pip install python-telegram-bot==20.0a2` - -请注意你的 python 是否安装 `aiohttp` ( `genshin.py` 的依赖) - -如果 `aiohttp` 版本大于 `4.0.0a1` -会导致 `redis` 和 `aiohttp` 的依赖 `async-timeout` 版本冲突进而运行代码导致 `TypeError` 异常 - -解决上面版本冲突导致的错误需要你手动执行 `pip install aiohttp==3.8.1` ## 其他说明 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e3ce12d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[tool.poetry] +name = "tgpaimonbot" +version = "0.3.0" +description = "Telegarm robot, query the official genshin information." +authors = ["洛水居室", "zhxy-CN", "Chuangbo Li", "kotoriのねこ", "omg-xtao", "艾迪", "Karako"] +license = "AGPL-3.0" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.8" +ujson = "^5.4.0" +genshin = { git = "https://github.com/thesadru/genshin.py" } +Jinja2 = "^3.1.2" +numpy = "^1.23.2" +python-telegram-bot = { version = "^20.0a4", extras = ["rate-limiter"] } +Pillow = "^9.2.0" +sqlmodel = "^0.0.8" +colorlog = "^6.7.0" +playwright = "^1.25.2" +fakeredis = "^1.9.0" +beautifulsoup4 = "^4.11.1" +asyncmy = "^0.2.5" +pyppeteer = "^1.0.2" +aiofiles = "^0.8.0" +python-dotenv = "^0.20.0" +PyMySQL = "^1.0.2" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 56d19ec..0000000 --- a/requirements.txt +++ /dev/null @@ -1,24 +0,0 @@ -redis>=4.3.3 -ujson==5.4.0 -git+https://github.com/thesadru/genshin.py -colorlog~=6.6.0 -numpy~=1.22.3 -httpx==0.23.0 -asyncio>=3.4.3 -jinja2>=3.1.2 -aiofiles>=0.8.0 -playwright==1.22.0 -pymysql>=0.9.3 -beautifulsoup4>=4.11.1 -pyppeteer~=1.0.2 -lxml>=4.9.0 -fakeredis>=1.8.1 -aiohttp<=3.8.1 -python-telegram-bot==20.0a4 -pytz>=2021.3 -Pillow>=9.0.1 -SQLAlchemy>=1.4.39 -sqlmodel>=0.0.8 -asyncmy>=0.2.5 -python-dotenv>=0.20.0 -aiolimiter>=1.0.0 \ No newline at end of file