Files
NyaHome/pyproject.toml
T
MangoFanFanw c30d65f9ae feat: 使用 Alembic 实现数据库结构与代码同步
并且添加了一些管理数据库的快捷命令,实现和 Django 类似的开发体验:
- uv run task makemigrations : 创建数据库变更文件
- uv run task migrate : 应用数据库变更
更多请查看 pyproject.toml 。
目前仅针对 SQLite 数据库进行适配。
2026-05-24 13:52:57 +08:00

113 lines
1.9 KiB
TOML

[project]
name = "nyahome"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"aiofiles>=25.1.0",
"aiosmtplib>=5.1.0",
"alembic>=1.18.4",
"argon2-cffi>=25.1.0",
"fastapi>=0.136.1",
"httpx>=0.28.1",
"jinja2>=3.1.6",
"openai>=2.38.0",
"passlib[bcrypt]>=1.7.4",
"pydantic>=2.13.4",
"python-jose[cryptography]>=3.5.0",
"python-multipart>=0.0.29",
"pyyaml>=6.0.3",
"rich>=15.0.0",
"sqlalchemy>=2.0.49",
"sqlmodel>=0.0.38",
"typer>=0.25.1",
"uvicorn>=0.47.0",
]
[dependency-groups]
dev = [
"mypy>=2.1.0",
"ruff>=0.15.14",
"taskipy>=1.14.1",
"types-aiofiles>=25.1.0.20260518",
"types-passlib>=1.7.7.20260211",
"types-python-jose>=3.5.0.20260408",
]
[project.scripts]
nyahome = "nyahome.manage:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
artifacts = ["src/nyahome/static/**"]
[tool.hatch.build.targets.wheel]
packages = ["src/nyahome"]
artifacts = ["src/nyahome/static/**"]
[tool.ruff]
preview = true
line-length = 120
target-version = "py313"
[tool.ruff.lint]
select = [
"A",
"B",
"C",
"E",
"F",
"E",
"Q",
"I",
"N",
"W",
"DOC",
"RSE",
"RET",
"FAST",
"YTT",
"ANN",
"ASYNC",
"COM",
"T20",
"SIM",
"PTH",
"FLY",
"RUF",
]
ignore = [
"PTH123",
"RUF001",
"RUF002",
"RUF003",
"RUF029",
"C90",
"COM812",
"E501",
]
fixable = ["ALL"]
[tool.mypy]
files = ["src"]
strict = true
warn_return_any = true
disable_error_code = ["list-item", "attr-defined", "type-arg"]
[tool.taskipy.tasks]
# 生成迁移
makemigrations = "alembic revision --autogenerate -m 'auto'"
# 执行迁移
migrate = "alembic upgrade head"
# 回滚
rollback = "alembic downgrade -1"
# 查看数据库版本
current = "alembic current"