2011-01-29 2 views
1

저는 건물에있는 계란에 실제로 의존하는 여러 패키지를 가져 오려고했습니다. 이러한 계란 치즈 저장소에 없기 때문에, 내 setup.py 스크립트에서 내가 nstall_requires = ['pack1', 'pack2']을 사용할 수없는 나는, 그래서 난 내 buildout config (설정)에 다음과 같은 방법으로 추가하는 것을 시도하고있다 :buildout MercurialRecipe가 여러 가져 오기를 중단합니다.

1 [buildout] 
    2 develop = . 
    3 parts = 
    4  python 
    5  pack1 
    6  pack2 
    7 
    8 extra_paths = ${pack1:location}/src/ 
    9  ${pack2:location}/src/ 
10 
11 [python] 
12 recipe = zc.recipe.egg 
13 eggs = myegg 
14 extra-paths = 
15  ${buildout:extra_paths} 
16 
17 interpreter = python 
18 
19 [pack1] 
20 recipe = mercurialrecipe 
21 repository = https://repo.xxx.com/hg/pack1/ 
22 
23 [pack2] 
24 recipe = mercurialrecipe 
25 repository = https://repo.xxx.com/hg/pack2/ 

내가 일을 할 수 있습니다를 이것은 틀린 길이다 - 나는 단지 buildout로 시작하고있다. 내 빈/buildout를 실행하면 나는 다음과 같은 오류를 얻을 :

Updating python. 
Updating pack1. 
pack1: Pulling repository https://repo.xxx.com/hg/pack1/ and updating /home/martin/proj1/parts/pack1 
pulling from https://repo.xxx.com/hg/pack1/ 
searching for changes 
no changes found 
Installing pack2. 
pack2: Cloning repository https://repo.xxx.com/hg/pack2/ to /home/martin/proj1/parts/pack2 
While: 
    Installing pack2. 

    An internal error occurred due to a bug in either zc.buildout or in a 
    recipe being used: 
    Traceback (most recent call last): 
     File "/home/martin/proj1/eggs/zc.buildout-1.5.2-py2.6.egg/zc/buildout/buildout.py", line 1805, in main 
     getattr(buildout, command)(args) 
     File "/home/martin/proj1/eggs/zc.buildout-1.5.2-py2.6.egg/zc/buildout/buildout.py", line 584, in install 
     installed_files = self[part]._call(recipe.install) 
     File "/home/martin/proj1/eggs/zc.buildout-1.5.2-py2.6.egg/zc/buildout/buildout.py", line 1297, in _call 
     return f() 
     File "build/bdist.linux-x86_64/egg/mercurialrecipe/__init__.py", line 50, in install 
     commands.clone(ui.ui(), get_repository(self.source), self.destination) 
     File "build/bdist.linux-x86_64/egg/mercurialrecipe/__init__.py", line 18, in get_repository 
     return hg.repository(ui.ui(), location) 
     File "/usr/lib/python2.6/site-packages/mercurial-1.7.3-py2.6-linux-x86_64.egg/mercurial/hg.py", line 96, in repository 
     repo = _lookup(path).instance(ui, path, create) 
     File "/usr/lib/python2.6/site-packages/mercurial-1.7.3-py2.6-linux-x86_64.egg/mercurial/httprepo.py", line 203, in instance 
     return statichttprepo.instance(ui, "static-" + path, create) 
     File "/usr/lib/python2.6/site-packages/mercurial-1.7.3-py2.6-linux-x86_64.egg/mercurial/statichttprepo.py", line 146, in instance 
     return statichttprepository(ui, path[7:]) 

내가 팩 1 및 팩 2를 전환 할 경우, 팩 2가 설치됩니다. 기본적으로 둘 다 잘 작동하지만, 두 가지를 모두 가져 오면 곧 모든 것이 손상됩니다.

미리 감사드립니다. Martin

답변

3

빌드에서 외부 SCM 관리 종속성을 사용하려면 mr.developer으로 전환하는 것이 좋습니다. mr.developer를 사용하면 Mercurial 리포지토리, Git, Bazaar, Darcs, Subversion 및 CVS 리포지토리의 종속성 (알 또는 기타)을 가져올 수 있습니다. 이러한 의존성을 다른 파이썬 달걀이 setup.py에서 의존 할 수있는 개발 난으로 처리 할 수 ​​있습니다. 지금, mr.developer와

[sources] 
pack1 = hg https://repo.xxx.com/hg/pack1/ 
pack2 = hg https://repo.xxx.com/hg/pack2/ 

을 : 당신은 [sources] 섹션을 사용하여 자원에 대한 mr.developer에게

[buildout] 
extensions = mr.developer 

:

는 buildout 확장으로 추가, mr.developer을 사용하려면 이러한 저장소를 관리하는 명령 줄 도구를 얻습니다. 그것들을 확인하고, 업데이트하고, 가장 중요하게는 빌드 아웃을위한 개발 난으로 빌드 할 수 있습니다.

자동으로 같은 소스를 확인하고 개발 계란으로 내장되어의 [buildout] 섹션의 auto-checkout 옵션을 나열하려면 :

[buildout] 
extensions = mr.developer 
auto-checkout = 
    pack1 
    pack2 

당신은 지금 두 팩 1을 buildout 및 팩 2가 체크 아웃됩니다 실행하면 , 달걀로 지어졌으며 다른 곳에서 의존성으로 사용될 때 그 의존성을 채우기 위해 사용되었습니다. 따라서 'pack1'또는 'pack2'중 하나가 eggs 줄에 있거나 setup.py의 다른 달걀에 종속되어있는 경우 zc.buildout은 mr.developer에서 체크 아웃 한 버전을 선택합니다.

bin/developer 명령 줄 도구를 사용하면 이러한 옵션을 완벽하게 제어 할 수 있습니다. PyPI page for mr.developer을 읽어보십시오.

+0

Martjin에게 감사드립니다. 나는 mr.developer로 전환했고 그것은 매력처럼 작동합니다. setup.py에서 pack1을 의존성으로 나열하는 방법을 설명해 주시겠습니까? 치즈 샵에있는 계란에 대해서는 setup.py에 종속성을 나열했지만 다른 곳에있는 계란에는 의존하지 않습니다. 감사합니다. Martjin – Martin

+0

pack1이 egg 인 경우 이름이 정의 된 setup.py가 있습니다. 규약에 의하면 보통 setup.py가 위치한 디렉토리 이름과 동일하지만 주어진 것은 아닙니다. 'name = "somename"'을 찾으십시오. 그 이름은 계란의 이름입니다. PyPi에 저장된 계란과 같이 사용합니다 (일반적으로 요즘은 cheeseshop이라고하지 않습니다). –

관련 문제