From eeb830e040dc7d3b28990e292e9674dbe07ca600 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 20 Apr 2016 22:35:02 +0200 Subject: [PATCH] travis: Ignore doc changes when building a PR Fixes #1441 --- scripts/dev/check_doc_changes.py | 7 +++++++ tox.ini | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/dev/check_doc_changes.py b/scripts/dev/check_doc_changes.py index 85991cc08..d072bfb65 100755 --- a/scripts/dev/check_doc_changes.py +++ b/scripts/dev/check_doc_changes.py @@ -22,8 +22,15 @@ import sys import subprocess +import os code = subprocess.call(['git', '--no-pager', 'diff', '--exit-code', '--stat']) + +if os.environ.get('TRAVIS_PULL_REQUEST', 'false') != 'false': + if code != 0: + print("Docs changed but ignoring change as we're building a PR") + sys.exit(0) + if code != 0: print() print('The autogenerated docs changed, please run this to update them:') diff --git a/tox.ini b/tox.ini index bf16b45cd..0bbac091e 100644 --- a/tox.ini +++ b/tox.ini @@ -190,13 +190,13 @@ commands = basepython = python3 skip_install = true whitelist_externals = git -passenv = +passenv = TRAVIS_PULL_REQUEST deps = -r{toxinidir}/requirements.txt commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} scripts/dev/src2asciidoc.py {posargs} - {envpython} scripts/dev/check_doc_changes.py + {envpython} scripts/dev/check_doc_changes.py {posargs} {envpython} scripts/asciidoc2html.py {posargs} [testenv:cxfreeze-windows]