问题描述
我正在创建自己的conda食谱,并使用git进行结帐.仓库是几场演出.我希望它不在~/conda-bld
中进行检出,而是希望在/ssd
中进行检出,这样会更快.如何指定?另外,在进行克隆时如何指定git depth?
I am creating my own conda recipe which I checkout with git. The repository is few gigs. Instead of doing a checkout in ~/conda-bld
, I would like it to checkout in /ssd
, which is going to be faster. How can I specify it?Also, how can I specify git depth when doing a clone?
推荐答案
conda-build
通过以下方式为其所有工作选择一个根目录:
conda-build
chooses a root directory for all of its work in the following way:
- 如果您的环境中定义了
CONDA_BLD_PATH
,请使用它 - 否则,如果存在名为
~/.condarc
的文件,请检查是否定义了conda-build/root-dir
.例如:
- If
CONDA_BLD_PATH
is defined in your environment, use that - Otherwise, if a file named
~/.condarc
exists, check ifconda-build/root-dir
is defined. For example:
# .condarc
conda-build:
root-dir: /ssd/conda-bld
- 否则,请尝试
$(conda info --root)/conda-bld
- 如果该位置不可写,请使用
~/conda-bld
- Otherwise, try
$(conda info --root)/conda-bld
- If that location isn't writable, use
~/conda-bld
(请参见源代码如果您好奇的话,请执行以下步骤.)
(See the source code for these steps if you're curious.)
您可以在meta.yaml
的source
部分中使用git_depth
:
You can use git_depth
in the source
section of meta.yaml
:
# meta.yaml
package:
name: foo
version: '1.0'
source:
git_url: https://github.com/foo/bar
git_depth: 1
注意:我不建议使用git_depth
.如果您还指定了git_tag
,它将无法正常工作-如果在HEAD
的N次提交(对于git_depth: N
)中该标记不可见,则您的检出将失败.
Note: I do not recommend using git_depth
. It won't work well if you also specify a git_tag
-- If the tag is not visible within N commits (for git_depth: N
) of the HEAD
, then your checkout will fail.
这篇关于使用不同的conda-build根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!