forked from SwanHubX/SwanLab-Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
106 lines (90 loc) · 3.63 KB
/
pyproject.toml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 在此处完成python项目的配置以及依赖安装
[build-system] # 指定构建系统与一些依赖
requires = [
"hatchling",
"hatch-requirements-txt",
"hatch-fancy-pypi-readme>=22.5.0",
]
build-backend = "hatchling.build"
[project]
name = "swanboard" # 项目名称
dynamic = ["version", "dependencies", "readme"] # 动态配置版本,依赖,可选依赖,readme
description = "Dashboard for SwanLab." # 项目描述
license = "Apache-2.0" # 项目许可证
requires-python = ">=3.8" # python版本要求,我们只维护python3.8以上版本
authors = [# 项目作者
{ name = "Cunyue", email = "[email protected]" },
{ name = "Feudalman", email = "[email protected]" }
]
keywords = [# 项目关键词
"machine learning",
"reproducibility",
"visualization"
]
classifiers = [# 项目分类
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Visualization',
]
[project.urls] # 项目链接
"Homepage" = "https://swanhub.co"
"Source" = "https://github.com/SwanHubX/SwanLab-Dashboard"
"Bug Reports" = "https://github.com/SwanHubX/SwanLab-Dashboard/issues"
[tool.hatch.version] # 动态设置项目版本
path = "swanboard/package.json" # package.json文件,从中获取版本号
pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""
[tool.hatch.metadata.hooks.requirements_txt] # 动态设置依赖
files = ["requirements.txt"]
[tool.hatch.metadata.hooks.fancy-pypi-readme] # 动态设置readme
content-type = "text/markdown"
fragments = [{ path = "README.md" }]
[tool.hatch.build]
artifacts = [# 将一些非python文件打包到项目中
"/swanboard/template",
"*.json",
"*.pyi", # 类型提示文件
]
[tool.hatch.build.targets.sdist] # 在执行构建之前,将一些必要文件拷贝到虚拟环境中,以便构建,此时已经完成了vue的编译
include = [
"/swanboard",
"/test", # 包含一些测试脚本,确保测试成功
"/README.md", # 包含readme
"/requirements.txt", # 包含依赖
"/package.json", # 包含前端的package.json文件
]
[tool.hatch.build.targets.wheel]
packages = ["swanboard"] # 指定项目包名
[tool.pyright] # 静态类型检查
include = ["swanboard/**/*.py"] # 检查的文件
exclude = [] # 排除的文件
[tool.ruff] # 代码风格检查
target-version = "py37"
extend-select = ["B", "C", "I", "N", "SIM", "UP"]
ignore = [
"C901", # function is too complex (TODO: un-ignore this)
"B023", # function definition in loop (TODO: un-ignore this)
"B008", # function call in argument defaults
"B017", # pytest.raises considered evil
"B028", # explicit stacklevel for warnings
"E501", # from scripts/lint_backend.sh
"SIM105", # contextlib.suppress (has a performance cost)
"SIM117", # multiple nested with blocks (doesn't look good with gr.Row etc)
"UP007", # use X | Y for type annotations (TODO: can be enabled once Pydantic plays nice with them)
"UP006", # use `list` instead of `List` for type annotations (fails for 3.8)
]
exclude = []
# 可以在此处指定一些环境变量
[tool.pytest.ini_options]
# black配置,与构建无关
[tool.black]
line-length = 120