Skip to content

Commit

Permalink
Added checklinks to tox and release.py
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenschroeder committed Sep 21, 2019
1 parent 1b4ad77 commit d789f2e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@
# 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 ---------------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ envlist =
doctesting
py37-freeze
docs
docs-checklinks

[testenv]
commands =
Expand Down Expand Up @@ -64,6 +65,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
Expand Down

0 comments on commit d789f2e

Please sign in to comment.