build: 更新项目构建配置

- 添加 pyproject.toml 文件,配置项目信息和依赖
- 更新 requirements.txt,调整依赖版本
- 在 static.py 中添加版本号变量
- 添加 .python-version 文件,指定 Python 版本
This commit is contained in:
2025-02-15 20:48:09 +08:00
parent 697ff3f7a3
commit 94198f5a51
5 changed files with 47 additions and 12 deletions

1
.python-version Normal file
View File

@ -0,0 +1 @@
3.12

View File

@ -60,7 +60,7 @@ async def example():
async def test():
url = ""
async with XHS() as xhs:
print(await xhs.extract(url))
print(await xhs.extract(url, download=True, ))
if __name__ == "__main__":

30
pyproject.toml Normal file
View File

@ -0,0 +1,30 @@
[project]
name = "XHS-Downloader"
version = "2.5.beta"
description = "小红书XiaoHongShu、RedNote链接提取/作品采集工具:提取账号发布、收藏、点赞、专辑作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书无水印作品文件"
authors = [
{ name = "JoeanAmier", email = "yonglelolu@foxmail.com" },
]
readme = "README.md"
license = "GPL-3.0"
requires-python = ">=3.12,<3.13"
dependencies = [
"aiofiles>=24.1.0",
"aiosqlite>=0.21.0",
"click>=8.1.8",
"emoji>=2.14.1",
"fastapi>=0.115.8",
"httpx[socks]>=0.28.1",
"lxml>=5.3.1",
"pyperclip>=1.9.0",
"pyyaml>=6.0.2",
"rookiepy>=0.5.6",
"textual>=1.0.0",
"uvicorn>=0.34.0",
]
[project.urls]
Repository = "https://github.com/JoeanAmier/XHS-Downloader"
[tool.uv.pip]
index-url = "https://mirrors.ustc.edu.cn/pypi/simple"

View File

@ -1,12 +1,12 @@
textual>=1.0.0
pyperclip>=1.9.0
lxml>=5.3.0
PyYAML>=6.0.2
aiosqlite>=0.20.0
click>=8.1.7
rookiepy>=0.5.6
httpx[socks]>=0.28.0
fastapi>=0.112.1
uvicorn>=0.30.6
aiofiles>=24.1.0
emoji>=2.14.0
aiosqlite>=0.21.0
click>=8.1.8
emoji>=2.14.1
fastapi>=0.115.8
httpx[socks]>=0.28.1
lxml>=5.3.1
pyperclip>=1.9.0
pyyaml>=6.0.2
rookiepy>=0.5.6
textual>=1.0.0
uvicorn>=0.34.0

View File

@ -3,6 +3,7 @@ from pathlib import Path
VERSION_MAJOR = 2
VERSION_MINOR = 5
VERSION_BETA = True
__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{"beta" if VERSION_BETA else "stable"}"
ROOT = Path(__file__).resolve().parent.parent.parent
PROJECT = f"XHS-Downloader V{VERSION_MAJOR}.{
VERSION_MINOR} {"Beta" if VERSION_BETA else "Stable"}"
@ -53,3 +54,6 @@ FILE_SIGNATURES: tuple[tuple[int, bytes, str,], ...] = (
FILE_SIGNATURES_LENGTH = max(offset + len(signature) for offset, signature, _ in FILE_SIGNATURES)
MAX_WORKERS: int = 4
if __name__ == "__main__":
print(__version__)