Skip to content

Commit

Permalink
Merge pull request #230 from hynek/tox-ci
Browse files Browse the repository at this point in the history
Use tox in CI
  • Loading branch information
reaperhulk committed Apr 15, 2015
2 parents 0071ad6 + 8a5149a commit 56e8af6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist
__pycache__
.tox
doc/_build/
.coverage
40 changes: 17 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ matrix:
# Also run the tests against cryptography master.
- python: "2.6"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py26
- python: "2.7"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py27
- python: "3.2"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py32
- python: "3.3"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py33
- python: "3.4"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py34
- python: "pypy"
env:
CRYPTOGRAPHY_GIT_MASTER=true
CRYPTOGRAPHY_GIT_MASTER=true TOXENV=pypy

# Also run at least a little bit against an older version of OpenSSL.
- python: "2.7"
env:
OPENSSL=0.9.8
OPENSSL=0.9.8 TOXENV=py27
addons:
apt:
sources:
Expand All @@ -57,10 +57,13 @@ matrix:
- language: generic
os: osx
env: TOXENV=py27
- env:
CRYPTOGRAPHY_GIT_MASTER=true
- env:
OPENSSL=0.9.8
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py26
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py27
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py32
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py33
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=py34
- env: CRYPTOGRAPHY_GIT_MASTER=true TOXENV=pypy
- env: OPENSSL=0.9.8 TOXENV=py27

before_install:
- if [ -n "$CRYPTOGRAPHY_GIT_MASTER" ]; then pip install git+https://github.com/pyca/cryptography.git;fi
Expand All @@ -77,8 +80,7 @@ install:
pip install virtualenv
fi
python -m virtualenv ~/.venv
source ~/.venv/bin/activate
pip install coveralls coverage wheel
~/.venv/bin/pip install coveralls tox
script:
- |
Expand All @@ -88,18 +90,10 @@ script:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CFLAGS="-I/usr/local/opt/openssl/include"
fi
source ~/.venv/bin/activate
pip install -e .
- |
source ~/.venv/bin/activate
coverage run --branch --source=OpenSSL setup.py bdist_wheel test
- |
source ~/.venv/bin/activate
coverage report -m
python -c "import OpenSSL.SSL; print(OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION))"
~/.venv/bin/tox
after_script:
- source ~/.venv/bin/activate && coveralls
- ~/.venv/bin/coveralls

notifications:
email: false
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
[tox]
envlist = pypy,py26,py27,py32,py33
envlist = pypy,py26,py27,py32,py33,py34

[testenv]
deps =
setuptools>=7.0
coverage
setenv =
# Do not allowed the executing environment to pollute the test environment
# with extra packages.
PYTHONPATH=
# The standard library unittest module can run tests on Python 2.7 and newer
commands = python setup.py test
commands =
python -c "import OpenSSL.SSL; print(OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION))"
coverage run --branch --source=OpenSSL setup.py test
coverage report -m

0 comments on commit 56e8af6

Please sign in to comment.