feat: 添加项目规则、环境配置示例及开发文档
This commit is contained in:
143
pyproject.toml
Normal file
143
pyproject.toml
Normal file
@@ -0,0 +1,143 @@
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "minenasai"
|
||||
version = "0.1.0"
|
||||
description = "基于NAS的智能个人AI助理"
|
||||
readme = "README.md"
|
||||
license = { text = "MIT" }
|
||||
requires-python = ">=3.11"
|
||||
authors = [
|
||||
{ name = "MineNASAI Team" }
|
||||
]
|
||||
keywords = ["ai", "assistant", "nas", "claude", "automation"]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
# Web框架
|
||||
"fastapi>=0.109.0",
|
||||
"uvicorn[standard]>=0.27.0",
|
||||
"websockets>=12.0",
|
||||
|
||||
# Anthropic API
|
||||
"anthropic>=0.18.0",
|
||||
|
||||
# 数据处理
|
||||
"pydantic>=2.5.0",
|
||||
"pydantic-settings>=2.1.0",
|
||||
|
||||
# 数据库
|
||||
"aiosqlite>=0.19.0",
|
||||
|
||||
# 任务队列
|
||||
"celery>=5.3.0",
|
||||
"redis>=5.0.0",
|
||||
|
||||
# SSH (Web TUI)
|
||||
"paramiko>=3.4.0",
|
||||
|
||||
# 配置
|
||||
"python-dotenv>=1.0.0",
|
||||
"json5>=0.9.14",
|
||||
|
||||
# 日志
|
||||
"structlog>=24.1.0",
|
||||
|
||||
# 工具
|
||||
"httpx>=0.26.0",
|
||||
"aiofiles>=23.2.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.0.0",
|
||||
"pytest-asyncio>=0.23.0",
|
||||
"pytest-cov>=4.1.0",
|
||||
"ruff>=0.2.0",
|
||||
"mypy>=1.8.0",
|
||||
"pre-commit>=3.6.0",
|
||||
"types-redis>=4.6.0",
|
||||
"types-paramiko>=3.4.0",
|
||||
]
|
||||
|
||||
mcp = [
|
||||
"mcp>=1.0.0",
|
||||
]
|
||||
|
||||
rag = [
|
||||
"qdrant-client>=1.7.0",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
minenasai = "minenasai.cli:main"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/minenasai/minenasai"
|
||||
Documentation = "https://github.com/minenasai/minenasai#readme"
|
||||
Repository = "https://github.com/minenasai/minenasai"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/minenasai"]
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py311"
|
||||
line-length = 100
|
||||
src = ["src", "tests"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # Pyflakes
|
||||
"I", # isort
|
||||
"B", # flake8-bugbear
|
||||
"C4", # flake8-comprehensions
|
||||
"UP", # pyupgrade
|
||||
"ARG", # flake8-unused-arguments
|
||||
"SIM", # flake8-simplify
|
||||
]
|
||||
ignore = [
|
||||
"E501", # line too long (handled by formatter)
|
||||
"B008", # function call in default argument
|
||||
"B904", # raise without from inside except
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["minenasai"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.11"
|
||||
strict = true
|
||||
warn_return_any = true
|
||||
warn_unused_ignores = true
|
||||
disallow_untyped_defs = true
|
||||
ignore_missing_imports = true
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = "tests.*"
|
||||
disallow_untyped_defs = false
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
asyncio_mode = "auto"
|
||||
addopts = "-v --tb=short"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["src/minenasai"]
|
||||
branch = true
|
||||
|
||||
[tool.coverage.report]
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"if TYPE_CHECKING:",
|
||||
"raise NotImplementedError",
|
||||
]
|
||||
Reference in New Issue
Block a user