Skip to content

Commit 53b88f4

Browse files
Added checklinks to tox and release.py
Following pytest-dev#1722 this will check all links in documentation.
1 parent 6afbac2 commit 53b88f4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

scripts/release.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,19 @@ def fix_formatting():
7979
call(["pre-commit", "run", "--all-files"])
8080

8181

82+
def check_links():
83+
"""Runs sphinx-build -W -b linkcheck to check external links"""
84+
print(f"{Fore.CYAN}[generate.check_links] {Fore.RESET}Checking links")
85+
check_call(["tox", "-e", "docs-checklinks"])
86+
87+
8288
def pre_release(version):
8389
"""Generates new docs, release announcements and creates a local tag."""
8490
announce(version)
8591
regen()
8692
changelog(version, write_out=True)
8793
fix_formatting()
94+
check_links()
8895

8996
msg = "Preparing release version {}".format(version)
9097
check_call(["git", "commit", "-a", "-m", msg])

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ envlist =
1515
doctesting
1616
py37-freeze
1717
docs
18+
docs-checklinks
1819

1920
[testenv]
2021
commands =
@@ -65,6 +66,14 @@ deps = -r{toxinidir}/doc/en/requirements.txt
6566
commands =
6667
sphinx-build -W -b html . _build
6768

69+
[testenv:docs-checklinks]
70+
basepython = python3
71+
usedevelop = True
72+
changedir = doc/en
73+
deps = -r{toxinidir}/doc/en/requirements.txt
74+
commands =
75+
sphinx-build -W -b linkcheck . _build
76+
6877
[testenv:doctesting]
6978
basepython = python3
7079
skipsdist = True

0 commit comments

Comments
 (0)