-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
68 lines (62 loc) · 2.47 KB
/
Copy pathpyproject.toml
File metadata and controls
68 lines (62 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
[project]
name = "myknowledge"
# 版本单一来源:backend/__version__.py(发版只改那里,pyproject 自动派生,
# 由 .githooks/pre-push 校验与 desktop/package.json 一致)。
dynamic = ["version"]
description = "Local-first 知识管理平台 — 纯 Markdown + Git + MCP,让 AI 取·存你的知识"
requires-python = ">=3.10"
dependencies = [
# MCP protocol(<2.0:mcp 2.x 移除 mcp.server.fastmcp,2026-08-10 验证 1.29 仍兼容)
"mcp[cli]>=1.0.0,<2.0",
# YAML frontmatter
"pyyaml>=6.0",
# Git operations
"gitpython>=3.1",
# REST API
"fastapi>=0.141.0,<0.142.0",
"uvicorn[standard]>=0.23.0",
"python-multipart>=0.0.6",
# Pydantic models
"pydantic>=2.0",
# SSE event versioning
"aiosqlite>=0.19",
]
[project.scripts]
myknowledge = "backend.cli:main"
[tool.setuptools.dynamic]
# 静态 AST 解析 backend/__version__.py(不执行包导入,不触发 h11 检查)
version = {attr = "backend.__version__.__version__"}
[tool.setuptools.packages.find]
where = ["."]
# 白名单:只收 backend + frontend 两个包。2026-08-18 修复:此前无 include,
# packages.find 把 dist-backend/(PyInstaller onedir 产物)误当包收进 wheel
# (261 文件 / 2.78MB 冗余);include 白名单防未来新目录再次混入。
include = ["backend*", "frontend*"]
# 前端资源进 wheel:后端 serve 依赖 index.standalone.html(构建产物)+ vendor/(运行时加载)
# + tiptap-bundle.mjs(importmap);index.html/js/css 一并携带,便于安装后重建产物。
# backend 数据文件进 wheel:templates(myknowledge init 复制默认模板)+ AiClientConfig
# (platforms.json/agents/hooks,client_config 运行时读取,缺失则平台配置崩)。
# 2026-08-18 修复:0.7.5 曾漏带这两处(PyPI 安装后 init 无模板 / client-config 缺配置)。
[tool.setuptools.package-data]
backend = [
"templates/*",
"AiClientConfig/*.json",
"AiClientConfig/agents/*",
"AiClientConfig/hooks/*",
]
frontend = [
"index.standalone.html",
"index.html",
"tiptap-bundle.mjs",
"js/*.js",
"js/components/*.js",
"css/*.css",
"vendor/*",
]
[tool.pytest.ini_options]
# 排除构建产物:PyInstaller 打包目录(dist-backend/、build/)与桌面壳
# (desktop/node_modules 等)不应被 pytest 收集
norecursedirs = ["dist-backend", "build", "desktop", "frontend"]