-
Notifications
You must be signed in to change notification settings - Fork 49
/
pyproject.toml
113 lines (92 loc) · 4.04 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
107
108
109
110
111
112
# 在此处完成python项目的配置以及依赖安装
[build-system] # 指定构建系统与一些依赖
requires = [
"hatchling",
"hatch-requirements-txt",
"hatch-fancy-pypi-readme>=22.5.0",
]
build-backend = "hatchling.build"
[project]
name = "swanlab" # 项目名称
dynamic = ["version", "dependencies", "optional-dependencies", "readme"] # 动态配置版本,依赖,可选依赖,readme
description = "Python library for streamlined tracking and management of AI training processes." # 项目描述
license = "Apache-2.0" # 项目许可证
requires-python = ">=3.8" # python版本要求,我们只维护python3.8以上版本
authors = [# 项目作者
{ name = "Cunyue", email = "[email protected]" },
{ name = "Feudalman", email = "[email protected]" },
{ name = "ZeYi Lin", email = "[email protected]" },
{ name = "KashiwaByte", 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.scripts] # 项目脚本
swanlab = "swanlab.cli:cli" # 项目命令行工具(可添加多个)
[project.urls] # 项目链接
"Homepage" = "https://swanlab.cn"
"Source" = "https://github.com/SwanHubX/SwanLab"
"Bug Reports" = "https://github.com/SwanHubX/SwanLab/issues"
"Documentation" = "https://docs.swanlab.cn/zh/guide_cloud/general/what-is-swanlab.html"
[tool.hatch.version] # 动态设置项目版本
path = "swanlab/package.json" # package.json文件,从中获取版本号
pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""
[tool.hatch.metadata.hooks.requirements_txt]
filename = "requirements.txt"
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
media = ["requirements-media.txt"] # pip install "swanlab[meida]"
[tool.hatch.metadata.hooks.fancy-pypi-readme] # 动态设置readme
content-type = "text/markdown"
fragments = [{ path = "README.md" }]
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # 动态设置readme中的图片链接,渲染为html格式,gradio设置了,暂时不知道有什么用
pattern = "(readme_files)/"
replacement = 'https://raw.githubusercontent.com/SwanHubX/swanlab/main/\g<1>/'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # 动态设置中文README跳转规则
pattern = "README_en.md"
replacement = 'https://github.com/SwanHubX/SwanLab/blob/main/README_en.md'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # 动态设置README跳转规则
pattern = "README.md"
replacement = "https://github.com/SwanHubX/SwanLab/blob/main/README.md"
[tool.hatch.build]
artifacts = [
"*.json",
"*.pyi", # 类型提示文件
]
[tool.hatch.build.targets.sdist] # 在执行构建之前,将一些必要文件拷贝到虚拟环境中,以便构建,此时已经完成了vue的编译
include = [
"/swanlab",
"/test", # 包含一些测试脚本,确保测试成功
"/README.md", # 包含readme
"/requirements.txt", # 包含依赖
"/requirements-media.txt", # 包含可选依赖
]
[tool.hatch.build.targets.wheel]
packages = ["swanlab"] # 指定项目包名
[tool.pyright] # 静态类型检查,暂时没有配置
include = ["swanlab/**/*.py"] # 检查的文件
exclude = [] # 排除的文件
[tool.ruff] # 代码风格检查,暂时没有配置
target-version = "py37"
extend-select = ["B", "C", "I", "N", "SIM", "UP"]
ignore = []
# black配置,与构建无关
[tool.black]
line-length = 120
skip-string-normalization = true