Python setup.py和MANIFEST.in文件

Setup.py文件

from setuptools import setup
from codecs import open
 
# 第三方依賴包及版本號
requires = ['beautifulsoup4>=4.3.2',
           'gearman>=2.0.2',
           'pymongo>=2.7.2',
           'threadpool>=1.2.7',
           'geoip2>=2.1.0',
           'pywin32>=219']
 
# 包列表
packages = ['MSE',
           'MSE.Device',
           'MSE.Proxy',
           'MSE.Scanner',
           'MSE.Utility',
           'MSE.Worker',
           'MSE.Config']
 
with open('HISTORY.rst', 'r', 'utf-8') asf:
   history = f.read()
   
setup(
   name = 'MSE',
   version = '1.2.1',
   author = 'Edwin',
   author_email = 'edwin.yy.yang@foxmail.com',
   description = 'Industry device/system search engine',
   long_description = history,
   url = '-',
   packages = packages,
   include_package_data = True,
   entry_points = {'console_scripts': [
       'MSE-Manager = MSE.Worker.Manager:main',
   ]},
   package_dir = {'MSE': 'MSE'},
   install_requires = requires,
   license = 'Apache',
   #zip_safe = False,
   classifiers = [
       'Development Status :: 1 - Production/Stable',
       'Intended Audience :: Developers',
       'License :: OSI Approved :: Apache Software License',
       'Natural Language :: English',
       'Operating System :: OS Independent',
       'Programming Language :: Python',       
       'Programming Language :: Python :: 2.7',
       'Topic :: Software Development :: Libraries :: Python Modules',
   ],
)

 

MANIFEST.in文件

詳細格式和參數參考https://docs.python.org/2/distutils/sourcedist.html
html

include HISTORY.rst
include MANIFEST.in
recursive-include MES/Utility *.mmdb

 

說明

1.      zip_safe = False 不壓縮爲一個egg文件,而是以文件夾的形式安裝eggpython

2.      include_package_data = True。包括包數據工具

3.      MANIFEST.in文件,用於包括其它文件post

4.      公佈Manayer.py工具腳本:ui

entry_points ={'console_scripts': [url

'MSE-Manager = MSE.Worker.Manager:main',.net

 ]},code

安裝後會在Python系統文件夾的Scripts文件夾下生成兩個文件:MSE-Manager.exe和MSE-Manager.pyhtm

5.      打包命令:python setup.py sdistblog


本文地址:http://blog.csdn.net/fragmentalice/article/details/44833013

相關文章
相關標籤/搜索