File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 2424 name : ${{ matrix.noxenv }}
2525 if : ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }}
2626 runs-on : ubuntu-latest
27+ timeout-minutes : 20
2728 strategy :
2829 matrix :
2930 noxenv :
4748 python -m pip install --upgrade nox virtualenv
4849
4950 - name : Nox ${{ matrix.noxenv }}
51+ env :
52+ # Authenticate github.com requests during linkcheck to avoid rate limits.
53+ GITHUB_TOKEN : ${{ github.token }}
5054 run : |
5155 python -m nox -s ${{ matrix.noxenv }}
5256
Original file line number Diff line number Diff line change 161161 # Ref: https://github.com/pypa/packaging.python.org/issues/1998
162162 r"https://blog\.ganssle\.io/.*" ,
163163]
164- linkcheck_retries = 5
164+ linkcheck_retries = 2
165+ linkcheck_timeout = 30
165166# Ignore anchors for common targets when we know they likely won't be found
166167linkcheck_anchors_ignore_for_url = [
167168 # GitHub synthesises anchors in JavaScript, so Sphinx can't find them in the HTML
171172 # https://github.com/pypa/packaging.python.org/issues/1744
172173 r"https://pypi\.org/" ,
173174]
175+ # Authenticate requests to github.com (when a token is available) to avoid
176+ # unauthenticated rate limits that can stall linkcheck for hours on CI.
177+ if _gh_token := os .getenv ("GITHUB_TOKEN" ):
178+ linkcheck_request_headers = {
179+ "https://github.com/" : {"Authorization" : f"Bearer { _gh_token } " },
180+ "https://api.github.com/" : {"Authorization" : f"Bearer { _gh_token } " },
181+ }
174182
175183# -- Options for extlinks ----------------------------------------------------------
176184# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html#configuration
You can’t perform that action at this time.
0 commit comments