setup.py file
From Setuptools import Setupfrom codecs import Open # Third-party dependent package and version requires = [' beautifulsoup4>=4.3.2 ', ' gearman& gt;=2.0.2 ', ' pymongo>=2.7.2 ', ' threadpool>=1.2.7 ', ' geoip2>=2.1.0 ', ' Pywi n32>=219 '] # Package List 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 = ' [email protected] ', description = ' industry Device/system search engine ', lon g_description = history, url = '-', packages = packages, Include_package_data = True, entry_points = {' Console_scr IPTs ': [' Mse-manager = MSE. Worker.Manager:main ',]}, Package_dir = {' MSE ': ' MSE '}, Install_requires = requires, license = ' Apache ', #zip_sa Fe = False, classifiers = [' Development Status:: 1 -Production/stable ', ' intended audience:: Developers ', ' License:: OSI approved:: Apache software License ' , ' Natural Language:: 中文版 ', ' Operating System:: OS independent ', ' Programming Language:: Python ', ' Programming Language:: Python:: 2.7 ', ' Topic:: Software Development:: Libraries:: Python Modules ', ],)
manifest.in file
Include History.rstinclude manifest.inrecursive-include mes/utility *.mmdb
Description
1. Zip_safe = False does not compress into an egg file, but instead installs the egg in the form of a directory
2. Include_package_data = True, contains package data
3. manifest.in file, for inclusion of other files
4. Publish the manayer.py tool script:
Entry_points ={' console_scripts ': [
' Mse-manager = MSE. Worker.Manager:main ',
]},
After installation, two files are generated under the Scripts folder in the Python system directory: Mse-manager.exe and mse-manager.py
5. Packaging command: Python setup.py sdist
This address: http://blog.csdn.net/fragmentalice/article/details/44833013
Python setup.py and manifest.in files