From 50ec4967eb308212469beb91918f2063270d5b0a Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Tue, 12 Jan 2016 05:42:58 +0000 Subject: [PATCH] Added travis testing. --- .travis.yml | 37 ++++++++++++++++ README.md | 2 + conda_smithy.recipe/meta.yaml | 1 - .../tests/test_configure_feedstock.py | 42 ------------------- requirements.txt | 13 +++++- 5 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 .travis.yml delete mode 100644 conda_smithy/tests/test_configure_feedstock.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..82c8e4442 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +# The language in this case has no bearing - we are going to be making use of conda for a +# python distribution for the scientific python stack. +language: python + +sudo: false + +env: + global: + - CONDA_INSTALL_LOCN="${HOME}/conda" + + matrix: + - PYTHON=2.7 + # - PYTHON=3.5 (requires ruamel.yaml to exist for py35) + +install: + - mkdir -p ${HOME}/cache/pkgs + - "[ ! -f ${HOME}/cache/miniconda.sh ] && wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ${HOME}/cache/miniconda.sh || :" + - bash ${HOME}/cache/miniconda.sh -b -p ${CONDA_INSTALL_LOCN} && export PATH=${CONDA_INSTALL_LOCN}/bin:$PATH + + # Re-use the pacakges in the cache, and download any new ones into that location. + - rm -rf ${CONDA_INSTALL_LOCN}/pkgs && ln -s ${HOME}/cache/pkgs ${CONDA_INSTALL_LOCN}/pkgs + + # Now do the things we need to do to install it. + - conda install --file requirements.txt nose python=${PYTHON} --yes --quiet -c conda-forge + - python setup.py install + +script: + - nosetests conda_smithy + + +# We store the files that are downloaded from continuum.io, but not the environments that are created. +cache: + directories: + - $HOME/cache +before_cache: + # Remove all untarred directories. + - find $CONDA_INSTALL_LOCN/pkgs/ -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; diff --git a/README.md b/README.md index df2bb9b3e..e8f4afbd4 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Overview + Register the repo on github and push it. + Connect the repo to the CI services travis-ci.org, appveyor.com, circleci.com +[![Build Status](https://travis-ci.org/conda-forge/conda-smithy.svg)](https://travis-ci.org/conda-forge/conda-smithy) + Installation ------------ diff --git a/conda_smithy.recipe/meta.yaml b/conda_smithy.recipe/meta.yaml index 45cf18f40..40d89f0af 100644 --- a/conda_smithy.recipe/meta.yaml +++ b/conda_smithy.recipe/meta.yaml @@ -23,7 +23,6 @@ requirements: - gitpython - pygithub <2 - ruamel.yaml - - ruamel.ordereddict test: commands: diff --git a/conda_smithy/tests/test_configure_feedstock.py b/conda_smithy/tests/test_configure_feedstock.py deleted file mode 100644 index 4fc32e60d..000000000 --- a/conda_smithy/tests/test_configure_feedstock.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import print_function -import unittest -import configure_feedstock -from conda_build.metadata import MetaData - - -class Test_compute_build_matrix(unittest.TestCase): - def setUp(self): - self.meta = MetaData.fromdict({'package': {'name': 'test_pkg'}, - 'requirements': {'build': []}}) - - def setdefault(self, field, value, default=None): - section, key = field.split('/') - return self.meta.get_section(section).setdefault(key, default) - - def add_requirements(self, *args): - for arg in args: - self.setdefault('requirements/build', []).append(arg) - - def test_numpy_no_python(self): - self.add_requirements('numpy') - r = configure_feedstock.compute_build_matrix(self.meta) - print(r) - - def test_min_numpy(self): - self.add_requirements('numpy >18', 'python') - r = configure_feedstock.compute_build_matrix(self.meta) - print(r) - - def test_py2(self): - self.add_requirements('python 2.7') - matrix = configure_feedstock.compute_build_matrix(self.meta) - self.assertEqual(matrix, [(('python', '2.7'),)]) - - def test_py3(self): - self.add_requirements('python >=3') - matrix = configure_feedstock.compute_build_matrix(self.meta) - self.assertEqual(matrix, [(('python', '3.4'),)]) - - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a701f784a..13cc28cf9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,12 @@ -# Please see conda_smithy.recipe/meta.yaml for the canonical runtime requirements. +# This list is duplicated in the conda_smithy.recipe/meta.yaml. + +conda-build-all +setuptools +conda +conda-build +jinja2 +requests +pycrypto +gitpython +pygithub <2 +ruamel.yaml