From 8af0ae17cb317829ab10611fdd275d9e1ff73945 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 14:52:54 +0200 Subject: [PATCH 1/8] Fixing lychee links --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 936d1c81..e9e51ded 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,6 +97,7 @@ jobs: # - pathto(: because the pydata theme packages invalid HTML w/ this in it # - mybinder.org: because Binder sometimes incorrectly doesn't respond # - github.com/search: because GitHub search results return a network error + # - fastly: because these are programmatically generated links that break - name: Check for broken links id: lychee uses: lycheeverse/lychee-action@v1.4.1 @@ -114,6 +115,7 @@ jobs: --exclude 'pathto\(' --exclude 'mybinder.org' --exclude 'github.com/search' + --exclude 'fastly' - name: Audit with Lighthouse uses: treosh/lighthouse-ci-action@9.3.0 From 80d8b2d65514491ae29a30920fb12e747e418e01 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:03:24 +0200 Subject: [PATCH 2/8] fix lychee check --- .github/workflows/links.yml | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/links.yml diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 00000000..a9e28e7f --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,65 @@ + +name: linkcheck +on: + schedule: + # Run on the first day of each week + - cron: '0 0 * * 1' + workflow_dispatch: + +jobs: + # Build the docs and check for broken links. + linkcheck: + runs-on: ubuntu-latest + name: Build documentation and check links + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: "pip" + cache-dependency-path: "pyproject.toml" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e .[doc] + - name: Build documentation + run: > + sphinx-build -b html docs docs/_build/html -w warnings.txt + # Ref: https://github.com/lycheeverse/lychee-action + # Excluded files: + # - nature.com: DOI redirect works but errors anyway + # - doi.org: DOI redirect works but errors anyway + # - yahoo.com: Kitchen sink redirect we don't control + # - someurl: dummy url + # - mailto: fails test but works for people + # - pathto(: because the pydata theme packages invalid HTML w/ this in it + # - mybinder.org: because Binder sometimes incorrectly doesn't respond + # - github.com/search: because GitHub search results return a network error + # - fastly: because these are programmatically generated links that break + - name: Check for broken links + id: lychee + uses: lycheeverse/lychee-action@v1.4.1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + args: > + './docs/_build/html/**/*.html' + --exclude 'nature.com' + --exclude 'doi.org' + --exclude 'yahoo.com' + --exclude 'someurl' + --exclude 'mailto:docutils-develop' + --exclude 'pathto\(' + --exclude 'mybinder.org' + --exclude 'github.com/search' + --exclude 'fastly' + + + - name: Create Issue From File + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v3 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: bug, documentation From 8ef83b20f530cbcde9ae4287034b257543b59da7 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:33:07 +0200 Subject: [PATCH 3/8] fix linkcheck --- .github/workflows/links.yml | 65 ------------------------------------- .github/workflows/tests.yml | 38 ++++------------------ docs/conf.py | 5 +++ 3 files changed, 12 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/links.yml diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml deleted file mode 100644 index a9e28e7f..00000000 --- a/.github/workflows/links.yml +++ /dev/null @@ -1,65 +0,0 @@ - -name: linkcheck -on: - schedule: - # Run on the first day of each week - - cron: '0 0 * * 1' - workflow_dispatch: - -jobs: - # Build the docs and check for broken links. - linkcheck: - runs-on: ubuntu-latest - name: Build documentation and check links - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.9' - cache: "pip" - cache-dependency-path: "pyproject.toml" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[doc] - - name: Build documentation - run: > - sphinx-build -b html docs docs/_build/html -w warnings.txt - # Ref: https://github.com/lycheeverse/lychee-action - # Excluded files: - # - nature.com: DOI redirect works but errors anyway - # - doi.org: DOI redirect works but errors anyway - # - yahoo.com: Kitchen sink redirect we don't control - # - someurl: dummy url - # - mailto: fails test but works for people - # - pathto(: because the pydata theme packages invalid HTML w/ this in it - # - mybinder.org: because Binder sometimes incorrectly doesn't respond - # - github.com/search: because GitHub search results return a network error - # - fastly: because these are programmatically generated links that break - - name: Check for broken links - id: lychee - uses: lycheeverse/lychee-action@v1.4.1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - args: > - './docs/_build/html/**/*.html' - --exclude 'nature.com' - --exclude 'doi.org' - --exclude 'yahoo.com' - --exclude 'someurl' - --exclude 'mailto:docutils-develop' - --exclude 'pathto\(' - --exclude 'mybinder.org' - --exclude 'github.com/search' - --exclude 'fastly' - - - - name: Create Issue From File - if: steps.lychee.outputs.exit_code != 0 - uses: peter-evans/create-issue-from-file@v3 - with: - title: Link Checker Report - content-filepath: ./lychee/out.md - labels: bug, documentation diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9e51ded..d343daf7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -75,9 +75,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[doc] - - name: Build documentation + + - name: Check for broken links + run: > + sphinx-build -b linkcheck docs docs/_build/linkcheck -w + + - name: Build documentation to audit run: > sphinx-build -b html docs docs/_build/html -w warnings.txt + - name: Check that there are no unexpected warnings shell: python run: | @@ -87,36 +93,6 @@ jobs: unexpected = [ii for ii in text.split("\n") if "kitchen-sink" not in ii] assert len(unexpected) == 0 - # Ref: https://github.com/lycheeverse/lychee-action - # Excluded files: - # - nature.com: DOI redirect works but errors anyway - # - doi.org: DOI redirect works but errors anyway - # - yahoo.com: Kitchen sink redirect we don't control - # - someurl: dummy url - # - mailto: fails test but works for people - # - pathto(: because the pydata theme packages invalid HTML w/ this in it - # - mybinder.org: because Binder sometimes incorrectly doesn't respond - # - github.com/search: because GitHub search results return a network error - # - fastly: because these are programmatically generated links that break - - name: Check for broken links - id: lychee - uses: lycheeverse/lychee-action@v1.4.1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - fail: true - args: > - './docs/_build/html/**/*.html' - --exclude 'nature.com' - --exclude 'doi.org' - --exclude 'yahoo.com' - --exclude 'someurl' - --exclude 'mailto:docutils-develop' - --exclude 'pathto\(' - --exclude 'mybinder.org' - --exclude 'github.com/search' - --exclude 'fastly' - - name: Audit with Lighthouse uses: treosh/lighthouse-ci-action@9.3.0 with: diff --git a/docs/conf.py b/docs/conf.py index 5b6db00a..3ccd727d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -145,6 +145,11 @@ bibtex_reference_style = "author_year" bibtex_default_style = "plain" +linkcheck_ignore = [ + "http://someurl/release", # This is a fake link + "doi.org", # These don't resolve properly and cause SSL issues +] + # -- Download kitchen sink reference docs ------------------------------------- # These are the kitchen sink files used by the Sphinx Themes gallery at # https://github.com/sphinx-themes/sphinx-themes.org From 265c69016273ef852d61fddd9db2eeb0240ed402 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:37:50 +0200 Subject: [PATCH 4/8] fix linkcheck --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d343daf7..24bab17e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: - name: Check for broken links run: > - sphinx-build -b linkcheck docs docs/_build/linkcheck -w + sphinx-build -b linkcheck docs docs/_build/linkcheck - name: Build documentation to audit run: > From 475e5504cbc13acfe9203dc8b678cd03c14a5e4e Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:49:52 +0200 Subject: [PATCH 5/8] Colors output --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 24bab17e..0cf1fdc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,9 @@ on: - 'v*' pull_request: +env: + PY_COLORS: 1 + jobs: pre-commit: runs-on: ubuntu-latest From e0e390ee637d003884d6698f8488df94bed39055 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:55:52 +0200 Subject: [PATCH 6/8] Colorterm --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0cf1fdc5..b5cd8217 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,6 +9,7 @@ on: env: PY_COLORS: 1 + COLORTERM: True jobs: pre-commit: From 6754f878a6ec2ac47be075c3197b72759f527026 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 15:56:12 +0200 Subject: [PATCH 7/8] Fix link --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 3ccd727d..4e959e01 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -147,7 +147,7 @@ linkcheck_ignore = [ "http://someurl/release", # This is a fake link - "doi.org", # These don't resolve properly and cause SSL issues + "https://doi.org", # These don't resolve properly and cause SSL issues ] # -- Download kitchen sink reference docs ------------------------------------- From 80b01047dbfc7f2810fc1f9e83deb18041227db9 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Mon, 25 Apr 2022 16:02:48 +0200 Subject: [PATCH 8/8] Color --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b5cd8217..0ddf5b46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ on: env: PY_COLORS: 1 - COLORTERM: True + FORCE_COLOR: True jobs: pre-commit: