Skip to content

Commit

Permalink
CI: skip nwchem tests in OSX & rework chimera install
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Mar 13, 2018
1 parent c4020bc commit 594ac6c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
29 changes: 20 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ cache:
directories:
- $HOME/download
- $HOME/miniconda
- $HOME/chimera

before_cache:
- if ! [[ $TRAVIS_TAG ]]; then rm -rf $HOME/miniconda/conda-bld; fi
- if [[ ! $TRAVIS_TAG ]]; then rm -rf $HOME/miniconda/conda-bld; fi
- rm -rf $HOME/pychimera $HOME/miniconda/locks $HOME/miniconda/pkgs $HOME/miniconda/var $HOME/miniconda/conda-meta/history
- conda remove --force gaudi
- rm $HOME/.nwchemrc || true
Expand All @@ -54,8 +55,8 @@ before_install:
bash $HOME/download/miniconda.sh -b -p $HOME/miniconda;
fi
# Configure conda and get a few essentials
- source $HOME/miniconda/bin/activate
- hash -r
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda activate
- conda config --set always_yes yes
- conda config --remove-key channels || true
- conda config --add channels conda-forge
Expand All @@ -69,13 +70,22 @@ before_install:
# Show conda info for debugging
- conda info -a
# Get Chimera
- git clone https://github.com/insilichem/pychimera.git $HOME/pychimera;
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [[ ! -e $HOME/miniconda/bin/chimera ]]; then
conda build -q $HOME/pychimera/conda-recipes/ucsf-chimera-headless;
conda install -y -c $HOME/miniconda/conda-bld ucsf-chimera-headless;
ln -s $HOME/miniconda/bin/chimera-headless $HOME/miniconda/bin/chimera || true;
if [[ ! -e $HOME/chimera/bin/chimera ]]; then
_file="chimera-1.12-linux_x86_64.bin";
_filepath="linux_x86_64/${_file}";
_downloader="https://www.rbvi.ucsf.edu/chimera/cgi-bin/secure/chimera-get.py";
_download=`curl -s -F file="${_filepath}" -F choice=Accept "${_downloader}" | grep href | sed -E 's/.*href="(.*)">/\1/'`;
curl "https://www.rbvi.ucsf.edu""${_download}" -o "${_file}";
chmod +x "${_file}";
mkdir -p "$HOME/chimera";
echo "$HOME/chimera" | "./${_file}";
ln -s $HOME/chimera/bin/chimera $HOME/miniconda/bin/chimera || true;
rm -rf $HOME/chimera/lib/python2.7/site-packages/{AutoDockTools,MolKit,PyBabel,mglutil,mmLib,mslib};
rm -rf $HOME/chimera/lib/python2.7/site-packages/setuptools*;
pip install -U setuptools numpy=1.11 -t $HOME/chimera/lib/python2.7/site-packages;
fi;
export CHIMERADIR="$HOME/chimera";
else
if [[ ! -e $HOME/chimera/Chimera.app/Contents/Resources/bin/chimera ]]; then
set +x;
Expand All @@ -92,8 +102,9 @@ before_install:
curl "https://www.rbvi.ucsf.edu""${_download}" -o "${_file}";
hdiutil convert "${_file}" -format UDRW -o chimerarw;
hdiutil attach -mountpoint "$HOME/chimera" chimerarw.dmg;
rm -rf $HOME/chimera/Chimera.app/Contents/Resources/lib/python2.7/site-packages/{AutoDockTools,MolKit,PyBabel,mglutil,mmLib,mslib};
rm -rf $HOME/chimera/Chimera.app/Contents/Resources/lib/python2.7/site-packages/setuptools*;
pip install -U setuptools -t $HOME/chimera/Chimera.app/Contents/Resources/lib/python2.7/site-packages;
pip install -U setuptools numpy=1.11 -t $HOME/chimera/Chimera.app/Contents/Resources/lib/python2.7/site-packages;
fi;
export CHIMERADIR="$HOME/chimera/Chimera.app/Contents/Resources";
fi
Expand Down
7 changes: 6 additions & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ about:
summary: Genetic Algorithms with Unrestricted Descriptors for Intuitive Molecular Modeling

source:
{% if environ.get('TRAVIS') %}
git_url: ../
{% else %}
git_url: https://github.com/insilichem/gaudi.git
{% endif %}
git_tag: {{ environ.get('GIT_DESCRIBE_TAG', '') }}

requirements:
Expand All @@ -31,7 +35,8 @@ requirements:
- imp
- autodock-vina
- autodocktools-prepare
- nwchem
- nwchem # [linux]

test:
imports:
- gaudi
Expand Down
4 changes: 3 additions & 1 deletion tests/test_objectives_nwchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
import sys
import pytest
from conftest import datapath, expressed
from gaudi.objectives.nwchem import NWChem
from gaudi.genes.molecule import Molecule
from gaudi.objectives.nwchem import NWChem


@pytest.mark.skipif(sys.platform != 'linux2',
reason='NWChem conda package only available in Linux')
@pytest.mark.parametrize("ligand, energy", [
('butane.pdb', -156.87859414774),
])
Expand Down

0 comments on commit 594ac6c

Please sign in to comment.