Skip to content

Commit

Permalink
CI/CD: Support for automation (#35)
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
ebolyen authored Apr 20, 2017
1 parent ff89918 commit ec1549b
Show file tree
Hide file tree
Showing 10 changed files with 2,419 additions and 29 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_composition/_version.py
versioneer.py

[report]
omit =
*/tests*
*/__init__.py
q2_composition/_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_composition/_version.py export-subst
38 changes: 16 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
# Travis yml file inspired by scikit-bio
# Check on http://lint.travis-ci.org/ after modifying it!
dist: trusty
sudo: false
language: python
env:
- PYVERSION=3.5 USE_CYTHON=TRUE
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- 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
# Update conda itself
- conda update --yes conda
# Useful for debugging any issues with conda
- 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 python=$PYVERSION --file ci/conda_requirements.txt -c biocore
- conda install --yes -n test_env cython pytest pytest-cov
- source activate test_env
- pip install https://github.com/qiime2/qiime2/archive/master.zip https://github.com/qiime2/q2-types/archive/master.zip
- pip install flake8 coveralls
- pip install .
- git clone https://github.com/qiime2/q2lint
- 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
- conda install -q pytest-cov
- pip install -q flake8 coveralls
- python setup.py install
script:
- py.test --cov=q2_composition
- flake8
- python q2lint/q2lint.py
- python ../q2lint/q2lint.py
- py.test --cov=q2_composition
after_success:
- coveralls
notifications:
Expand Down
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_composition/_version.py
38 changes: 38 additions & 0 deletions ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% set data = load_setup_py_data() %}
{% set version = data.get('version') or 'placehold' %}
{% set release = '.'.join(version.split('.')[:2]) %}

package:
name: q2-composition
version: {{ version }}

source:
path: ../..

build:
script: python setup.py install

requirements:
build:
- python 3.5*
- setuptools

run:
- python 3.5*
- setuptools
- scikit-bio
- bokeh
- biom-format >=2.1.5,<2.2.0
- scipy
- qiime2 {{ release }}.*
- q2-types {{ release }}.*

test:
imports:
- q2_composition
- qiime2.plugins.composition

about:
home: https://qiime2.org
license: BSD-3-Clause
license_family: BSD
6 changes: 3 additions & 3 deletions q2_composition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

import pkg_resources

from ._impute import add_pseudocount
from ._ancom import ancom
from ._type import Composition
from ._version import get_versions


__version__ = pkg_resources.get_distribution('q2-composition').version
__version__ = get_versions()['version']
del get_versions

__all__ = ['add_pseudocount', 'ancom', 'Composition']
Loading

0 comments on commit ec1549b

Please sign in to comment.