setup.cfg 生成器
项目描述
安装
$ [sudo] pip install setupcfg-generator
功能
[metadata] |
环境变量 |
---|---|
名称 |
当前目录基本名或 $NAME |
分类器 |
classifiers.txt , $CLASSIFIERS |
描述 |
description.txt , $DESCRIPTION |
关键字 |
keywords.txt , $KEYWORDS |
长描述 |
README.md /README.rst , $LONG_DESCRIPTION |
长描述内容类型 |
text/markdown 如果 long_description 是 .md 文件 |
版本 |
version.txt , $VERSION |
网址 |
$URL |
[options] |
环境变量 |
---|---|
install_requires |
requirements.txt |
包 |
setuptools.find_packages() 结果,带有 __init__.py 的文件夹 |
py_modules |
当前目录中的Python文件 |
脚本 |
bin/* 或 scripts/* 文件 |
文件可以位于当前目录或任何子目录
示例
project-name.py/
├── bin
| └── script
├── classifiers.txt
├── description.txt
├── subfolder/keywords.txt
├── requirements.txt
├── module.py
├── package
| └── __init__.py
├── README.md
├── scripts
| └── script
├── setup.py
├── subfolder/version.txt
$ cd path/to/project-name.py
$ export URL="https://github.com/owner/repo"
$ python -m setupcfg_generator
$ cat setup.cfg
[metadata]
name = project-name
version = 1.0.0
url = https://github.com/owner/repo
classifiers = file: classifiers.txt
description = file: description.txt
long_description = file: README.md
long_description_content_type = text/markdown
keywords = key1 key2
[options]
install_requires =
req1
req2
packages =
pkgname
py_modules =
module
scripts =
bin/script
scripts/script