From 58c829bf21f5d42077804d6adee29da1cf5ecfca Mon Sep 17 00:00:00 2001 From: "Matthew M. Boedicker" Date: Sat, 9 Apr 2016 15:15:33 -0700 Subject: [PATCH 1/2] Add Travis CI --- .travis.yml | 6 ++++++ README.md | 2 ++ requirements.txt | 1 + run_tests.sh | 7 +++++++ 4 files changed, 16 insertions(+) create mode 100644 .travis.yml create mode 100644 requirements.txt create mode 100755 run_tests.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2d76472 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: python +python: + - '2.7' + - '3.5' +install: 'pip install -r requirements.txt' +script: ./run_tests.sh diff --git a/README.md b/README.md index 4618f52..c6df1e1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/python-otr/pure-python-otr.svg?branch=master)](https://travis-ci.org/python-otr/pure-python-otr) + Python OTR ========== This is a pure Python OTR implementation; it does not bind to libotr. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..03917ad --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +PyCrypto >= 2.1 diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..49e3850 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eu + +# the directory that this script is in +SRC_ROOT=$(cd -P $(dirname "$0") && pwd) +export PYTHONPATH="$SRC_ROOT/src" + +python tests/testBasic.py From 7650e0d15c843648904076c54d89e628eb4284b9 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 29 Dec 2016 17:17:07 +0100 Subject: [PATCH 2/2] Use tox to run tests Allows us more flexibility in local environments --- .travis.yml | 7 +++++-- tox.ini | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml index 2d76472..1ef2dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,8 @@ language: python python: - '2.7' - '3.5' -install: 'pip install -r requirements.txt' -script: ./run_tests.sh +env: + - TOX_ENV=py2 + - TOX_ENV=py3 +install: 'pip install tox' +script: 'tox -e $TOX_ENV' diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..564b1e8 --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ + +[tox] +envlist = py3,py2 + +[testenv] +commands=./run_tests.sh +deps= -r{toxinidir}/requirements.txt + +[testenv:py3] +basepython = python3 + +[testenv:py2] +basepython = python2