conda config --add channels agoodman
Now you can perform any of the above commands without needing to specify '-c agoodman'.
To upload your packages to the main OCW channel, you will need to obtain a secure token which you may request by sending an email to the dev mailing list (firstname.lastname@example.org). If approved, you may update your config with:
conda config --add channels https://conda.anaconda.org/t/<TOKEN>/agoodman
Where <TOKEN> is the token string.
Updating and Building the OCW conda package
Edit the recipe configuration file
The main recipes for the OCW package (and the non-default conda dependencies) can be found in the OCW codebase. Navigate to the conda_recipes directory:
Each subdirectory contains the recipes specific to each package, and these too will be necessary to edit, rebuild, and upload to the OCW channel if we wish to keep everything up to date. For now though we will focus our example workflow on how to update the main ocw package itself. Our hypothetical case will involve creating a package for version 1.1.0. Open ocw/meta.yaml and edit the following entries:
# Under package:
# Under source:
Here of course the version numbers could be set to whatever release you want. If you wish to just test your build for the latest code from the git repo rather than a stable release, leave git_rev commented out. If Alternatively, if you are testing changes you have made locally, you may comment out the the git_url and use:
# Under source:
Where path is the location of the climate directory in your local filesystem. If needed, you should also add any new dependencies under the run section.
Build and test the package
You should now save your changes and prepare to build the package. If you do not already have it installed, you will first need to obtain the latest version of conda build:
conda update conda
conda install conda-build
To build the package, being sure you are in the conda_recipes directory, use:
conda build ocw
If successful, your newly built package will be found in a tarball located in your conda environment's <conda_environment>/conda-bld/<platform> directory. For an anaconda user's default environment on Mac OSX, this would be located in ~/anaconda/conda-bld/osx-64.
Before proceeding, you should (preferably in a clean environment) install and test your newly built package locally:
conda clean -pt
conda install --use-local ocw
If everything checks out, you are finally ready to move on to the next step.
Uploading packages to the OCW conda channel
Convert the package to other platforms
Having successfully built a package on your system, you should first add versions for all available platforms. The Mac OSX anaconda user in our example would do this with:
conda convert --platform all ~/anaconda/conda-bld/osx-64/ocw-1.1.0-py27_0.tar.bz2 -o ~/anaconda/conda-bld
The directory structure here should be altered for the name of your base conda directory, OS platform and package tarball, of course.
Uploading your package
Additional information on the anaconda cloud can be found here.
To begin uploading your packages, create an account for the anaconda cloud if you have not already done so. You will also need to install the anaconda client:
conda install anaconda-client
Then log in with your account info:
Finally to upload our OSX package as per our example, use:
anaconda upload -u agoodman ~/anaconda/conda-bld/osx-64/ocw-1.1.0-py27_0.tar.bz2
Where again the location should point to your desired package tarball and platform. You should repeat this process for each platform.
Sharing your updated recipe files
Changes to the recipe files should be committed to our git repo with each release, especially if dependencies are changed.