Skip to content

Commit

Permalink
Small fixes to get travis to pass...
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrokach committed Jun 27, 2016
1 parent d94441f commit bf23219
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 30 deletions.
13 changes: 3 additions & 10 deletions .travis.yml
Expand Up @@ -29,6 +29,7 @@ install:
- conda config --add channels conda-forge
- conda config --add channels omnia
- conda config --add channels bioconda
- conda config --add channels salilab
- conda info -a
# Install packages
- conda update -q conda
Expand All @@ -40,16 +41,8 @@ before_script:
- source activate _test
- conda install -q --yes fake_provean fake_foldx anaconda-client
script:
- |
if [[ $TEST_SUITE != 'test_unittests' ]] ; then
source "${SCRIPTS_DIR}/configure_tests.sh"
cd "${TEST_DIR}"
ls
travis_wait 119 "${SCRIPTS_DIR}/${TEST_SUITE}.sh"
else
py.test
"${SCRIPTS_DIR}/build-docs.sh"
fi
# Run tests
- travis_wait 119 "${SCRIPTS_DIR}/travis-ci.sh"
after_success:
- echo "Success!"
- pip install codecov
Expand Down
14 changes: 12 additions & 2 deletions devtools/conda-recipe/meta.yaml
Expand Up @@ -16,12 +16,22 @@ requirements:
- python
- pyyaml
- requests
- psutil
- retrying
- fastcache
# Scientific python
- numpy
- scipy
- pandas
- scikit-learn
- biopython
- libfaketime
- modeller
# Database access
- sqlalchemy
- sqlite
- mysqlclient
- psycopg2
run:
# Basic python
- python
Expand All @@ -36,6 +46,8 @@ requirements:
- pandas
- scikit-learn
- biopython
- libfaketime
- modeller
# Database access
- sqlalchemy
- sqlite
Expand All @@ -49,11 +61,9 @@ requirements:
- pops
- msms
- t_coffee
- modeller
- cd-hit
# - provean # can't install fake_provean for tests if this is installed...
# - foldx # private only and breaks readthedocs
- libfaketime

test:
requires:
Expand Down
6 changes: 2 additions & 4 deletions devtools/travis-ci/build-docs.sh
Expand Up @@ -11,11 +11,9 @@ cd "${TRAVIS_BUILD_DIR}/docs"
GITHUB_USERNAME=$(dirname $TRAVIS_REPO_SLUG)
GITHUB_REPONAME=$(basename $TRAVIS_REPO_SLUG)

# Install sphinx requirements
pip install -U pip
# Work around missing dependency in conda.
conda install sphinx
pip install auxlib
pip install -r requirements.txt
pip install sphinxcontrib-programoutput

# Build the documentation
mkdir -p _build_gh_pages
Expand Down
5 changes: 3 additions & 2 deletions devtools/travis-ci/configure_tests.sh
Expand Up @@ -18,7 +18,8 @@ fi

# Copy package data
mkdir -p "${TEST_DIR}"
rsync -av "${SRC_DIR}" "${TEST_DIR}" --exclude='[._]*'
rsync -av "${SRC_DIR}/tests/" "${TEST_DIR}" --exclude='[._]*'
ls ${TEST_DIR}


# Common directories
Expand All @@ -33,5 +34,5 @@ touch "${BLAST_DB_DIR}/pdbaa.pal"

# ====== Database ======
if [[ -z ${TEST_SUITE} || ${TEST_SUITE} == database* ]] ; then
${SCRIPTS_DIR}/configure_database.sh
source ${SCRIPTS_DIR}/configure_database.sh
fi
4 changes: 2 additions & 2 deletions devtools/travis-ci/test_database_pipeline_1.sh
Expand Up @@ -16,7 +16,7 @@ ARCHIVE_DIR="${TEST_DIR}/archive"
mkdir -p "${ARCHIVE_DIR}"

