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

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

 

说明

1.      zip_safe = False 不压缩为一个egg文件,而是以目录的形式安装egg

2.      include_package_data = True,包含包数据

3.      MANIFEST.in文件,用于包含其他文件

4.      发布Manayer.py工具脚本:

entry_points ={'console_scripts': [

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

 ]},

安装后会在Python系统目录的Scripts文件夹下生成两个文件:MSE-Manager.exe和MSE-Manager.py

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


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

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值