我有一個setup.py
,看起來有點(好吧,精確地)是這樣的:的setuptools setup.py安裝時,依賴不滿意
#!/usr/bin/env python
from setuptools import setup
import subprocess
import distutils.command.build_py
class BuildWithMake(distutils.command.build_py.build_py):
"""
Build using make.
Then do the default build logic.
"""
def run(self):
# Call make.
subprocess.check_call(["make"])
# Keep installing the Python stuff
distutils.command.build_py.build_py.run(self)
setup(name="jobTree",
version="1.0",
description="Pipeline management software for clusters.",
author="Benedict Paten",
author_email="[email protected]",
url="http://hgwdev.cse.ucsc.edu/~benedict/code/jobTree.html",
packages=["jobTree", "jobTree.src", "jobTree.test", "jobTree.batchSystems",
"jobTree.scriptTree"],
package_dir= {"": ".."},
install_requires=["sonLib"],
# Hook the build command to also build with make
cmdclass={"build_py": BuildWithMake},
# Install all the executable scripts somewhere on the PATH
scripts=["bin/jobTreeKill", "bin/jobTreeStatus",
"bin/scriptTreeTest_Sort.py", "bin/jobTreeRun",
"bin/jobTreeTest_Dependencies.py", "bin/scriptTreeTest_Wrapper.py",
"bin/jobTreeStats", "bin/multijob", "bin/scriptTreeTest_Wrapper2.py"])
它安裝包時./setup.py install
運行完美的罰款。但是,無論是否安裝「sonLib」軟件包,都會執行此操作,而忽略依賴關係。
這是預期的行爲?如果沒有安裝依賴關係,setup.py install
應該愉快地繼續進行下去,把它留給點或什麼來預先安裝它們?如果沒有,並且setup.py install
在缺失依賴時應該失敗,我在做什麼錯了?
編輯:一些版本信息:
Python 2.7.2 (default, Jan 19 2012, 21:40:50)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'0.6c12'
>>>
我很確定'setuptools'實際上並不檢查依賴關係。你可能想用[distribute](http://pythonhosted.org/distribute/)來代替。 – murgatroid99
@ murgatroid99d - 發行版和setuptools已合併在一起。而setuptools通常會_does_安裝依賴關係。 – mata
運行'pip install setuptools -U'來獲得0.9版本,我認爲這個接受'install_requires'選項,就像分發一樣。 –