|
| 1 | +# CI for conda package release |
1 | 2 |
|
2 | | -#### Building conda package |
| 3 | +https://github.com/slaclab/ruckus/blob/main/.github/workflows/conda_build_lib.yml |
3 | 4 |
|
4 | | -```` |
5 | | -$ conda build --debug conda-recipe --output-folder bld-dir -c conda-forge -c pydm-tag |
6 | | -$ conda activate |
7 | | -$ miniforge upload bld-dir/linux-64/rogue-..... |
8 | | -```` |
| 5 | + |
| 6 | +# How to build rogue .conda package file and test it locally |
| 7 | + |
| 8 | +1) Install and configure conda build tool |
| 9 | + |
| 10 | +```bash |
| 11 | +cd ${HOME} |
| 12 | +wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh |
| 13 | +bash Miniforge3-Linux-x86_64.sh -b -p ${HOME}/miniforge3 |
| 14 | +export PATH="${HOME}/miniforge3/bin:$PATH" |
| 15 | +source ${HOME}/miniforge3/etc/profile.d/conda.sh |
| 16 | +conda config --set always_yes yes |
| 17 | +conda config --set channel_priority strict |
| 18 | +conda install -n base conda-libmamba-solver |
| 19 | +conda config --set solver libmamba |
| 20 | +conda install conda-build anaconda-client |
| 21 | +conda update -q conda conda-build |
| 22 | +conda update --all |
| 23 | +``` |
| 24 | + |
| 25 | +2) Build the .conda package |
| 26 | + |
| 27 | +```bash |
| 28 | +# Setup conda env |
| 29 | +source ${HOME}/miniforge3/etc/profile.d/conda.sh |
| 30 | + |
| 31 | +# Add conda toolchain's bin to $PATH |
| 32 | +export PATH="${HOME}/miniforge3/bin:$PATH" |
| 33 | + |
| 34 | +# Go to rogue clone dir |
| 35 | +cd rogue |
| 36 | + |
| 37 | +# Build the .conda file |
| 38 | +conda build conda-recipe --output-folder bld-dir -c tidair-tag -c conda-forge |
| 39 | +``` |
| 40 | + |
| 41 | +3) Test the .conda package locally |
| 42 | + |
| 43 | +```bash |
| 44 | +# Setup conda env |
| 45 | +source ${HOME}/miniforge3/etc/profile.d/conda.sh |
| 46 | + |
| 47 | +# Go to rogue clone dir |
| 48 | +cd rogue |
| 49 | + |
| 50 | +# Index your folder |
| 51 | +conda index $PWD/bld-dir |
| 52 | + |
| 53 | +# Create environment using the package name, not the file path |
| 54 | +conda create -n test-rogue -c file:///$PWD/bld-dir -c conda-forge rogue |
| 55 | + |
| 56 | +# Test env |
| 57 | +conda activate test-rogue |
| 58 | +python -c "import pyrogue; print(pyrogue.__version__)" |
| 59 | +``` |
0 commit comments