# Update the configuration file
cp -f "${SCRIPTS_DIR}/database_pipeline.ini" "${CONFIG_FILE}"
cp -f "${TEST_DIR}/database_pipeline.ini" "${CONFIG_FILE}"
sed -i "s|^pdb_dir = .*|pdb_dir = ${PDB_DIR}|" "${CONFIG_FILE}"
sed -i "s|^blast_db_dir = .*|blast_db_dir = ${BLAST_DB_DIR}|" "${CONFIG_FILE}"
sed -i "s|^archive_dir = .*|archive_dir = ${ARCHIVE_DIR}|" "${CONFIG_FILE}"
Expand All @@ -28,5 +28,5 @@ sed -i "s|^archive_type = .*|archive_type = directory|" "${CONFIG_FILE}"
7z -bd x "${TEST_DIR}/elaspic.kimlab.org/uniprot_domain_pair/uniprot_domain_pair.7z" -o"${ARCHIVE_DIR}"

# Run tests
py.test "${TEST_DIR}/tests/test_database_pipeline.py" -vsx --cache-clear --cov=elaspic \
py.test "${TEST_DIR}/test_database_pipeline.py" -vsx --cache-clear --cov=elaspic \
--config-file="${CONFIG_FILE}"
2 changes: 1 addition & 1 deletion devtools/travis-ci/test_database_pipeline_2.sh
Expand Up @@ -23,5 +23,5 @@ sed -i "s|^archive_dir = .*|archive_dir = ${ARCHIVE_DIR}|" "${CONFIG_FILE}"
sed -i "s|^archive_type = .*|archive_type = 7zip|" "${CONFIG_FILE}"

# Run tests
py.test "${TEST_DIR}/tests/test_database_pipeline.py" -vsx --cache-clear --cov=elaspic \
py.test "${TEST_DIR}/test_database_pipeline.py" -vsx --cache-clear --cov=elaspic \
--config-file="${CONFIG_FILE}"
21 changes: 21 additions & 0 deletions devtools/travis-ci/travis-ci.sh
@@ -0,0 +1,21 @@
#!/bin/bash

set -ev

# Sanity checks
if [[ -z ${TEST_SUITE} || \
-z ${SCRIPTS_DIR} || \
-z ${TEST_DIR} ]] ; then
echo 'Required environment variable not set!'
exit
fi

if [[ ${TEST_SUITE} = 'test_unittests' ]] ; then
py.test
"${SCRIPTS_DIR}/build-docs.sh"
else
source "${SCRIPTS_DIR}/configure_tests.sh"
cd "${TEST_DIR}"
ls
"${SCRIPTS_DIR}/${TEST_SUITE}.sh"
fi
12 changes: 6 additions & 6 deletions setup.cfg
@@ -1,16 +1,16 @@
[aliases]
test=pytest

[bumpversion]
files = conda/elaspic/meta.yaml setup.py
files = devtools/conda-recipe/meta.yaml setup.py docs/conf.py
commit = False
tag = True
message = "Release {new_version}"
current_version = 1.0.22

[aliases]
test = pytest

[pytest]
addopts = -sv --cov=elaspic
python_files = tests/test_helper.py tests/test_pep8.py
addopts = -sv --cov=elaspic --ignore=setup.py
python_files = tests/test_helper.py tests/test_pep8.py tests/test_structure_analysis.py

[flake8]
ignore = D100,D101,D102,D103,E402
Expand Down
4 changes: 2 additions & 2 deletions setup.py
@@ -1,5 +1,5 @@
import os.path as op
from setuptools import setup, find_packages, Command
from setuptools import setup, Command
import yaml


Expand Down Expand Up @@ -37,7 +37,7 @@ def finalize_options(self):
url=META.get('about', {}).get('home', ''),
author='kimlab',
author_email='alex.strokach@utoronto.ca',
packages=find_packages('elaspic'),
packages=['elaspic'],
package_data={'elaspic': ['data/*']},
long_description=read("README.md"),
entry_points={'console_scripts': META.get('build', {}).get('entry_points', '')},
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Expand Up @@ -8,7 +8,6 @@
TESTS_BASE_DIR = op.dirname(__file__)
except NameError:
TESTS_BASE_DIR = os.getcwd()
assert op.split(TESTS_BASE_DIR)[-1] == 'tests'

TESTS_DATA_DIR = op.join(TESTS_BASE_DIR, 'data')

Expand Down

0 comments on commit bf23219

Please sign in to comment.