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