Merge branch 'fix-group-titles'

This commit is contained in:
Vinta Chen
2026-10-02 14:45:58 +08:00
3 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -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"
-1
View File
@@ -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" }
}
+4
View File
@@ -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 "<title>Python Web APIs Libraries - Awesome Python</title>" 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