Skip to content

Commit bd3a3b9

Browse files
authored
Merge pull request #30 from robofab-developers/travis
Setup travis, a copy from fontParts
2 parents c166f74 + ac43478 commit bd3a3b9

File tree

11 files changed

+291
-0
lines changed

11 files changed

+291
-0
lines changed

.codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comment:
2+
layout: "diff, files"
3+
behavior: default
4+
require_changes: true
5+
coverage:
6+
status:
7+
project: off
8+
patch: off

.coveragerc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[run]
2+
# measure 'branch' coverage in addition to 'statement' coverage
3+
# See: http://coverage.readthedocs.io/en/coverage-4.5.1/branch.html
4+
branch = True
5+
6+
# list of directories or packages to measure
7+
source = fontPens
8+
9+
[paths]
10+
source =
11+
Lib/fontPens
12+
.tox/*/lib/python*/site-packages/fontPens
13+
.tox/pypy*/site-packages/fontPens
14+
15+
[report]
16+
# Regexes for lines to exclude from consideration
17+
exclude_lines =
18+
# keywords to use in inline comments to skip coverage
19+
pragma: no cover
20+
21+
# don't complain if tests don't hit defensive assertion code
22+
(raise|except)(\s)?NotImplementedError
23+
24+
# don't complain if non-runnable code isn't run
25+
if __name__ == .__main__.:
26+
27+
# ignore source code that can’t be found
28+
ignore_errors = True
29+
30+
# when running a summary report, show missing lines
31+
show_missing = True

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ __pycache__/
55

66
.cache
77
.eggs
8+
.tox
9+
.coverage
10+
.coverage.*
11+
.pytest_cache
12+
htmlcov
813

914
# OSX Finder
1015
.DS_Store

.travis.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
sudo: false
2+
3+
language: python
4+
python: 3.6
5+
6+
# empty "env:" is needed for 'allow_failures'
7+
# https://docs.travis-ci.com/user/customizing-the-build/#Rows-that-are-Allowed-to-Fail
8+
env:
9+
10+
matrix:
11+
fast_finish: true
12+
exclude:
13+
- python: 3.6
14+
include:
15+
- python: 2.7
16+
env: TOXENV=py27-cov
17+
- python: 3.6
18+
env:
19+
- TOXENV=py36-cov
20+
- BUILD_DIST=true
21+
- python: 3.7
22+
env: TOXENV=py37-cov
23+
dist: xenial
24+
sudo: true
25+
- python: pypy
26+
env: TOXENV=pypy-nocov
27+
- language: generic
28+
os: osx
29+
env: TOXENV=py27-cov
30+
- language: generic
31+
os: osx
32+
env:
33+
- TOXENV=py3-cov
34+
- HOMEBREW_NO_AUTO_UPDATE=1
35+
- env:
36+
- TOXENV=py27-nocov
37+
- PYENV_VERSION='2.7.6'
38+
- PYENV_VERSION_STRING='Python 2.7.6'
39+
- PYENV_ROOT=$HOME/.travis-pyenv
40+
- TRAVIS_PYENV_VERSION='0.4.0'
41+
allow_failures:
42+
# We use fast_finish + allow_failures because OSX builds take forever
43+
# https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
44+
- language: generic
45+
os: osx
46+
env: TOXENV=py27-cov
47+
- language: generic
48+
os: osx
49+
env:
50+
- TOXENV=py3-cov
51+
- HOMEBREW_NO_AUTO_UPDATE=1
52+
53+
cache:
54+
- pip
55+
- directories:
56+
- $HOME/.pyenv_cache
57+
58+
before_install:
59+
- source ./.travis/before_install.sh
60+
61+
install:
62+
- ./.travis/install.sh
63+
64+
script:
65+
- ./.travis/run.sh
66+
67+
after_success:
68+
- ./.travis/after_success.sh
69+
70+
before_deploy:
71+
- ./.travis/before_deploy.sh
72+
73+
deploy:
74+
# deploy to Github Releases on tags
75+
- provider: releases
76+
api_key:
77+
secure: pC8uLogIHAtrAbUr6cv493IGPIiC+RkVGQXR9z3HTisplrq+lzgoAo4ik5gzettfG4oVyt0ERGSxo61X7MIDv2idlGUgXJSHKQgf3IJPIsRU5jHJzo5YHpEy1bVygBesz3jFFKXGvr2nRQlwGr7+3dbHV+KJaszw91MnoNJkfRXKqQMJ8wDNpZm2O9SWfFO/hL9oouLfpNBUYKHZzRWTcSxR8rNe+vPW/ai7VAqbIkeXIBCqUl/kOWlK/M3aUnI9/3A8BuKXvXIKAgrpViR3HeTnymQc8CGVKjX2GlDQtI3XxcuMgoX69Y9azS+ajrh1YdlQNcqArLVhrsl404PFWPq9sV0jm0f1iUQhuhCrLZVjKEtYNbWj2HIaR42raT2mDR5u/a0LX89jTdWEoNkd+Qov7OA0djUd7Z2pmKvlbyCL8PwYlMStQ/jaQECp799JVu9/ky6tCDvE0ALFTzWCL0rUOYM9KPSb8mjSFW5ylmHBvQWc5rYtFtQn3fSFQwkj6r2x5Z99qszqHj7obLG8yLm19ddrx5JNVQSyTA+XgF2eUy0ilZRaAWTGb41U++RkHQpjkN6VFjanfi4hCB5gSWx7GDCV5DhSqId6z+XQPgS64xDWGfoS2v4Sa82mmQClv1HdQ23cyW48Ss3NctkDdwJSDsWZ10CFx7sI2ccAm+w=
78+
skip_cleanup: true
79+
file_glob: true
80+
file: "dist/*"
81+
on:
82+
tags: true
83+
repo: robofab-developers/fontPens
84+
all_branches: true
85+
condition: "$BUILD_DIST == true"
86+
# deploy to PyPI on tags
87+
- provider: pypi
88+
user: benkiel
89+
password:
90+
secure: "dQmUNMwDeq7162p3IE3M9d9BW3lfk/chaW8SY605YikW7J56bfT1CQFaOiYumdvMF/eWBrVxbQbdwdupL2sDm1dSgYKWu0ite1jePaoTkMhEKFr+XW7GogcX+LOiFa7FITscnWgV02XwijStbklQmZ2beBe/tjB5Ug/Swx6CVCsTN/j1n0+r3UjtHcsnVgN+XAhpC0+ewoyKkoKP/aalb2gGFwsRDh2SzJZ/sOICHmmjJUGDB6/vS8tGgnI1arDSpSH7KDNB1dVAfDvjK9yXFEDPkYO5vEU//vZWP9yKTqXPmDiv+SMg959UcdgCUnNPSv44/VDtqv9kNhG4t3Ye4bjV/WBnyZ3SiWF8XHI+r3nk6x6Swjhq8ZRPk861JhDPK67kCJHdmMjOfaKy+MoTWscDqLlzxxAABSv+HkgQ3LiHKqBbvJVBbuhbmFdo8qtmZXKl4z8LlUcTHskMAioEMbueKRW/+jEDN5xm0h7c4W2mfHyrnn3Td5hWpmXZKe7ZKqbU8koBruGJpnC6miE689nO6HLpQbW8AjYy6ZOkz4HbkZCAYh0NqYe7qwgFKx8+iYy5smWyiqAS7A4D1kyFzaXV5jEe87jddDc/wMofgcKSUBOGe9eM/w4FKVRCW8jAMkjMiZKVMzHE2f9nk9q4A8bU++Da/AgIw3JKOVnWAPg="
91+
skip_cleanup: true
92+
distributions: pass
93+
on:
94+
tags: true
95+
repo: robofab-developers/fontPens
96+
all_branches: true
97+
condition: "$BUILD_DIST == true"

