Added checklinks to tox and release.py
This commit is contained in:
parent
85288b5321
commit
1cecdf6619
|
@ -112,6 +112,19 @@ pygments_style = "sphinx"
|
||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
# modindex_common_prefix = []
|
# 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 ---------------------------------------------------
|
# -- Options for HTML output ---------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -79,12 +79,19 @@ def fix_formatting():
|
||||||
call(["pre-commit", "run", "--all-files"])
|
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):
|
def pre_release(version):
|
||||||
"""Generates new docs, release announcements and creates a local tag."""
|
"""Generates new docs, release announcements and creates a local tag."""
|
||||||
announce(version)
|
announce(version)
|
||||||
regen()
|
regen()
|
||||||
changelog(version, write_out=True)
|
changelog(version, write_out=True)
|
||||||
fix_formatting()
|
fix_formatting()
|
||||||
|
check_links()
|
||||||
|
|
||||||
msg = "Preparing release version {}".format(version)
|
msg = "Preparing release version {}".format(version)
|
||||||
check_call(["git", "commit", "-a", "-m", msg])
|
check_call(["git", "commit", "-a", "-m", msg])
|
||||||
|
|
9
tox.ini
9
tox.ini
|
@ -15,6 +15,7 @@ envlist =
|
||||||
doctesting
|
doctesting
|
||||||
py37-freeze
|
py37-freeze
|
||||||
docs
|
docs
|
||||||
|
docs-checklinks
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
commands =
|
commands =
|
||||||
|
@ -66,6 +67,14 @@ deps = -r{toxinidir}/doc/en/requirements.txt
|
||||||
commands =
|
commands =
|
||||||
sphinx-build -W -b html . _build
|
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]
|
[testenv:doctesting]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
Loading…
Reference in New Issue