开发者

How to manage dependency when cloning repository?

I am using mercurial and I am wondering how to do the following. Here is my repository architecture :

./repo/utils/workers/[...]
./repo/utils/tools/[...]
./repo/proj1/file.py

Let's say that in proj1/file.py I need to import some code located in workers and tools. eg

from utils.workers import foo
from utils.tools import bar

What would be the best way/tool to check out proj1 with all the needed dependencies (eg, workers/ and tools/) without having to clone utils/workers and utils/tools inside of proj1.

Also - doing a sys.path.append(repo/utils/workers) is not a option.

== Edit 01/24/11 ==

Thanks for all the answers. I've been thinking of a way to really explain my problem differently, and it seams that we should make abstraction of hg for a better understanding. Let's say that开发者_Python百科 in /utils/ there also are another few modules in there, that do not belong to my project, but that are actually needed. For example: http://code.google.com/p/python-gflags/ When checking out /repo/proj1/ I want all the dependencies, not matter which repository they're form, to be checked out too - but with read-only since.

So if I do hg clone /proj1/ I want this action to also clone all the needed modules from /utils/workers/, /utils/tools/, and python-gflags under /utils/python-gflags

I hope this helps a little bit to clarify what I am trying to do.

Cheers,

Martin


You should look at subrepositories (which also called nested)


The best solution I've found to to this, is by using buildout.

http://www.buildout.org

It is a really helpful solution to manage dependencies.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