- 添加 .env.example 环境变量配置示例 - 添加 .gitignore 忽略文件配置 - 添加 core/config.py 配置管理模块 - 添加 deployments/k8s/configmap.yaml Kubernetes 配置 - 添加 core/database.py 数据库连接管理模块 - 添加 core/dependencies.py 全局依赖模块 - 添加 DEPENDENCIES_UPDATED.md 依赖更新记录 - 添加 deployments/k8s/deployment.yaml Kubernetes 部署配置- 添加 deployments/swarm/docker-compose.swarm.yml Docker Swarm 部署配置 - 添加 deployments/docker/docker-compose.yml Docker 部署配置 - 添加 deployments/docker/Dockerfile 应用镜像构建文件 - 添加 middleware/error_handler.py 全局异常处理中间件
121 lines
2.8 KiB
TOML
121 lines
2.8 KiB
TOML
[project]
|
|
name = "kami_spider"
|
|
version = "0.1.0"
|
|
description = "A stateless, production-ready FastAPI-based web service platform hosting multiple independent web applications"
|
|
readme = "README.md"
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"fastapi>=0.120.0",
|
|
"uvicorn[standard]>=0.38.0",
|
|
"gunicorn>=23.0.0",
|
|
"sqlmodel>=0.0.24",
|
|
"pydantic>=2.12.3",
|
|
"pydantic-settings>=2.11.0",
|
|
"redis>=5.2.1",
|
|
"pymysql>=1.1.1",
|
|
"cryptography>=46.0.1",
|
|
"aiomysql>=0.2.0",
|
|
"alembic>=1.14.0",
|
|
"python-dotenv>=1.0.1",
|
|
"opentelemetry-api>=1.38.0",
|
|
"opentelemetry-sdk>=1.38.0",
|
|
"opentelemetry-instrumentation-fastapi>=0.59b0",
|
|
"opentelemetry-instrumentation-sqlalchemy>=0.59b0",
|
|
"opentelemetry-instrumentation-redis>=0.59b0",
|
|
"opentelemetry-instrumentation-httpx>=0.59b0",
|
|
"opentelemetry-exporter-otlp-proto-grpc>=1.38.0",
|
|
"httpx>=0.28.1",
|
|
"python-multipart>=0.0.20",
|
|
"email-validator>=2.3.0",
|
|
"greenlet>=3.2.4",
|
|
"orjson>=3.11.4",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.3.4",
|
|
"pytest-asyncio>=0.24.0",
|
|
"pytest-cov>=6.0.0",
|
|
"pytest-mock>=3.14.0",
|
|
"httpx>=0.28.1",
|
|
"ruff>=0.8.4",
|
|
"mypy>=1.14.1",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["apps", "core", "middleware", "observability"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
asyncio_mode = "auto"
|
|
addopts = [
|
|
"--strict-markers",
|
|
"--strict-config",
|
|
"--cov=.",
|
|
"--cov-report=term-missing",
|
|
"--cov-report=html",
|
|
]
|
|
|
|
[tool.coverage.run]
|
|
source = ["."]
|
|
omit = [
|
|
"tests/*",
|
|
"*/site-packages/*",
|
|
"*/__pycache__/*",
|
|
]
|
|
|
|
[tool.coverage.report]
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"def __repr__",
|
|
"raise AssertionError",
|
|
"raise NotImplementedError",
|
|
"if __name__ == .__main__.:",
|
|
"if TYPE_CHECKING:",
|
|
"class .*\\bProtocol\\):",
|
|
"@(abc\\.)?abstractmethod",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 120
|
|
target-version = "py313"
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # pyflakes
|
|
"I", # isort
|
|
"B", # flake8-bugbear
|
|
"C4", # flake8-comprehensions
|
|
"UP", # pyupgrade
|
|
]
|
|
ignore = [
|
|
"E501", # line too long (handled by formatter)
|
|
"B008", # do not perform function calls in argument defaults
|
|
"W191", # indentation contains tabs
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"__init__.py" = ["F401"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.13"
|
|
warn_return_any = true
|
|
warn_unused_configs = true
|
|
disallow_untyped_defs = true
|
|
disallow_incomplete_defs = true
|
|
check_untyped_defs = true
|
|
no_implicit_optional = true
|
|
warn_redundant_casts = true
|
|
warn_unused_ignores = true
|
|
warn_no_return = true
|
|
strict_equality = true
|