mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-06 17:05:16 +08:00
Merge branch 'fix-group-titles'
This commit is contained in:
+2
-1
@@ -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"
|
||||
|
||||
@@ -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" }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user