| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
In this tutorial, you will learn how to use VersionClimber when packages comes from multiple languages (e.g.C++ and Python). In our case, this repository aims at testing Phenomenal, a package built to process biological image data and extract 3D structural information to infer genotype to phenotype relationship.
A Python library, named Phenomenal, has been developed and depends on a set of widely used libraries for scientific visualisation and image processing such as VTK and OpenCV. While these libraries have Python interfaces, they are implemented in C++ for efficiency. However, they are know to be difficult to install due to binary conflicts between lots of dependencies.
Moreover, in this example, we rely on some code that is not available on any public conda channel. For each configuration, we will then rebuild the local packages. Then, to test the status of each configuraion, rather than executing a notebook, we will run the full test suite.
Phenomenal depends on Python packages such as Python, NumPy, SciPy, MatPlotLib, NetworkX, Pandas, Scikit-Learn and Scikit-Image. It depends also on utilities such as nose, coverage or openalea.deploy. As noted above, it also depends on more complex scientific packages such as OpenCV and VTK.
You should already have installed Miniconda or Anaconda.
Create an new conda environment:
conda create -n vclimber -c versionclimber versionclimber -yand then activate this environment:
conda activate vclimberOn Linux, libGL.so is needed by OpenCV. If you want to run VersionClimber on the cloud, install libGL.so using (on Ubuntu):
sudo apt-get install libgl1-mesa-glxNow, to run VersionClimber, just type ::
vclimb -aTo obtain the documentation, just type:
vclimb -hIf you want to show the list of available versions for each package, run:
vclimb -vaTo reproduce an execution by using VersionClimber, you will create a directory containing a file and a directory. This current directory contains:
VersionClimber uses the declarative configuration file to indicate which packages have to be tested and how.
In this section you are going to define a configuration file config.yaml that uses 16 conda packages with different levels of complexity. Some are pure Python, while others are C/C++ packages with potential binary compatibility problems.
It is divided into four sections, namely pre, packages, run, and post:
The packages section list the different packages that will be tested by the run command:
This is the script (usually) after run: in that file. In our example, nosetests -w .vclimb/openalea.phenomenal/test
Conda recipes of major packages can be found on different repository, such as conda-recipes. In this example, we depends on two packages: openalea.deploy and openalea.phenomenal.
VersionClimber needs modified conda recipes to build all the packages together locally from different versions of git source code. All the modified recipes are located in the recipes directory.
First, we get the openalea.deploy recipe from its git repository.
The meta.yaml file is copied into a template file (named meta.yaml.tpl) and is modified as follow:
# REMOVE THESE LINES
# {% set version = "2.1.7" %}
package:
name: openalea.deploy
# REPLACE
# version: {{ version }}
# BY VERSIONCLIMBER template flag
version : "$version"
source:
# REPLACE
# path: ..
# BY new VERSIONCLIMBER deploy location
path: ../../.vclimb/openalea.deploy
build:
preserve_egg_dir: True
number: 0
script: python setup.py install
requirements:
build:
- python {{PY_VER}}* [not win]
- python {{PY_VER}} [win]
- setuptools
- pywin32 # [win]
- six
run:
- python {{PY_VER}}* [not win]
- python {{PY_VER}} [win]
- setuptools
- pywin32 # [win]
- six
- path.py
# REMOVE ALL THE TEST SECTION
# test:
# imports:
# - openalea.deploy
...The package, the source, and the test sections are modified:
The Phenomenal recipe is retrieved from its github repository.
We simplify it by changing the version, the source path and removing the tests. The meta.yaml.tpl looks like :
package:
name: openalea.phenomenal
# REPLACE
# version: {{ version }}
# BY VERSIONCLIMBER template flag
version : "$version"
source:
# REPLACE
# path: ..
# BY new VERSIONCLIMBER phenomenal location
path: ../../.vclimb/openalea.phenomenal
# COMMENT THE TEST SECTION
# test:
...| Back | FazBrowse Home | New Git URL |