From 6595436fd36b8785cbe4fc3e8128619667dd3aeb Mon Sep 17 00:00:00 2001
From: Alex Rubinsteyn <alex.rubinsteyn@gmail.com>
Date: Mon, 18 Apr 2016 14:52:24 -0400
Subject: [PATCH] added travis config and lint script

---
 .travis.yaml | 42 ++++++++++++++++++++++++++++++++++++++++++
 lint.sh      | 15 +++++++++++++++
 pylintrc     |  5 +++++
 3 files changed, 62 insertions(+)
 create mode 100644 .travis.yaml
 create mode 100644 lint.sh
 create mode 100644 pylintrc

diff --git a/.travis.yaml b/.travis.yaml
new file mode 100644
index 00000000..4a71970a
--- /dev/null
+++ b/.travis.yaml
@@ -0,0 +1,42 @@
+sudo: false  # Use container-based infrastructure
+language: python
+python:
+  - "2.7"
+  - "3.4"
+before_install:
+  # Commands below copied from: http://conda.pydata.org/docs/travis.html
+  # We do this conditionally because it saves us some downloading if the
+  # version is the same.
+  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
+      wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
+    else
+      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
+    fi
+  - bash miniconda.sh -b -p $HOME/miniconda
+  - export PATH="$HOME/miniconda/bin:$PATH"
+  # reset the shell's lookup table for program name to path mappings
+  - hash -r
+  - conda config --set always_yes yes --set changeps1 no
+  - conda update -q conda
+  # Useful for debugging any issues with conda
+  - conda info -a
+addons:
+  apt:
+    packages:
+    # install pandoc for use with pypandoc for converting the README
+    # from markdown to RST
+    - pandoc
+install:
+  - >
+      conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
+      numpy scipy nose pandas matplotlib
+  - source activate test-environment
+  - pip install pypandoc
+  - pip install -r requirements.txt
+  - pip install .
+  - pip install coveralls
+script:
+  # run tests
+  - nosetests test --with-coverage --cover-package=mhcflurry  && ./lint.sh
+after_success:
+  coveralls
diff --git a/lint.sh b/lint.sh
new file mode 100644
index 00000000..783cac3c
--- /dev/null
+++ b/lint.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -o errexit
+
+
+# disabling several categories of errors due to false positives in pylint,
+# see these issues:
+# - https://bitbucket.org/logilab/pylint/issues/701/false-positives-with-not-an-iterable-and
+# - https://bitbucket.org/logilab/pylint/issues/58
+
+find . -name '*.py' \
+  | xargs pylint \
+  --errors-only \
+  --disable=print-statement,unsubscriptable-object,not-an-iterable,no-member
+
+echo 'Passes pylint check'
diff --git a/pylintrc b/pylintrc
new file mode 100644
index 00000000..612f8108
--- /dev/null
+++ b/pylintrc
@@ -0,0 +1,5 @@
+[TYPECHECK]
+# Without ignoring this, we get errors like:
+# E:249,20: Module 'numpy' has no 'nan' member (no-member)
+ignored-modules = numpy
+ignored-classes = nose.tools
-- 
GitLab