环境:win10、eclipse-jee-mars、python2.7
打包在linux上进行安装测试
1.1 打包
项目目录结构如下:
打包对象:utils.reg
在P1项目的顶级目录,也就是utils包的父目录下创建setup.py文件,内容如下:
#coding=utf-8
from distutils.core import setup
setup(
name='reg',
version='v1.0',
py_modules=['utils.reg']
)
直接运行该文件会报以下错误:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
编译
python setup.py build
编译后在setup.py同目录下多出一个build目录
打包
G:\SVN\workspaces\P1\src>python setup.py sdist
running sdist
running check
warning: check: missing required meta-data: url
warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)
warning: sdist: standard file not found: should have one of README, README.txt
writing manifest file 'MANIFEST'
creating reg-v1.0
creating reg-v1.0\utils
copying files to reg-v1.0...
copying setup.py -> reg-v1.0
copying