setup.py

Setup tools 打包生成二进制文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from setuptools,import,setup,find_packages

with open(README.md, r, encoding=utf-8) as fh:
long_description = fh.read()

setup(
# Name
# Version
# Description
# Long description = long_description
# url
# author
# author_email = ...
# Packages = find_packages
# install_requires = [openpyxl,pandas] # example
entry_points = [
"eyetool = trainingtools.bin.eyetool:cmd"
]
python_requires = ">=3.9"
)

安装命令

生成 .whl

1
python3 setup.py sdist bdist_wheel

安装 .whl

1
pip3 install dist/$(PKG)-*.whl

进入 Dev 模式

1
python3 setup.py develop --install-dir $(DEV_PTH)

命令行入口

命令行入口是一个函数,可通过 argparse 等方式接受参数。