【问题标题】:Why doesn't mr.developer install my package dependencies?为什么 mr.developer 不安装我的包依赖项?
【发布时间】:2012-05-10 14:43:37
【问题描述】:

我正在为一个项目使用带有 buildout 的 mr.developer,但它没有安装我的开发包 install_requires 中列出的鸡蛋。我做错了什么?

项目的 setup.py:

#!/usr/bin/env python

from setuptools import setup, find_packages
from os.path import join

# tests_require is not always available in setup(), so we implement it a couple ways.
tests_require = [
    'nosetests',
]
setup(
    name='tan.adapter',
    version=open(join('docs','VERSION.txt')).read(),
    long_description=open('README.txt').read() + '\n' + open(join('docs', 'HISTORY.txt')).read(),
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Environment :: Web Environment',
        'Framework :: Pylons',
        'License :: Other/Proprietary License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
    ],
    packages=find_packages(exclude=['ez_setup']),
    include_package_data=True,
    zip_safe=True,
    tests_require=tests_require,
    extras_require={'test': tests_require,},
    install_requires=[
        'avro',
        'celery',
        'jsonpath',
        'httplib2',
        'pyramid',
    ]
)

buildout.cfg:

[buildout]
eggs-directory = eggs
extensions =
    buildout.dumppickedversions
eggs =
parts =
    python-snappy
    celery
    mongodb

[celery]
recipe = collective.recipe.celery
broker-transport = amqplib
broker-host = localhost
result-backend = amqp
result-dburi = amqp://localhost

[mongodb]
recipe = rod.recipe.mongodb
base-url = http://downloads.mongodb.org
version = 2.0.4
darwin-32bit-url = ${mongodb:base-url}/osx/mongodb-osx-i386-${mongodb:version}.tgz
darwin-64bit-url = ${mongodb:base-url}/osx/mongodb-osx-x86_64-${mongodb:version}.tgz
linux2-32bit-url = ${mongodb:base-url}/linux/mongodb-linux-i686-${mongodb:version}.tgz
linux2-64bit-url = ${mongodb:base-url}/linux/mongodb-linux-x86_64-${mongodb:version}.tgz
logpath=${buildout:parts-directory}/mongodb/log
dbpath=${buildout:parts-directory}/mongodb/data
master=true
update=true

[snappy]
# Dependency for python-snappy
recipe = zc.recipe.cmmi
url = http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz

[python-snappy]
# Dependency for avro
recipe = zc.recipe.egg:custom
include-dirs = ${snappy:location}/include
library-dirs = ${snappy:location}/lib

develop.cfg:

[buildout]
extends = buildout.cfg
extensions +=
    mr.developer
sources = sources
auto-checkout = tan.adapter
parts +=
    tests

[sources]
tan.adapter = git /var/git/tan.adapter.git

[tests]
recipe = pbp.recipe.noserunner
eggs =
    ${buildout:eggs}
    coverage
    pbp.recipe.noserunner
    WebTest
working-directory = ${buildout:directory}/src/tan.adapter/tan/adapter

我曾想过,如果我运行bin/buildout -c develop.cfg,应该安装 avro、celery、jsonpath、httplib2 和 pyramid。如果我运行pip install path/to/tan.adapter,他们会安装。我必须怎么做才能让 mr.developer 和 buildout 自动安装依赖项?

【问题讨论】:

    标签: python dependencies buildout egg setup.py


    【解决方案1】:

    您的构建中的哪个部分实际使用了鸡蛋? tan.adapter 蛋实际上并没有包含在某个部分中,而该部分将引入依赖项。

    【讨论】:

    • 啊哈,出于某种原因,我认为包含在 mr.developer sources 中应该涵盖这一点。
    猜你喜欢
    • 2011-02-07
    • 2015-11-15
    • 1970-01-01
    • 2018-07-01
    • 2021-08-28
    • 2014-08-11
    • 2016-08-26
    • 2021-09-01
    • 2020-12-27
    相关资源
    最近更新 更多