[project]
name = "shaguabijia-app-server"
version = "0.1.0"
description = "Shaguabijia 正式 App 后端 (FastAPI + SQLAlchemy + JWT)"
requires-python = ">=3.10"
dependencies = [
    # Web 框架 & ASGI
    "fastapi>=0.115.0",
    "uvicorn[standard]>=0.32.0",

    # 数据校验
    "pydantic>=2.9.0",
    "pydantic-settings>=2.5.0",
    "email-validator>=2.2.0",

    # ORM & 迁移
    "sqlalchemy>=2.0.35",
    "alembic>=1.13.3",

    # PostgreSQL 驱动 (psycopg3, SQLAlchemy 2.0 时代默认, 不要再装 psycopg2)
    "psycopg[binary]>=3.1",

    # JWT 签名 / 校验
    "pyjwt[crypto]>=2.9.0",

    # 极光一键登录:RSA 解密极光返回的加密手机号
    "cryptography>=42.0.0",

    # HTTP 客户端 (调极光 REST)
    "httpx>=0.27.0",

    # 阿里云号码认证(dypns)短信验证码 provider(SMS_PROVIDER=aliyun 时用;签名由 SDK 处理)
    "alibabacloud_dypnsapi20170525>=2.0.0",

    # multipart form (FastAPI 表单上传依赖)
    "python-multipart>=0.0.9",

    # admin 后台账号密码 hash(用户侧是手机号+验证码登录,不需要密码;admin 才用)
    "bcrypt>=4.0.0",

    # 邀请指纹归因:解析浏览器 UA 拿手机型号(Build.MODEL),跨端匹配用
    "user-agents>=2.2.0",

    # 离线经纬度→城市反查(美团 CPS 按城市过滤);会带入 numpy/scipy 依赖
    "reverse_geocoder>=1.5.1",
]

[project.optional-dependencies]
dev = [
    "pytest>=8.0.0",
    "pytest-asyncio>=0.24.0",
    "httpx>=0.27.0",
    "ruff>=0.6.0",
]

[tool.setuptools.packages.find]
include = ["app*"]

# 随包分发的运行时数据文件(美团城市词典;被 app/utils/meituan_city.py 加载)
[tool.setuptools.package-data]
"app.utils" = ["data/*.txt"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]

[tool.ruff]
line-length = 100
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP"]
ignore = ["E501"]
