From 6093679023ad1686f67db11b8408478989b6b528 Mon Sep 17 00:00:00 2001 From: Nathaniel Starkman Date: Sun, 4 Oct 2020 18:21:33 -0400 Subject: [PATCH] add linkcheck add linkcheck to cron changelog Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com> Signed-off-by: Nathaniel Starkman --- TEMPLATE_CHANGES.md | 2 ++ {{ cookiecutter.package_name }}/.travis.yml | 12 ++++++++++++ {{ cookiecutter.package_name }}/docs/conf.py | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/TEMPLATE_CHANGES.md b/TEMPLATE_CHANGES.md index b46cec66..d0a571d6 100644 --- a/TEMPLATE_CHANGES.md +++ b/TEMPLATE_CHANGES.md @@ -18,6 +18,8 @@ be copied over manually if desired. - Refactored the template to follow the recommendations in APE 17: https://github.com/astropy/astropy-APEs/blob/master/APE17.rst [#438] +- Added cron job for RST link checking [#482] + 2.1 (unreleased) ---------------- diff --git a/{{ cookiecutter.package_name }}/.travis.yml b/{{ cookiecutter.package_name }}/.travis.yml index 9a9ff10e..c3ea57e3 100644 --- a/{{ cookiecutter.package_name }}/.travis.yml +++ b/{{ cookiecutter.package_name }}/.travis.yml @@ -127,6 +127,17 @@ matrix: stage: Initial tests env: TOXENV=codestyle + # Run documentation link check in a cron job. + - language: python + python: 3.8 + name: Documentation link check + stage: Cron tests + env: TOXENV=linkcheck + addons: + apt: + packages: + - graphviz + allow_failures: # Do a PEP8 test with flake8 # (do allow to fail unless your code completely compliant) @@ -136,6 +147,7 @@ matrix: # stage: Initial tests # env: TOXENV=codestyle + before_install: # Create a coverage.xml for use by coveralls or codecov - if [[ $TOXENV == *-cov ]]; then diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index a3e9af02..5f6f80f8 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -169,6 +169,15 @@ # -- Resolving issue number to links in changelog ----------------------------- github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project']) + +# -- Options for linkcheck output ------------------------------------------- +linkcheck_retry = 5 +linkcheck_ignore = [ + r'https://github\.com/{{ cookiecutter.github_project }}/(?:issues|pull)/\d+', +] +linkcheck_timeout = 180 +linkcheck_anchors = False + # -- Turn on nitpicky mode for sphinx (to warn about references not found) ---- # # nitpicky = True