summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Schroeder <st.schroeder@gmail.com>2019-07-13 16:06:56 +0200
committerSteffen Schroeder <st.schroeder@gmail.com>2019-11-06 20:54:41 +0100
commit1cecdf66198049c7ca48356d8349e2f07732764c (patch)
treebff4b57311fa172bd0f614c91c5647c949ee5252
parent85288b53218d4e0037dce9c34bd37f86fa9e212d (diff)
downloadpytest-1cecdf66198049c7ca48356d8349e2f07732764c.tar.gz
Added checklinks to tox and release.py
-rw-r--r--doc/en/conf.py13
-rw-r--r--scripts/release.py7
-rw-r--r--tox.ini9
3 files changed, 29 insertions, 0 deletions
diff --git a/doc/en/conf.py b/doc/en/conf.py
index 1a6ef7ca8..c0c71cf05 100644
--- a/doc/en/conf.py
+++ b/doc/en/conf.py
@@ -112,6 +112,19 @@ pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
+# A list of regular expressions that match URIs that should not be checked when
+# doing a linkcheck.
+linkcheck_ignore = [
+ "https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations",
+ "https://blogs.msdn.microsoft.com/bharry/2017/06/28/testing-in-a-cloud-delivery-cadence/",
+ "http://pythontesting.net/framework/pytest-introduction/",
+ r"https://github.com/pytest-dev/pytest/issues/\d+",
+ r"https://github.com/pytest-dev/pytest/pull/\d+",
+]
+
+# The number of worker threads to use when checking links (default=5).
+linkcheck_workers = 5
+
# -- Options for HTML output ---------------------------------------------------
diff --git a/scripts/release.py b/scripts/release.py
index 5009df359..884d9bfb1 100644
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -79,12 +79,19 @@ def fix_formatting():
call(["pre-commit", "run", "--all-files"])
+def check_links():
+ """Runs sphinx-build to check links"""
+ print(f"{Fore.CYAN}[generate.check_links] {Fore.RESET}Checking links")
+ check_call(["tox", "-e", "docs-checklinks"])
+
+
def pre_release(version):
"""Generates new docs, release announcements and creates a local tag."""
announce(version)
regen()
changelog(version, write_out=True)
fix_formatting()
+ check_links()
msg = "Preparing release version {}".format(version)
check_call(["git", "commit", "-a", "-m", msg])
diff --git a/tox.ini b/tox.ini
index b03941657..d1a34c264 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,6 +15,7 @@ envlist =
doctesting
py37-freeze
docs
+ docs-checklinks
[testenv]
commands =
@@ -66,6 +67,14 @@ deps = -r{toxinidir}/doc/en/requirements.txt
commands =
sphinx-build -W -b html . _build
+[testenv:docs-checklinks]
+basepython = python3
+usedevelop = True
+changedir = doc/en
+deps = -r{toxinidir}/doc/en/requirements.txt
+commands =
+ sphinx-build -W --keep-going -b linkcheck . _build
+
[testenv:doctesting]
basepython = python3
skipsdist = True