Prepare a dedicated conda-build
environment:
$ conda create --name conda-bld conda-build
Download artifacts and run:
$ conda index .
While the recipe is meant to build automatically, the following instructions illustrate how to use this recipe to build conda
packages locally.
Clone the conda-recipes
repository and build the package for a given python
and numpy
version as:
$ cd path/to/conda-recipes
$ conda activate conda-bld
$ mkdir conda-bld
$ conda build ./cantera -m ./.ci_support/conda_build_config.yaml \
--no-anaconda-upload --python 3.9 --numpy 1.21
Towards the end od the build process, some instructions show the location of the package:
[...]
# To have conda build upload to anaconda.org automatically, use
# conda config --set anaconda_upload yes
anaconda upload \
/opt/conda/envs/conda-bld/conda-bld/linux-64/libcantera-3.0.0a2-h3fd9d12_0.tar.bz2 \
/opt/conda/envs/conda-bld/conda-bld/linux-64/libcantera-devel-3.0.0a2-h3fd9d12_0.tar.bz2 \
/opt/conda/envs/conda-bld/conda-bld/linux-64/cantera-3.0.0a2-py39h6cd0baa_0.tar.bz2
anaconda_upload is not set. Not uploading wheels: []
[...]
Note that in this case, the "channel" corresponds to /opt/conda/envs/conda-bld/conda-bld/
.
Deactivate the build environment:
$ conda deactivate
Create a bare environment
$ conda create --name ct-test
$ conda activate ct-test
Install the local package and test that everything works correctly:
$ conda install -c file:///opt/conda/envs/conda-bld/conda-bld/ cantera
$ python
[...]
>>> import cantera as ct
>>> ct.__version__
Note As an aside, the current conda environment can be summarized by
conda env export --from-history