问题
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
/ssdwhich 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_PATHis defined in your environment, use that - Otherwise, if a file named
~/.condarcexists, check ifconda-build/root-diris 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.
来源:https://stackoverflow.com/questions/39275241/using-a-different-conda-build-root-directory