.travis/after_success.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
7+
source .venv/bin/activate
8+
fi
9+
10+
# upload coverage data to Codecov.io
11+
[[ ${TOXENV} == *"-cov"* ]] && tox -e codecov

.travis/before_deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
# build sdist and wheel distribution packages in ./dist folder.
7+
# Travis runs the `before_deploy` stage before each deployment, but
8+
# we only want to build them once, as we want to use the same
9+
# files for both Github and PyPI
10+
if $(ls ./dist/fontParts*.zip > /dev/null 2>&1) && \
11+
$(ls ./dist/fontParts*.whl > /dev/null 2>&1); then
12+
echo "Distribution packages already exists; skipping"
13+
else
14+
tox -e bdist
15+
fi

.travis/before_install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
if [[ -n "$PYENV_VERSION" ]]; then
4+
wget https://github.com/praekeltfoundation/travis-pyenv/releases/download/${TRAVIS_PYENV_VERSION}/setup-pyenv.sh
5+
source setup-pyenv.sh
6+
fi

.travis/install.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
ci_requirements="pip setuptools tox"
7+
8+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
9+
if [[ ${TOXENV} == *"py27"* ]]; then
10+
# install pip on the system python
11+
curl -O https://bootstrap.pypa.io/get-pip.py
12+
python get-pip.py --user
13+
# install virtualenv and create virtual environment
14+
python -m pip install --user virtualenv
15+
python -m virtualenv .venv/
16+
elif [[ ${TOXENV} == *"py3"* ]]; then
17+
# install current python3 with homebrew
18+
# NOTE: the formula is now named just "python"
19+
brew install python
20+
command -v python3
21+
python3 --version
22+
python3 -m pip install virtualenv
23+
python3 -m virtualenv .venv/
24+
else
25+
echo "unsupported $TOXENV: "${TOXENV}
26+
exit 1
27+
fi
28+
# activate virtual environment
29+
source .venv/bin/activate
30+
fi
31+
32+
python -m pip install $ci_requirements

.travis/run.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
7+
source .venv/bin/activate
8+
fi
9+
10+
tox

README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1+
|Build Status| |Coverage| |PyPI| |Versions|
2+
13
fontPens
24
--------
35

46
A collection of classes implementing the pen protocol for manipulating glyphs.
7+
8+
9+
.. |Build Status| image:: https://travis-ci.org/robofab-developers/fontPens.svg?branch=master
10+
:target: https://travis-ci.org/robofab-developers/fontPens
11+
.. |PyPI| image:: https://img.shields.io/pypi/v/fontPens.svg
12+
:target: https://pypi.org/project/fontPens
13+
.. |Versions| image:: https://img.shields.io/badge/python-2.7%2C%203.7-blue.svg
14+
:alt: Python Versions
15+
.. |Coverage| image:: https://codecov.io/gh/robofab-developers/fontPens/branch/master/graph/badge.svg
16+
:target: https://codecov.io/gh/robofab-developers/fontPens

0 commit comments

Comments
 (0)