本文介绍了使用不同的conda-build根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建自己的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:

  1. 如果您的环境中定义了CONDA_BLD_PATH,请使用它
  2. 否则,如果存在名为~/.condarc的文件,请检查是否定义了conda-build/root-dir.例如:
  1. If CONDA_BLD_PATH is defined in your environment, use that
  2. Otherwise, if a file named ~/.condarc exists, check if conda-build/root-dir is defined. For example:
   # .condarc
   conda-build:
     root-dir: /ssd/conda-bld
  1. 否则,请尝试$(conda info --root)/conda-bld
  2. 如果该位置不可写,请使用~/conda-bld
  1. Otherwise, try $(conda info --root)/conda-bld
  2. If that location isn't writable, use ~/conda-bld

(请参见源代码如果您好奇的话,请执行以下步骤.)

(See the source code for these steps if you're curious.)

您可以在meta.yamlsource部分中使用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根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 03:44