From b241713c0bd12bf01ee81cd8faca4e47dcbc5c97 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 20 Apr 2017 14:18:10 -0700 Subject: [PATCH] CI/CD: Support for automation (#42) To hook up to the new CI/CD system, the following changes were made: - Added/updated conda recipe - Every commit is now a version thanks to versioneer - Removed `install_requires` from `setup.py` (dependencies now handled by conda recipe) - Standardized travis configuration to use latest development builds of QIIME 2 Pair programmed with: @jairideout, @ebolyen, and @thermokarst --- .travis.yml | 29 +++++++++++++++-------------- ci/recipe/meta.yaml | 43 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 13 ++++--------- 3 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 ci/recipe/meta.yaml diff --git a/.travis.yml b/.travis.yml index 6e424b4..65801d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,25 @@ dist: trusty sudo: false language: python -env: - - PYTHON_VERSION=3.5 before_install: - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda3/bin:$PATH + - export MPLBACKEND='Agg' + - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + - export MINICONDA_PREFIX="$HOME/miniconda" + - bash miniconda.sh -b -p $MINICONDA_PREFIX + - export PATH="$MINICONDA_PREFIX/bin:$PATH" + - conda config --set always_yes yes + - conda update -q conda + - conda info -a + - git clone https://github.com/qiime2/q2lint ../q2lint install: - - conda create --yes -n test-env -c biocore python=$PYTHON_VERSION numpy scikit-bio pytest pytest-cov ipywidgets + - conda create -q -n test-env --file https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-conda-linux-64.txt - source activate test-env - - pip install https://github.com/qiime2/qiime2/archive/master.zip https://github.com/qiime2/q2-types/archive/master.zip https://github.com/qiime2/q2templates/archive/master.zip - - pip install flake8 coveralls - - pip install . - - 'echo "backend: Agg" > matplotlibrc' - - git clone https://github.com/qiime2/q2lint + - conda install -q pytest-cov + - pip install -q flake8 coveralls + - python setup.py install script: - - py.test --cov=q2_demux - flake8 - - python q2lint/q2lint.py + - python ../q2lint/q2lint.py + - py.test --cov=q2_demux after_success: - coveralls diff --git a/ci/recipe/meta.yaml b/ci/recipe/meta.yaml new file mode 100644 index 0000000..ac19803 --- /dev/null +++ b/ci/recipe/meta.yaml @@ -0,0 +1,43 @@ +{% set data = load_setup_py_data() %} +{% set version = data.get('version') or 'placehold' %} +{% set release = '.'.join(version.split('.')[:2]) %} + +package: + name: q2-demux + version: {{ version }} + +source: + path: ../.. +build: + script: python setup.py install + +requirements: + build: + - python 3.5* + - setuptools + + run: + - python 3.5* + - setuptools + - pandas + - numpy + - scikit-bio + - seaborn + - psutil + # `ipywidgets` included to avoid ShimWarning from + # `seaborn` imports: + # https://github.com/mwaskom/seaborn/issues/874 + - ipywidgets + - qiime2 {{ release }}.* + - q2templates {{ release }}.* + - q2-types {{ release }}.* + +test: + imports: + - q2_demux + - qiime2.plugins.demux + +about: + home: https://qiime2.org + license: BSD-3-Clause + license_family: BSD diff --git a/setup.py b/setup.py index 43b878f..3a030d2 100644 --- a/setup.py +++ b/setup.py @@ -16,13 +16,6 @@ version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), packages=find_packages(), - install_requires=['qiime2 == 2017.3.*', 'q2-types == 2017.3.*', - 'q2templates == 2017.3.*', 'numpy', 'pandas', - 'scikit-bio', 'seaborn', 'psutil', - # `ipywidgets` included to avoid ShimWarning from - # `seaborn` imports: - # https://github.com/mwaskom/seaborn/issues/874 - 'ipywidgets'], author="Greg Caporaso", author_email="gregcaporaso@gmail.com", url="https://qiime2.org", @@ -33,9 +26,11 @@ ["q2-demux=q2_demux.plugin_setup:plugin"] }, package_data={ - 'q2_demux.test': ['data/**/*'], + 'q2_demux.tests': ['data/bad/*', + 'data/emp_multiplexed/*', + 'data/emp_multiplexed_single_end/*'], 'q2_demux': ['_summarize/assets/*.html', '_summarize/assets/app/*.js'] }, - zip_safe=True, + zip_safe=False, )