Skip to content

Commit

Permalink
Merge pull request #78 from kyleabeauchamp/travis
Browse files Browse the repository at this point in the history
[WIP] Simplify travis logic
  • Loading branch information
kyleabeauchamp committed Dec 9, 2014
2 parents ebabfff + 3ab253c commit 0a301b0
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 53 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
language: c

branches:
only:
- master

install:
- source devtools/ci/install.sh
- export PYTHONUNBUFFERED=true

script:
- export CC="gcc -std=c89"
- source deactivate
- conda install --yes conda-build
# this builds the binary, unpacks it, and runs the tests
- conda build devtools/conda-recipe
- source activate $python
- conda install $HOME/miniconda/conda-bld/linux-64/gaff2xml-dev-*
- conda list -e
- nosetests

env:
matrix:
Expand All @@ -26,5 +24,3 @@ env:
after_success:
- echo "after_success"
- source devtools/ci/after_sucess.sh


23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[![Build Status](https://travis-ci.org/choderalab/gaff2xml.svg)](https://travis-ci.org/choderalab/gaff2xml)
[![Code Health](https://landscape.io/github/choderalab/gaff2xml/master/landscape.svg)](https://landscape.io/github/choderalab/gaff2xml/master)

## gaff2xml: Converting Antechamber GAFF files to OpenMM XML format
## gaff2xml: Tools for Small Molecules, Antechamber, OpenMM, and More.

This set of tools allows users to automate the conversion of ligand
force field parameters from Antechamber formats to OpenMM XML format.
This set of tools allows users to automate the conversion of GAFF ligand
force field parameters from Antechamber formats to OpenMM XML format.
It also contains several python tools for working with small molecules,
packing boxes (python wrappers for packmol), and parameterizing small
molecules.

This tool is in BETA testing: use at your own risk!

Expand All @@ -13,7 +16,21 @@ Installation:

```
python setup.py install
or
conda config --add channels http://conda.binstar.org/omnia
conda config --add channels https://conda.binstar.org/rdkit
conda install gaff2xml
```

To test your installation, use the following command:

```
nosetests gaff2xml -v
```


Usage:

Expand Down
20 changes: 13 additions & 7 deletions devtools/ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
sudo apt-get update
sudo apt-get install -qq -y g++ gfortran csh
sudo apt-get install -qq -y g++-multilib gcc-multilib openbabel
wget http://repo.continuum.io/miniconda/Miniconda-3.6.0-Linux-x86_64.sh
bash Miniconda-3.6.0-Linux-x86_64.sh -b
MINICONDA=Miniconda-latest-Linux-x86_64.sh
MINICONDA_MD5=$(curl -s http://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget http://repo.continuum.io/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
echo "Miniconda MD5 mismatch"
exit 1
fi
bash $MINICONDA -b
PIP_ARGS="-U"

export PATH=$HOME/miniconda/bin:$PATH

sudo apt-get update
sudo apt-get install -qq -y g++ gfortran csh g++-multilib gcc-multilib openbabel

conda update --yes conda
conda config --add channels http://conda.binstar.org/omnia
conda config --add channels https://conda.binstar.org/ric
conda create --yes -n ${python} python=${python} --file devtools/ci/requirements-conda.txt
conda config --add channels https://conda.binstar.org/rdkit
source activate $python
conda install --yes conda-build
13 changes: 0 additions & 13 deletions devtools/ci/requirements-conda.txt

This file was deleted.

7 changes: 1 addition & 6 deletions devtools/conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/bin/bash

cp -r $RECIPE_DIR/../.. $SRC_DIR
$PYTHON setup.py clean
$PYTHON setup.py install

# Add more build steps here, if they are necessary.

# See
# http://docs.continuum.io/conda/build.html
# for a list of environment variables that are set during the build process.
44 changes: 32 additions & 12 deletions devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
package:
name: gaff2xml
version: !!str dev
name: gaff2xml-dev
version: !!str 3.0.0

#source:
# fn: master.zip
# url: https://github.com/choderalab/gaff2xml/archive/master.zip

build:
preserve_egg_dir: True
number: 0

requirements:
build:
- python
- cython
- setuptools
- mdtraj
- numpy
- scipy
- setuptools
- mdtraj-dev
- openmm
- ambermini

- pandas
- openmm
- ambermini
- jinja2
# - rdkit # rdkit is an optional dependency, may want to comment this out for the release version.
run:
- python
- setuptools
- pandas
- six
- mdtraj
- numpydoc
- scipy
- mdtraj-dev
- openmm
- ambermini
- openmm
- ambermini
- jinja2
# - rdkit # rdkit is an optional dependency, may want to comment this out for the release version.

test:
requires:
- nose
imports:
- gaff2xml
commands:
- nosetests gaff2xml -v

about:
home: https://github.com/choderalab/gaff2xml
license: GNU Lesser General Public License v2 or later (LGPLv2+)

18 changes: 16 additions & 2 deletions tests/test_drugs.py → gaff2xml/tests/test_drugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@
from gaff2xml import utils
import os

@skipIf(os.environ.get("TRAVIS", None) == 'true', "Skip testing of entire drug database on Travis.")
try:
oechem = utils.import_("openeye.oechem")
if not oechem.OEChemIsLicensed(): raise(ImportError("Need License for OEChem!"))
oequacpac = utils.import_("openeye.oequacpac")
if not oequacpac.OEQuacPacIsLicensed(): raise(ImportError("Need License for oequacpac!"))
oeiupac = utils.import_("openeye.oeiupac")
if not oeiupac.OEIUPACIsLicensed(): raise(ImportError("Need License for OEOmega!"))
oeomega = utils.import_("openeye.oeomega")
if not oeomega.OEOmegaIsLicensed(): raise(ImportError("Need License for OEOmega!"))
HAVE_OE = True
except:
HAVE_OE = False


@skipIf(not HAVE_OE, "Cannot run test_drugs() module without OpenEye tools.")
def test_drugs():
import openeye.oechem
database_filename = utils.get_data_filename("chemicals/drugs/Zdd.mol2.gz")
Expand All @@ -12,7 +26,7 @@ def test_drugs():
molecule_name, tripos_mol2_filename = utils.molecule_to_mol2(molecule)
yield utils.tag_description(lambda : utils.test_molecule(molecule_name, tripos_mol2_filename), "Testing drugs %s" % molecule_name)

@skipIf(os.environ.get("TRAVIS", None) == 'true', "Skip testing of entire drug database on Travis.")
@skipIf(not HAVE_OE, "Cannot test test_drug() without OpenEye tools.")
def test_drug():
import openeye.oechem
database_filename = utils.get_data_filename("chemicals/drugs/Zdd.mol2.gz")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
url='http://github.com/choderalab/gaff2xml',
platforms=['Linux', 'Mac OS-X', 'Unix'],
classifiers=CLASSIFIERS.splitlines(),
packages=["gaff2xml"],
packages=["gaff2xml", "gaff2xml.tests"],
zip_safe=False,
scripts=['scripts/generate_example_data.py', 'scripts/processAmberForceField.py'],
ext_modules=extensions,
Expand Down

0 comments on commit 0a301b0

Please sign in to comment.