using a different conda-build root directory

老子叫甜甜 提交于 2019-12-12 11:12:35

问题


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?


回答1:


I would like it to checkout in /ssd which is going to be faster. How can I specify it?

conda-build chooses a root directory for all of its work in the following way:

  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. 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.)

Also, how can I specify git depth when doing a clone?

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

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.



来源:https://stackoverflow.com/questions/39275241/using-a-different-conda-build-root-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!