mirror of https://github.com/jab/bidict.git
152 lines
4.6 KiB
YAML
152 lines
4.6 KiB
YAML
language: python
|
|
|
|
# Version used for jobs that don't override it (e.g. the one-off jobs):
|
|
python: "3.6"
|
|
|
|
sudo: false
|
|
|
|
env:
|
|
global:
|
|
- VENV_ROOT="$HOME/venv"
|
|
- LINT_SRC="$(ls bidict/*.py tests/*.py setup.py)"
|
|
- HYPOTHESIS_PROFILE=$([[ $TRAVIS_EVENT_TYPE = cron ]] && echo max_examples_5000 || echo default)
|
|
|
|
|
|
before_install:
|
|
- echo 'TRAVIS_PULL_REQUEST_SHA:' $TRAVIS_PULL_REQUEST_SHA
|
|
- echo 'TRAVIS_COMMIT:' $TRAVIS_COMMIT
|
|
- git --no-pager log -n2
|
|
# Travis does a shallow (--depth=50) clone by default.
|
|
# Clone the full history as requested by setuptools_scm.
|
|
- travis_retry git fetch --unshallow
|
|
# https://github.com/python-trio/trio/issues/487#issuecomment-377931587
|
|
- echo 'Installing latest pip...'
|
|
- travis_retry curl https://bootstrap.pypa.io/get-pip.py | python
|
|
- pip --version
|
|
|
|
|
|
install: # Install our test dependencies.
|
|
- export EXTRAS="test"
|
|
- if [[ -n $COVERAGE ]]; then export EXTRAS="${EXTRAS},coverage"; fi
|
|
- travis_retry pip install .[$EXTRAS]
|
|
- pip list
|
|
|
|
|
|
script: # Run our test suite.
|
|
- if [[ -n $COVERAGE ]]; then export PYTEST_ADDOPTS="--cov=bidict --cov-config=.coveragerc"; fi
|
|
- python setup.py test
|
|
|
|
|
|
after_script:
|
|
- |
|
|
if [[ -n $COVERAGE ]]; then
|
|
echo "Installing codecov..."
|
|
travis_retry pip install codecov || exit 1
|
|
echo
|
|
echo "Uploading coverage report to codecov..."
|
|
travis_retry codecov
|
|
fi
|
|
|
|
|
|
matrix:
|
|
include:
|
|
# Each job performs a single task, and sets a "TASK" var so it's evident in the build matrix.
|
|
|
|
# Run the test suite with various Python versions.
|
|
# Also don't bother testing Python 3.4; if we work on 3.5+, we should work on 3.4 too.
|
|
|
|
## Linux
|
|
### Enable coverage for the most recent available CPython 2 and 3 releases and PyPy 3.
|
|
#### Latest stable CPython 2 available -> enable coverage.
|
|
- python: "2.7"
|
|
env: TASK=test COVERAGE=1
|
|
#### Latest mature and stable CPython 3 available -> enable coverage.
|
|
- python: "3.6"
|
|
env: TASK=test COVERAGE=1
|
|
#### Latest stable PyPy 3 available -> enable coverage.
|
|
- python: pypy3
|
|
env: TASK=test COVERAGE=1
|
|
#### Latest stable PyPy 2 -> enable coverage.
|
|
- python: pypy
|
|
env: TASK=test COVERAGE=1
|
|
#### Other CPython versions -> no coverage.
|
|
##### Supported previous stable releases:
|
|
- python: "3.5"
|
|
env: TASK=test
|
|
- python: "3.4"
|
|
env: TASK=test
|
|
##### 3.7 is so new it requires special setup on Travis (dist and sudo):
|
|
- python: "3.7"
|
|
env: TASK=test
|
|
dist: xenial
|
|
sudo: required
|
|
##### Next (in-development) CPython version:
|
|
- python: "3.8-dev"
|
|
env: TASK=test
|
|
dist: xenial
|
|
sudo: required
|
|
|
|
|
|
## macOS
|
|
### Commented out pending https://github.com/travis-ci/travis-ci/issues/2312
|
|
####- python: "2.7"
|
|
#### env: TASK=test
|
|
#### os: osx
|
|
#### osx_image: xcode9.2
|
|
|
|
# One-off jobs. Override "install", "before_install", and "script" to do each of these instead.
|
|
- env: TASK=pydocstyle
|
|
before_install: skip
|
|
install: travis_retry pip install 'pydocstyle<2.2' # keep in sync with the version in setup.py
|
|
script: pydocstyle $LINT_SRC
|
|
- env: TASK=build-docs
|
|
before_install: skip
|
|
install: travis_retry pip install Sphinx
|
|
script:
|
|
- ./build-docs.sh
|
|
- cd docs
|
|
- travis_retry make linkcheck
|
|
- env: TASK=flake8
|
|
before_install: skip
|
|
install: travis_retry pip install 'flake8<3.6' # keep in sync with the version in setup.py
|
|
script: flake8 $LINT_SRC
|
|
- env: TASK=pylint
|
|
before_install: skip
|
|
install: travis_retry pip install 'pylint<2.2' 'hypothesis<4' 'pytest<4' # keep in sync with the versions in setup.py
|
|
script: pylint --jobs=0 $LINT_SRC
|
|
- env: TASK=test-with-optimization-flag # make sure there are no relied-on side effects in assert statements
|
|
before_install: skip
|
|
install: skip
|
|
script: python -O -m doctest -o IGNORE_EXCEPTION_DETAIL -o ELLIPSIS tests/*.txt
|
|
|
|
- stage: deploy-if-tag
|
|
env: TASK=deploy-if-tag
|
|
before_install: skip
|
|
install: skip
|
|
script: skip
|
|
deploy:
|
|
- provider: pypi
|
|
user: jab
|
|
password:
|
|
secure: B9LLgXkTbtjeC/IbH4wh9PEBzvKEAuYo3EBNW5f1xuLqVqtsysIyxJa5ar/FQ4qwUCBwZPFAXFurN3lLzRhb2Tc04YQ0GYVv6f8lkzwrjoWau4iB9Qt/nnvdRa7KryEJvtenHCAnwoEUaADCjkZjwo6fIA0hEOLB6/AYfhfgXYA=
|
|
on:
|
|
tags: true
|
|
|
|
|
|
before_cache:
|
|
- rm -rf $HOME/.cache/pip/log
|
|
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.cache/pip
|
|
- $HOME/.hypothesis
|
|
|
|
|
|
notifications:
|
|
webhooks:
|
|
urls:
|
|
- https://webhooks.gitter.im/e/bf64fb45a633c0935b9b
|
|
email:
|
|
recipients: jab@math.brown.edu
|