在Python开源项目中合并第三方库的首选传统方式是什么?
我正在为WSGI框架开发一个新的Python身份验证库,并希望使用,也许还有其他一些第三方LIB。我看到两种选择:在Python开源项目中合并第三方库的首选传统方式是什么?,python,setuptools,Python,Setuptools,我正在为WSGI框架开发一个新的Python身份验证库,并希望使用,也许还有其他一些第三方LIB。我看到两种选择: 在“我的库”中分发第三方库的副本(通过GIT子模块) 让我的库的用户自己解决对第三方库的依赖 问题是: 在Python开源项目中合并第三方库的首选常规方法是什么?首选方法是使用/并为您的项目定义一个可通过下载第三方库的 这是我一个项目的摘录。请注意,使用setup/install/test/extras需要关键字参数,这正是您需要的 import distribute_setu
- 在“我的库”中分发第三方库的副本(通过GIT子模块)
- 让我的库的用户自己解决对第三方库的依赖
在Python开源项目中合并第三方库的首选常规方法是什么?首选方法是使用/并为您的项目定义一个可通过下载第三方库的 这是我一个项目的摘录。请注意,使用setup/install/test/extras需要关键字参数,这正是您需要的
import distribute_setup
distribute_setup.use_setuptools()
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='buildboticon',
version='0.3.2',
author='Marcus Lindblom',
author_email='macke@yar.nu',
description=('A buildbot monitoring utility'),
license='GPL 3.0',
keywords='buildbot systemtray pyqt',
url='http://bitbucket.org/marcusl/buildboticon',
download_url='http://packages.python.org/buildboticon',
package_dir={'':'src'},
packages=find_packages('src', exclude=['*.tests']),
long_description=read('README'),
entry_points={
'setuptools.installation': [
'eggsecutable = bbicon:main',
],
'gui_scripts': [
'buildboticon = bbicon:main',
]
},
setup_requires=[
'setuptools_hg',
],
tests_require=[
'unittest2 >= 0.5',
'mock >= 0.7.0b4',
],
install_requires=[
'pyyaml >= 0.3',
# 'pyqt >= 4.7' # PyQt doesn't have anything useful on PyPi :(
],
extras_require={
'speech': ['pyspeech >= 1.0'],
# 'phidgets': ['PhidgetsPython >= 2.1.7'],
},
此处的完整文件:为什么不在安装程序中使用install\u requires。py???使用install\u requires配置第三方依赖项parameter@CRUSADER:是的。我加了一个例子。但是很难找到好的文档。当我尝试在OS X上的Python 2.7.2中导入setuptools时(我假设是一个干净的安装),它工作得很顺利。。。苹果是否将setuptools与Python捆绑在一起?