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?
Asked
Active
Viewed 4,024 times
6

Stuart Berg
- 17,026
- 12
- 67
- 99

NinjaGaiden
- 3,046
- 6
- 28
- 49
1 Answers
7
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:
- 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
- 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.)
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.

Stuart Berg
- 17,026
- 12
- 67
- 99
-
git_depth doesn't seem to be a valid argument. Error: in section u'source': unknown key u'git_depth' – NinjaGaiden Sep 01 '16 at 17:38
-
1I'm not able to reproduce that error. I tried conda-build 1.21.6 and (py2) conda-build 2.0.0 (py2 and py3). What version of conda-build are you using? (`conda build --version`) – Stuart Berg Sep 01 '16 at 18:08