Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from praekeltfoundation/feature/adhoc-travis-fixes
Browse files Browse the repository at this point in the history
Travis fixes
  • Loading branch information
JayH5 committed Dec 17, 2015
2 parents 65a742a + 679057d commit e523118
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 10 deletions.
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
26 changes: 17 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
sudo: false
language: python
python:
- "2.7"
- "pypy"

matrix:
include:
- python: "2.7"
# Disable coverage tests for pypy as they'll always be the same as CPython
- python: "pypy"
env: PYPY_VERSION="4.0.1" NO_COVERAGE=1

cache:
directories:
- $HOME/.pip-cache/
- $HOME/.cache/pip

env:
- TZ=UTC
before_install:
# If necessary, set up an appropriate version of pypy.
- if [ ! -z "$PYPY_VERSION" ]; then source utils/setup-pypy-travis.sh; fi
- if [ ! -z "$PYPY_VERSION" ]; then python --version 2>&1 | fgrep "PyPy $PYPY_VERSION"; fi

install:
- pip install 'pip>=7.1.2'
- pip install coveralls
- pip install -r requirements-dev.txt
- pip install -e .

script:
- flake8 sideloader
- py.test --cov=sideloader --cov-report=term
- if [ -z "$NO_COVERAGE" ]; then COVERAGE_OPTS="--cov=sideloader --cov-report=term"; else COVERAGE_OPTS=""; fi
- py.test $COVERAGE_OPTS sideloader

after_success:
- coveralls
- if [ -z "$NO_COVERAGE" ]; then coveralls; fi
3 changes: 2 additions & 1 deletion sideloader/build/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
type=click.Choice(['dir', 'python', 'virtualenv']))
@click.option('--packman', help='Package manager', default='deb',
type=click.Choice(['deb', 'rpm']))
@click.option('--config', help='Sideloader config', default='/etc/sideloader/sideloader.yaml',
@click.option('--config', help='Sideloader config',
default='/etc/sideloader/sideloader.yaml',
type=click.Path())
@click.option('--debug/--no-debug', help='Log additional debug information',
default=False)
Expand Down
16 changes: 16 additions & 0 deletions utils/setup-pypy-travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# NOTE: This script needs to be sourced so it can modify the environment.

# Get out of the virtualenv we're in.
deactivate

# Install pyenv.
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# Install pypy and make a virtualenv for it.
pyenv install -s pypy-$PYPY_VERSION
pyenv global pypy-$PYPY_VERSION
virtualenv -p $(which python) ~/env-pypy-$PYPY_VERSION
source ~/env-pypy-$PYPY_VERSION/bin/activate

0 comments on commit e523118

Please sign in to comment.