From 1a9def0a2398341d0deb37161374ef3055f17ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AE=E3=83=AA=E7=8C=AB?= Date: Tue, 2 Sep 2025 17:53:47 +0800 Subject: [PATCH] fix: requirements and some syntax fix. --- app.py | 6 +++--- pyproject.toml | 10 +++++++--- requirements.txt | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index da145c4..cdb8824 100644 --- a/app.py +++ b/app.py @@ -107,7 +107,7 @@ async def get_status_image(ip: str = Query(None, description="服务器IP地址 background_data = f.read() # 字体设置方法 - if not FONT_PATH or FONT_PATH == "": + if not FONT_PATH: font_url = None else: font_url = FONT_PATH @@ -152,11 +152,11 @@ async def get_status_image(ip: str = Query(None, description="服务器IP地址 icon_data = await get_icon_image(DEFAULT_ICON) # 图片尺寸 - if not IMAGE_WIDTH == 0 or IMAGE_HEIGHT == 0: + if not IMAGE_WIDTH or not IMAGE_HEIGHT: image_size = [0,0] else: image_size = [IMAGE_WIDTH, IMAGE_HEIGHT] - + image = await loop.run_in_executor(None, create_image, background_data, diff --git a/pyproject.toml b/pyproject.toml index 482b799..927a96e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,11 @@ description = "A Minecraft Server status API based on FastAPI" readme = "README.md" requires-python = ">=3.13" dependencies = [ - "fastapi[standard]>=0.115.0", - "uvicorn>=0.30.0", - "mcstatus>=12.0.5", + "fastapi>=0.110.0", + "gunicorn>=21.2.0", + "uvicorn[standard]>=0.29.0", + "httpx>=0.27.0", + "pillow>=10.3.0", + "dnspython>=2.6.1" + "mcstatus>= 12.0.5" ] diff --git a/requirements.txt b/requirements.txt index 4b30aa7..c31ab18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ gunicorn>=21.2.0 uvicorn[standard]>=0.29.0 httpx>=0.27.0 pillow>=10.3.0 -dnspython>=2.6.1 \ No newline at end of file +dnspython>=2.6.1 +mcstatus>= 12.0.5 \ No newline at end of file