From 775caf6a1e0db2db7b1ab1da4cf082d2897d6874 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Fri, 2 Oct 2026 14:45:44 +0800 Subject: [PATCH 1/2] fix: stop repeating Python in group page titles Group pages whose names start with "Python" got titles like "Python Python Language Libraries" in the title, og:title, and JSON-LD name. Co-Authored-By: Claude --- website/build.py | 3 ++- website/tests/test_build.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/website/build.py b/website/build.py index 11a6e706..f1e831e3 100644 --- a/website/build.py +++ b/website/build.py @@ -233,7 +233,8 @@ def category_meta_title(name: str, parent_name: str | None = None) -> str: return f"{name} - Awesome Python" # Names ending in one of these nouns already say what the entries are. noun = "" if name.rsplit(" ", 1)[-1] in PLURAL_NOUNS else " Libraries" - title = f"Python {name}{noun} - Awesome Python" + prefix = "" if name.startswith("Python ") else "Python " + title = f"{prefix}{name}{noun} - Awesome Python" if len(title) <= 60: return title return f"{name} - Awesome Python" diff --git a/website/tests/test_build.py b/website/tests/test_build.py index b1592450..83a332bf 100644 --- a/website/tests/test_build.py +++ b/website/tests/test_build.py @@ -14,6 +14,7 @@ from build import ( TemplateEntry, annotate_entries_with_stats, build, + category_meta_title, detect_source_type, extract_entries, extract_github_repo, @@ -784,6 +785,9 @@ class TestBuild: assert graph["CollectionPage"]["name"] == "Python Web Frameworks" assert "Python Web APIs Libraries - Awesome Python" in apis_html + def test_category_title_does_not_repeat_leading_python(self): + assert category_meta_title("Python Language") == "Python Language Libraries - Awesome Python" + def test_build_creates_subcategory_pages(self, tmp_path): readme = textwrap.dedent("""\ # T From d3a685415b7d297c95e86887664ace446c9466d0 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Fri, 2 Oct 2026 14:45:44 +0800 Subject: [PATCH 2/2] refactor: remove unused warehouse PyPI override Co-Authored-By: Claude --- website/data/pypi_name_overrides.json | 1 - 1 file changed, 1 deletion(-) diff --git a/website/data/pypi_name_overrides.json b/website/data/pypi_name_overrides.json index bc30a1e7..b379749d 100644 --- a/website/data/pypi_name_overrides.json +++ b/website/data/pypi_name_overrides.json @@ -41,7 +41,6 @@ "trailofbits-skills": { "package": null, "reason": "agent skills repo, not a package" }, "unittest-mock": { "package": null, "reason": "stdlib module" }, "uv-audit": { "package": null, "reason": "part of uv (the `uv audit` subcommand); PyPI uv-audit is an unrelated third-party tool by rocshers" }, - "warehouse": { "package": null, "reason": "the PyPI server itself; deployed, not pip-installed" }, "winpython": { "package": null, "reason": "distribution with its own installer; PyPI name is a 2012 relic" }, "zoneinfo": { "package": null, "reason": "stdlib module" } }