Commit fce880f4 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

ENH: Section on building packages for a project and its dependencies

parent 34719a21
......@@ -36,7 +36,7 @@ export FSLCONDA_REPOSITORY=$(pwd)/avwutils
```
> Note: It is not currently possible to build a conda package from a local copy of a project which is *not* a git repository. This functionality may be added in the future if it is deemed necessary.
> Note: It is not currently possible to build a conda package from a local copy of a project which is *not* a git repository, nor from a dirty working tree (i.e. the changes you want to build must be committed). This functionality may be added in the future if it is deemed necessary.
## Step 3: Choose the revision you want to build (optional)
......@@ -73,3 +73,54 @@ conda build \
```
If the build succeeds, the built package will be saved to the `dist` directory - binary packages will be saved in either the `osx-64` or `linux-64` sub-directories, and platform-independent (e.g. python) packages will be saved in the `noarch` sub-directory.
## Building multiple FSL conda packages locally
The need may arise to build conda packages for multiple FSL projects at once. For example, you might be making changes to one project which depends on changes you have made to another project (a dependency of the first project). In this case it makes sense to set up a local conda channel, and to build/install the dependencies into that channel.
Let's say we are working on the `randomise` project, and are simultaneously making changes to the `newimage` project. We will need local clones of all the project and recipe repositories:
```bash
git clone https://git.fmrib.ox.ac.uk/fsl/randomise.git
git clone https://git.fmrib.ox.ac.uk/fsl/newimage.git
git clone https://git.fmrib.ox.ac.uk/fsl/conda/fsl-randomise.git
git clone https://git.fmrib.ox.ac.uk/fsl/conda/fsl-newimage.git
```
Before we can build a conda package for `randomise`, we need to build a conda package from our local development version of `newimage`. We use `FSLCONDA_REPOSITORY` and `FSLCONDA_REVISION` to direct the build to use our local `newimage` repository, and direct the build to `my_local_conda_channel`, which we will use later.
```bash
mkdir my_local_conda_channel
export FSLCONDA_REPOSITORY=$(pwd)/newimage
export FSLCONDA_REVISION=enh/my_local_newimage_development_branch
conda build \
-c conda-forge \
-c defaults \
-c <fsl-conda-channel-url> \
--output-folder=my_local_conda_channel \
fsl-newimage
```
Now we can build our development version of `randomise`, using the development conda package we just built for `newimage`, simply by adding our local channel directory as a conda channel:
```bash
export FSLCONDA_REPOSITORY=$(pwd)/randomise
export FSLCONDA_REVISION=enh/my_local_randomimse_development_branch
conda build \
-c conda-forge \
-c defaults \
-c file://$(pwd)/my_local_conda_channel \
-c <fsl-conda-channel-url> \
--output-folder=my_local_conda_channel \
fsl-randomise
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment