2018-12-29 18:13:04 +00:00
|
|
|
language: 'python'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
|
|
|
# Version used for jobs that don't override it (e.g. the one-off jobs):
|
2018-12-29 18:13:04 +00:00
|
|
|
python: '3.7'
|
2018-10-06 13:51:49 +00:00
|
|
|
|
|
|
|
# Xenial is required for Python 3.7 and 3.8-dev. Just use it for all jobs.
|
|
|
|
# Update to 18.04 when https://github.com/travis-ci/travis-ci/issues/5821 is fixed.
|
2018-12-29 18:13:04 +00:00
|
|
|
dist: 'xenial'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
2016-01-13 16:54:29 +00:00
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
env:
|
|
|
|
global:
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'VENV_ROOT="$HOME/venv"'
|
|
|
|
- 'LINT_SRC="$(ls bidict/*.py tests/*.py tests/*/*.py setup.py)"'
|
|
|
|
- 'HYPOTHESIS_PROFILE="$([[ "$TRAVIS_EVENT_TYPE" == "cron" ]] && echo "MORE_EXAMPLES")"'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
before_install:
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'echo "TRAVIS_PULL_REQUEST_SHA: $TRAVIS_PULL_REQUEST_SHA"'
|
|
|
|
- 'echo "TRAVIS_COMMIT: $TRAVIS_COMMIT"'
|
|
|
|
- 'git --no-pager log -n2'
|
strengthen too-weak assume(..) in test_eq_ne_hash, use "max_examples=5000" for nightly CI jobs, add .readthedocs.yml
The `assume(init_items != init_unequal)` was not sufficient
because it would allow cases like:
bi_cls=bidict, other_cls=bidict, init_items=[(1, 0), (0, 1)], init_unequal=[(0, 1), (1, 0)]
causing the resulting bidicts' item sets to still be equal,
so assertions like
assert items_match(some_bidict, other_unequal, relation=ne)
would fail.
Changing the assume to
assume(set(init_items) != set(init_unequal))
fixes the issue.
Surprisingly, hypothesis only just found a failing example for this
for the first time (in https://travis-ci.org/jab/bidict/jobs/363962257)
despite having numerous opportunities to find it before.
Using a new max_examples=5000 hypothesis profile, only on nightly CI,
should help surface any remaining issues that hypothesis hasn't found yet,
without slowing commit-triggered tests with too much example generation.
Also improve Travis config:
- ditch ALLOW_FAIL=1, for some reason it didn't work
- comment out python 3.7-dev job while Travis is stuck on an old 3.7 alpha
- don't use "- |" command block where we want to see output after each command
- prefix more network-dependent commands with travis_retry
Finally, improve docs building setup:
- Factor out sphinx from "dev" extras_require to its own "docs" extras_require.
- Add a .readthedocs.yml to customize the readthedocs build.
Use pip and the "docs" extras_require to get an up-to-date Sphinx version.
Fixes some broken :ref:`addendum:...` autosectionlabel links in learning-from-bidict.
2018-04-10 04:31:29 +00:00
|
|
|
# Travis does a shallow (--depth=50) clone by default.
|
|
|
|
# Clone the full history as requested by setuptools_scm.
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'travis_retry git fetch --unshallow'
|
|
|
|
# Install Python on macOS since https://github.com/travis-ci/travis-ci/issues/2312 is WONTFIXed.
|
|
|
|
- |
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
env | sort
|
|
|
|
echo
|
|
|
|
echo "TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION"
|
|
|
|
if ! type -P "python$TRAVIS_PYTHON_VERSION"; then
|
|
|
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
|
|
|
brew tap minrk/homebrew-python-frameworks
|
|
|
|
brew cask install "python-framework-${TRAVIS_PYTHON_VERSION/./}"
|
|
|
|
fi
|
|
|
|
declare -r python="$(type -P "python$TRAVIS_PYTHON_VERSION")"
|
|
|
|
echo python is "$python"
|
|
|
|
travis_retry curl https://bootstrap.pypa.io/get-pip.py | python
|
|
|
|
python -m pip install virtualenv
|
|
|
|
python -m virtualenv -p "$python" ~/travis-env
|
|
|
|
source ~/travis-env/bin/activate
|
|
|
|
type python
|
|
|
|
fi
|
|
|
|
- 'python --version'
|
strengthen too-weak assume(..) in test_eq_ne_hash, use "max_examples=5000" for nightly CI jobs, add .readthedocs.yml
The `assume(init_items != init_unequal)` was not sufficient
because it would allow cases like:
bi_cls=bidict, other_cls=bidict, init_items=[(1, 0), (0, 1)], init_unequal=[(0, 1), (1, 0)]
causing the resulting bidicts' item sets to still be equal,
so assertions like
assert items_match(some_bidict, other_unequal, relation=ne)
would fail.
Changing the assume to
assume(set(init_items) != set(init_unequal))
fixes the issue.
Surprisingly, hypothesis only just found a failing example for this
for the first time (in https://travis-ci.org/jab/bidict/jobs/363962257)
despite having numerous opportunities to find it before.
Using a new max_examples=5000 hypothesis profile, only on nightly CI,
should help surface any remaining issues that hypothesis hasn't found yet,
without slowing commit-triggered tests with too much example generation.
Also improve Travis config:
- ditch ALLOW_FAIL=1, for some reason it didn't work
- comment out python 3.7-dev job while Travis is stuck on an old 3.7 alpha
- don't use "- |" command block where we want to see output after each command
- prefix more network-dependent commands with travis_retry
Finally, improve docs building setup:
- Factor out sphinx from "dev" extras_require to its own "docs" extras_require.
- Add a .readthedocs.yml to customize the readthedocs build.
Use pip and the "docs" extras_require to get an up-to-date Sphinx version.
Fixes some broken :ref:`addendum:...` autosectionlabel links in learning-from-bidict.
2018-04-10 04:31:29 +00:00
|
|
|
# https://github.com/python-trio/trio/issues/487#issuecomment-377931587
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'echo "Installing latest pip..."'
|
|
|
|
- 'travis_retry curl https://bootstrap.pypa.io/get-pip.py | python'
|
|
|
|
- 'pip --version'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
install: # Install our test dependencies.
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'travis_retry pip install .[test"$([[ "$COVERAGE" ]] && echo ",coverage")"]'
|
|
|
|
- 'pip list'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
script: # Run our test suite.
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'export PYTEST_ADDOPTS="$([[ "$COVERAGE" ]] && echo "--cov=bidict --cov-config=.coveragerc")"'
|
|
|
|
- './run_tests.py'
|
2017-11-21 03:27:26 +00:00
|
|
|
|
2016-06-28 04:05:22 +00:00
|
|
|
|
2017-11-21 04:07:46 +00:00
|
|
|
after_script:
|
|
|
|
- |
|
2018-12-29 18:13:04 +00:00
|
|
|
if [[ "$COVERAGE" ]]; then
|
|
|
|
echo "Installing codecov..."
|
|
|
|
travis_retry pip install codecov || exit 1
|
|
|
|
echo
|
|
|
|
echo "Uploading coverage report to codecov..."
|
|
|
|
travis_retry codecov
|
|
|
|
fi
|
2017-11-21 04:07:46 +00:00
|
|
|
|
|
|
|
|
2016-01-13 16:54:29 +00:00
|
|
|
matrix:
|
2018-11-23 01:36:17 +00:00
|
|
|
allow_failures:
|
2018-12-29 18:13:04 +00:00
|
|
|
- env: 'TASK=docs-linkcheck'
|
2016-01-13 16:54:29 +00:00
|
|
|
include:
|
2018-09-09 19:51:02 +00:00
|
|
|
# Each job below performs a single task. Setting a per-job "TASK" env var
|
2018-11-23 01:36:17 +00:00
|
|
|
# causes Travis to clearly show each job's task in the web UI,
|
|
|
|
# and also enables the clear TASK-based allow_failures spelling above.
|
2017-11-16 20:44:51 +00:00
|
|
|
|
2018-09-09 19:51:02 +00:00
|
|
|
## "TEST" tasks: Run the test suite with various Python versions.
|
|
|
|
### Enable coverage for the most recent {CPython, PyPy} x {2, 3} releases.
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '3.7'
|
|
|
|
env: 'TASK=test COVERAGE=1'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '2.7'
|
|
|
|
env: 'TASK=test COVERAGE=1'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: 'pypy3'
|
|
|
|
env: 'TASK=test COVERAGE=1'
|
2018-10-06 13:51:49 +00:00
|
|
|
# pypy3 not currently available on xenial
|
2018-12-29 18:13:04 +00:00
|
|
|
dist: 'trusty'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: 'pypy'
|
|
|
|
env: 'TASK=test COVERAGE=1'
|
2018-10-06 13:51:49 +00:00
|
|
|
# pypy not currently available on xenial
|
2018-12-29 18:13:04 +00:00
|
|
|
dist: 'trusty'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '3.8-dev'
|
|
|
|
env: 'TASK=test'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '3.6'
|
|
|
|
env: 'TASK=test'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '3.5'
|
|
|
|
env: 'TASK=test'
|
2018-11-23 01:36:17 +00:00
|
|
|
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '3.4'
|
|
|
|
env: 'TASK=test'
|
2017-11-16 20:44:51 +00:00
|
|
|
|
2017-11-21 03:27:26 +00:00
|
|
|
## macOS
|
2018-12-29 18:13:04 +00:00
|
|
|
- python: '2.7'
|
|
|
|
env: 'TASK=test TRAVIS_PYTHON_VERSION=2.7'
|
|
|
|
os: 'osx'
|
|
|
|
language: 'generic'
|
|
|
|
|
|
|
|
- python: '3.7'
|
|
|
|
env: 'TASK=test TRAVIS_PYTHON_VERSION=3.7'
|
|
|
|
os: 'osx'
|
|
|
|
language: 'generic'
|
2014-09-23 14:08:21 +00:00
|
|
|
|
2018-09-09 19:51:02 +00:00
|
|
|
## Other checks. Override "install", "before_install", and "script" to do each of these instead.
|
2018-12-29 18:13:04 +00:00
|
|
|
- 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=docs-build'
|
|
|
|
before_install: 'skip'
|
|
|
|
install: 'travis_retry pip install "Sphinx<2"' # keep in sync with the version in setup.py
|
|
|
|
script: './build-docs.sh'
|
|
|
|
|
|
|
|
- env: 'TASK=docs-linkcheck'
|
|
|
|
before_install: 'skip'
|
|
|
|
install: 'travis_retry pip install "Sphinx<2"' # keep in sync with the version in setup.py
|
|
|
|
script: '(cd docs && travis_retry make linkcheck)'
|
|
|
|
|
|
|
|
- env: 'TASK=flake8'
|
|
|
|
before_install: 'skip'
|
|
|
|
install: 'travis_retry pip install "flake8<3.7"' # 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.3" "hypothesis<4" "pytest<5"' # 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'
|
2018-03-27 09:40:42 +00:00
|
|
|
deploy:
|
2018-12-29 18:13:04 +00:00
|
|
|
- provider: 'pypi'
|
|
|
|
user: 'jab'
|
2018-03-27 09:40:42 +00:00
|
|
|
password:
|
2018-12-29 18:13:04 +00:00
|
|
|
secure: 'B9LLgXkTbtjeC/IbH4wh9PEBzvKEAuYo3EBNW5f1xuLqVqtsysIyxJa5ar/FQ4qwUCBwZPFAXFurN3lLzRhb2Tc04YQ0GYVv6f8lkzwrjoWau4iB9Qt/nnvdRa7KryEJvtenHCAnwoEUaADCjkZjwo6fIA0hEOLB6/AYfhfgXYA='
|
2018-03-27 09:40:42 +00:00
|
|
|
on:
|
|
|
|
tags: true
|
2018-11-23 01:36:17 +00:00
|
|
|
# Does this deploy all tags to PyPI, not just release tags?
|
|
|
|
# https://docs.travis-ci.com/user/deployment/pypi/ doesn't say.
|
2018-12-29 18:13:04 +00:00
|
|
|
distributions: 'sdist bdist_wheel'
|
2018-03-27 09:40:42 +00:00
|
|
|
|
2017-11-20 15:01:49 +00:00
|
|
|
|
2017-11-16 20:44:51 +00:00
|
|
|
before_cache:
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'rm -rf "$HOME"/.cache/pip/log'
|
2016-01-13 16:54:29 +00:00
|
|
|
|
2018-01-16 01:34:18 +00:00
|
|
|
|
2016-01-13 16:54:29 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
2018-12-29 18:13:04 +00:00
|
|
|
- '"$HOME"/.cache/pip'
|
|
|
|
- '"$HOME"/.hypothesis'
|
2014-12-17 23:47:48 +00:00
|
|
|
|
2015-03-22 18:21:15 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
webhooks:
|
|
|
|
urls:
|
2018-12-29 18:13:04 +00:00
|
|
|
- 'https://webhooks.gitter.im/e/bf64fb45a633c0935b9b'
|
2017-11-16 20:44:51 +00:00
|
|
|
email:
|
2018-12-29 18:13:04 +00:00
|
|
|
recipients: 'jab@math.brown.edu'
|