CI: Check installation validity
# vim ft=yaml
+dist: xenial
+sudo: true
language: python
-sudo: false
+
cache:
directories:
- $HOME/.cache/pip
python:
+ - 3.5
- 3.6
+ - 3.7
+
+env:
+ global:
+ - CHECK_TYPE="install"
+ - INSTALL_TYPE="pip"
+ - PIP_CONSTRAINT=""
+ - SETUPTOOLS_CONSTRAINT=""
+ matrix:
+ - CHECK_TYPE="style"
+ - INSTALL_TYPE="install"
+ - INSTALL_TYPE="develop"
+ - INSTALL_TYPE="sdist"
+ - INSTALL_TYPE="wheel"
+ - PIP_CONSTRAINT="==10.1" SETUPTOOLS_CONSTRAINT="<30.3.0"
+ - SETUPTOOLS_CONSTRAINT="==30.3.0"
before_install:
- - python -m pip install --upgrade pip
+ - travis_retry python -m pip install --upgrade "pip $PIP_CONSTRAINT" "setuptools $SETUPTOOLS_CONSTRAINT"
- pip install "flake8<3.0" flake8-putty
+install:
+ - |
+ if [ "$INSTALL_TYPE" == "install" ]; then
+ python setup.py install
+ elif [ "$INSTALL_TYPE" == "develop" ]; then
+ python setup.py develop
+ elif [ "$INSTALL_TYPE" == "pip" ]; then
+ pip install .
+ elif [ "$INSTALL_TYPE" == "sdist" ]; then
+ python setup.py sdist
+ pip install dist/*.tar.gz
+ elif [ "$INSTALL_TYPE" == "wheel" ]; then
+ python setup.py bdist_wheel
+ pip install dist/*.whl
+ fi
+ - |
+ if [ "$CHECK_TYPE" == "style" ]; then
+ travis_retry pip install "flake8<3.0" flake8-putty
+ fi
+
script:
- - flake8 niworkflows
+ - |
+ if [ "$CHECK_TYPE" == "style" ]; then
+ flake8 niworkflows
+ elif [ "$CHECK_TYPE" == "install" ]; then
+ INTENDED_VERSION="$(python -c 'import versioneer; print(versioneer.get_version())')"
+ INSTALLED_VERSION="$(python -c 'import niworkflows; print(niworkflows.__version__)')"
+ python -c 'import niworkflows; print(niworkflows.__file__)'
+ echo "Intended: $INTENDED_VERSION"
+ echo "Installed: $INSTALLED_VERSION"
+ test "$INTENDED_VERSION" == "$INSTALLED_VERSION"
+ else
+ false
+ fi
