2012-05-09 37 views

回答

1

每當PIP更新我的回購協議,它運行setup.py以「發展」作爲它的參數,所以我改變了我的setup.py是這樣的:

from distutils.core import setup 
from setuptools.command.develop import develop 
from subprocess import check_call 
from os import path 

class update_submodules(develop): 
    def run(self): 
     print 1 
     if path.exists('.git'): 
      check_call(['git', 'submodule', 'update', '--init', '--recursive']) 
     develop.run(self) 

a = setup(cmdclass = {"develop": update_submodules}, 
     ... 

這意味着運行「設置默認程序之前.py開發「運行」git子模塊更新--init - 遞歸「。