Skip to content

Commit

Permalink
maint: add a .travis config
Browse files Browse the repository at this point in the history
- Closes #6 (smoke-test has been split to #15.
- Closes #12
- Prepares for #7
  • Loading branch information
oesteban committed Mar 23, 2020
1 parent 1255960 commit 082ad9b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 26 deletions.
96 changes: 96 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# vim ft=yaml
dist: xenial
sudo: true
language: python

cache:
directories:
- $HOME/.cache/pip

python:
- 3.6
- 3.7
- 3.8

env:
global:
- CHECK_TYPE="install"
- INSTALL_TYPE="pip"
- INSTALL_DEPENDS="pip setuptools"
matrix:
- CHECK_TYPE="style"
- CHECK_TYPE="test"
- INSTALL_TYPE="sdist"
- INSTALL_TYPE="wheel"
- INSTALL_DEPENDS="pip==18.1 setuptools==30.2.1"
- INSTALL_DEPENDS="pip==10.0.1 setuptools==30.4.0"

matrix:
exclude:
- python: 3.7
env: CHECK_TYPE="style"
allow_failures:
- python: 3.6
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.4.0"
- python: 3.7
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.4.0"
- python: 3.8
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.4.0"

before_install:
- python -m pip install --upgrade pip virtualenv
- virtualenv --python=python /tmp/venv
- source /tmp/venv/bin/activate
- python --version
- python -m pip --version
- python -m pip install --upgrade $INSTALL_DEPENDS
- python -m pip --version
- |
if [ "$INSTALL_TYPE" == "pip" ]; then
PACKAGE="-e ."
elif [ "$INSTALL_TYPE" == "sdist" ]; then
python setup.py sdist
PACKAGE="$( ls dist/*.tar.gz )"
elif [ "$INSTALL_TYPE" == "wheel" ]; then
python setup.py bdist_wheel
PACKAGE="$( ls dist/*.whl )"
fi
install:
- python -m pip install $PACKAGE
- |
INTENDED_VERSION="$(python -c 'import versioneer; print(versioneer.get_version())')"
pushd /tmp
INSTALLED_VERSION="$(python -c 'import nirodents; print(nirodents.__version__)')"
python -c 'import nirodents; print(nirodents.__file__)'
echo "Intended: $INTENDED_VERSION"
echo "Installed: $INSTALLED_VERSION"
test "$INTENDED_VERSION" == "$INSTALLED_VERSION"
popd
- if [ "$CHECK_TYPE" = "install" ]; then exit 0; fi

before_script:
- travis_retry python -m pip install "nirodents[$CHECK_TYPE]"
- |
if [ "$CHECK_TYPE" == "test" ]; then
mkdir -p $HOME/.cache/stanford-crn
curl -sSL "http://github.com/chrisfilo/BIDS-examples-1/archive/enh/ds054.tar.gz" |
tar xvzf - -C $HOME/.cache/stanford-crn
curl -sSL "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/57f328f6b83f6901ef94cf70" |
tar xvzf - -C $HOME/.cache/stanford-crn
fi
script:
- |
if [ "$CHECK_TYPE" == "style" ]; then
flake8 nirodents
elif [ "$CHECK_TYPE" == "test" ]; then
pytest -n 2 -v --cov nirodents --cov-report xml:cov.xml \
--ignore=nirodents/interfaces/ants.py nirodents
else
false
fi
after_script:
- python -m pip install codecov
- python -m codecov --flags travis --file cov.xml -e $TRAVIS_JOB_NUMBER
26 changes: 0 additions & 26 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,3 @@ doctests = False
ignore =
W503
exclude=*build/
per-file-ignores =
**/__init__.py : F401
docs/conf.py : E265

[tool:pytest]
norecursedirs = .git
addopts = -svx --doctest-modules
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS
env =
PYTHONHASHSEED=0
filterwarnings =
ignore::DeprecationWarning
junit_family=xunit2

[coverage:run]
branch = True
omit =
*/tests/*
nirodents/_version.py
nirodents/conftest.py

[coverage:report]
# Regexes for lines to exclude from consideration
exclude_lines =
raise NotImplementedError
warnings\.warn

0 comments on commit 082ad9b

Please sign in to comment.