Skip to content

Commit

Permalink
CI/CD: Support for automation (#113)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jairideout committed Apr 20, 2017
1 parent e37a040 commit 4cecb13
Show file tree
Hide file tree
Showing 11 changed files with 2,378 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ branch = True
omit =
*/tests*
*/__init__.py
q2_types/_version.py
versioneer.py

[report]
omit =
*/tests*
*/__init__.py
q2_types/_version.py
versioneer.py
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
q2_types/_version.py export-subst
25 changes: 7 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +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
- 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 conda
- conda install conda-build
- conda update -q conda
- conda info -a
- git clone https://github.com/qiime2/q2lint ../q2lint
- git clone https://github.com/qiime2/qiime2 ../qiime2
install:
- conda create -n test-env
- 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
# Install testing utils
- pip install flake8 coveralls
- conda install pytest-cov
# Install qiime2 environment
- conda env update -f ../qiime2/ci/environment.yaml
- cd ../qiime2 && python setup.py install && cd -
# Install q2-types environment
- conda env update -f ci/environment.yaml
- conda install -q pytest-cov
- pip install -q flake8 coveralls
- python setup.py install
- 'echo "backend: Agg" > matplotlibrc'
script:
- flake8
- python ../q2lint/q2lint.py
- py.test --cov=q2_types
- conda build -c qiime2 -c defaults --override-channels --python $PYTHON_VERSION --output-folder ../built-deps ../qiime2/ci/recipe
- conda build -c ../built-deps -c qiime2 -c biocore -c defaults --override-channels --python $PYTHON_VERSION ci/recipe
after_success:
- coveralls
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include q2_types/_version.py
14 changes: 0 additions & 14 deletions ci/environment.yaml

This file was deleted.

17 changes: 7 additions & 10 deletions ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
{% set data = load_setup_py_data() %}
{% set version = data.get('version') or 'placehold' %}
{% set release = '.'.join(version.split('.')[:2]) %}

package:
name: q2-types
version: "2017.3.0.dev0"
version: {{ version }}

source:
path: ../..
build:
noarch: python
script: python setup.py install

requirements:
build:
- python 3.5*
- setuptools
- scikit-bio
- qiime2 2017.3.*
- pandas
- biom-format
- ijson
- h5py

run:
- python 3.5*
- setuptools
- scikit-bio
- qiime2 2017.3.*
- pandas
- biom-format
- biom-format >=2.1.5,<2.2.0
- ijson
- h5py
- qiime2 {{ release }}.*

test:
imports:
Expand Down
5 changes: 3 additions & 2 deletions q2_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
# ----------------------------------------------------------------------------

import importlib
import pkg_resources

__version__ = pkg_resources.get_distribution('q2-types').version
from ._version import get_versions

__version__ = get_versions()['version']
del get_versions

importlib.import_module('q2_types.feature_table')
importlib.import_module('q2_types.distance_matrix')
Expand Down
Loading

0 comments on commit 4cecb13

Please sign in to comment.