Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis: use tox and .travis/ scripts
- Loading branch information
Showing
7 changed files
with
173 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
*.pyc | ||
# Byte-compiled and optimized files | ||
__pycache__/ | ||
*.py[co] | ||
*$py.class | ||
|
||
# Packaging | ||
*.egg-info | ||
MANIFEST | ||
|
||
# Unit test and coverage files | ||
.cache | ||
.coverage | ||
.coverage.* | ||
.tox | ||
|
||
# OS X Finder | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
sudo: false | ||
language: python | ||
sudo: required | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
- "3.4" | ||
- "3.5" | ||
before_install: | ||
- git clone https://github.com/typesupply/defcon.git --branch ufo3 | ||
- git clone https://github.com/robofab-developers/robofab.git --branch ufo3k | ||
- git clone https://github.com/behdad/fonttools.git | ||
matrix: | ||
include: | ||
- python: 2.7 | ||
env: TOXENV=py27 | ||
- python: 3.4 | ||
env: TOXENV=py34 | ||
- python: 3.5 | ||
env: TOXENV=py35 | ||
- python: pypy | ||
env: TOXENV=pypy | ||
- language: generic | ||
os: osx | ||
# the default 'osx' on Travis is 10.9 Mavericks, with Python 2.7.5 | ||
env: TOXENV=py27 | ||
- language: generic | ||
os: osx | ||
# this is to test on 10.11 El Capitan which comes with Python 2.7.10 | ||
osx_image: xcode7.3 | ||
env: TOXENV=py27 | ||
- language: generic | ||
os: osx | ||
env: TOXENV=py34 | ||
- language: generic | ||
os: osx | ||
env: TOXENV=py35 | ||
- language: generic | ||
os: osx | ||
env: TOXENV=pypy | ||
# coveralls is not listed in tox's envlist, but should run in travis | ||
- python: 3.5 | ||
env: TOXENV=coveralls | ||
install: | ||
- cd defcon; python setup.py install; cd .. | ||
- cd robofab; python setup.py install; cd .. | ||
- cd fonttools; python setup.py install; cd .. | ||
# fontMath | ||
- python setup.py install | ||
- pip install coveralls | ||
- ./.travis/install.sh | ||
script: | ||
- cd Lib/fontMath | ||
- coverage run --parallel-mode mathFunctions.py | ||
- coverage run --parallel-mode --source=mathGlyph.py mathGlyph.py | ||
- coverage run --parallel-mode mathGuideline.py | ||
- coverage run --parallel-mode --source=mathInfo.py mathInfo.py | ||
- coverage run --parallel-mode --source=mathKerning.py mathKerning.py | ||
- coverage run --source=mathTransform.py mathTransform.py | ||
after_success: | ||
- coverage combine | ||
- coveralls | ||
- ./.travis/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
if [[ "$(uname -s)" == 'Darwin' ]]; then | ||
# install pyenv from the git repo (quicker than using brew) | ||
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | ||
PYENV_ROOT="$HOME/.pyenv" | ||
PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
|
||
case "${TOXENV}" in | ||
py27) | ||
# install pip on the system python | ||
curl -O https://bootstrap.pypa.io/get-pip.py | ||
python get-pip.py --user | ||
;; | ||
py34) | ||
pyenv install 3.4.3 | ||
pyenv global 3.4.3 | ||
;; | ||
py35) | ||
pyenv install 3.5.1 | ||
pyenv global 3.5.1 | ||
;; | ||
pypy) | ||
pyenv install pypy-5.0.0 | ||
pyenv global pypy-5.0.0 | ||
;; | ||
esac | ||
pyenv rehash | ||
python -m pip install --user --upgrade pip virtualenv | ||
else | ||
# on Linux, we only need pyenv to get the latest pypy | ||
if [[ "${TOXENV}" == "pypy" ]]; then | ||
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | ||
PYENV_ROOT="$HOME/.pyenv" | ||
PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
|
||
if [[ "${TOXENV}" == "pypy" ]]; then | ||
pyenv install pypy-5.0.0 | ||
pyenv global pypy-5.0.0 | ||
fi | ||
pyenv rehash | ||
fi | ||
pip install --upgrade pip virtualenv | ||
fi | ||
|
||
# activate virtualenv and install test requirements | ||
python -m virtualenv ~/.venv | ||
source ~/.venv/bin/activate | ||
pip install -r dev-requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
if [[ "$(uname -s)" == "Darwin" || "${TOXENV}" == "pypy" ]]; then | ||
PYENV_ROOT="$HOME/.pyenv" | ||
PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
fi | ||
|
||
source ~/.venv/bin/activate | ||
tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pytest>=2.8 | ||
virtualenv>=15.0 | ||
tox>=2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[tox] | ||
#envlist = py27, pypy, py34, py35 | ||
envlist = py27, pypy, py34, py35 | ||
|
||
[testenv] | ||
basepython = | ||
py27: {env:TOXPYTHON:python2.7} | ||
pypy: {env:TOXPYTHON:pypy} | ||
py34: {env:TOXPYTHON:python3.4} | ||
py35: {env:TOXPYTHON:python3.5} | ||
deps = | ||
pytest | ||
-rrequirements.txt | ||
install_command = | ||
{envpython} -m pip install -v {opts} {packages} | ||
commands = | ||
# check that we have the expected Python version and architecture | ||
{envpython} -c "import sys; print(sys.version)" | ||
{envpython} -c "import struct; print(struct.calcsize('P') * 8)" | ||
{envpython} -c "import ufoLib; print(ufoLib.__file__)" | ||
# run the test suite | ||
py.test | ||
|
||
[testenv:coveralls] | ||
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH | ||
basepython=python3.5 | ||
deps = | ||
{[testenv]deps} | ||
pytest-cov | ||
coveralls | ||
skip_install = true | ||
ignore_outcome = true | ||
commands= | ||
# measure test coverage and upload report to coveralls | ||
py.test --cov=Lib/fontMath | ||
coveralls | ||
|
||
[pytest] | ||
minversion = 2.8 | ||
testpaths = | ||
Lib/fontMath | ||
python_files = | ||
test_*.py | ||
python_classes = | ||
*Test | ||
addopts = | ||
# run py.test in verbose mode | ||
-v | ||
# show extra test summary info | ||
-r a |