Skip to content

Commit e1c1dd3

Browse files
committed
feature: 增加pyproject.toml相关规范
1 parent 373c35c commit e1c1dd3

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

package/config.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 配置文件
2+
3+
使用`pyproject.toml`,规范详见[setuptools文档](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html)
4+
5+
## `[project]`
6+
7+
### `version`选项
8+
9+
遵循语义化版本,从`0.1.0-alpha.1`开始计数。
10+
11+
### `classifiers`选项
12+
13+
示例:
14+
15+
```toml
16+
classifiers = [
17+
"Programming Language :: Python :: 3",
18+
"Framework :: Django",
19+
"License :: OSI Approved :: BSD License",
20+
"Development Status :: 3 - Alpha",
21+
]
22+
```
23+
24+
说明:
25+
26+
- 编程语言选Python 3。
27+
- 如果是Django项目,框架选Django。
28+
- 证书填使用的。
29+
- 开发状态默认从阶段3(Alpha)开始,即在内部有使用案例的Alpha阶段。
30+
31+
## `[tool.setuptools]`
32+
33+
```toml
34+
packages = ["<your_package_dir>"]
35+
```
36+
37+
注意配置此项,避免`tests``exmaple`等文件夹被错误打包。
38+

setup/README.md

Whitespace-only changes.

setup/templates/file_templates.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 文件模板
2+
3+
## `pyproject.toml`
4+
5+
```toml
6+
[build-system]
7+
requires = ["setuptools>=61", "setuptools.scm"]
8+
build-backend = "setuptools.build_meta"
9+
10+
[project]
11+
# name it as your package name
12+
name = "<your-package-name>"
13+
# semetric versions
14+
version = "0.1.0-alpha.1"
15+
# describe the package within one sentence
16+
description = "<your-package-description>"
17+
authors = [{name = "QuantTide Inc.", email = "[email protected]"}]
18+
license = {text = "<your-license>"}
19+
classifiers = [
20+
"Programming Language :: Python :: 3",
21+
]
22+
requires-python = '>=3'
23+
dependencies = [
24+
]
25+
26+
[project.readme]
27+
file = "README.md"
28+
content-type = "text/markdown"
29+
30+
[tool.setuptools]
31+
packages = ["<your_package_dir>"]
32+
```

0 commit comments

Comments
 (0)