From 19e47a0023341b79e2299750f1bae4cd35accd79 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:50:05 -0600 Subject: [PATCH] Removed sitemap checking step in CI. --- .github/scripts/check_sitemap.py | 31 ------------------------------- .github/workflows/main.yml | 2 -- 2 files changed, 33 deletions(-) delete mode 100644 .github/scripts/check_sitemap.py diff --git a/.github/scripts/check_sitemap.py b/.github/scripts/check_sitemap.py deleted file mode 100644 index 26474827..00000000 --- a/.github/scripts/check_sitemap.py +++ /dev/null @@ -1,31 +0,0 @@ -import xml.etree.ElementTree as ET -import urllib.request - -NS = {"a": "http://www.sitemaps.org/schemas/sitemap/0.9"} -TOLERANCE = 0.8 - - -def discover_urls(): - tree = ET.parse("doc/build/html/sitemap.xml") - root = tree.getroot() - return [node.find("a:loc", NS).text for node in root.findall("a:url", NS)] - - -def test_urls(urls): - passed = 0 - for url in urls: - code = 404 - try: - code = urllib.request.urlopen(url).getcode() - except urllib.error.HTTPError as e: - print(url, e) - if code == 200: - passed += 1 - else: - print(url, code) - if passed / len(urls) < TOLERANCE: - raise ValueError(f"Too many URLs failed") - - -if __name__ == "__main__": - test_urls(discover_urls()) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c7f7ee9..ca008677 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -124,8 +124,6 @@ jobs: run: | cd doc make linkcheck - - name: test sitemap - run: python .github/scripts/check_sitemap.py doc-test: runs-on: ubuntu-latest