[PR #3076] [MERGED] chore: simplify website/ Python and polish sponsors section #11352

Closed
opened 2026-04-24 06:07:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vinta/awesome-python/pull/3076
Author: @vinta
Created: 4/19/2026
Status: Merged
Merged: 4/19/2026
Merged by: @vinta

Base: masterHead: chore/code-cleanup


📝 Commits (10+)

  • b897676 refactor(fetch_github_stars): remove redundant early-return guard in build_graphql_query
  • e47d229 refactor(readme_parser): consolidate state reset to tail of flush_group
  • a358d45 refactor: use datetime.UTC alias instead of timezone.utc
  • b9236c4 refactor(fetch_github_stars): drop unnecessary keyword-only marker on fetch_batch
  • c85f81b refactor(build): accept Path directly in build() signature
  • 7f4a163 refactor(build): tighten extract_entries parameter types to ParsedSection/ParsedGroup
  • 7e7de19 refactor(build): remove StarData TypedDict, loosen load_stars return to dict[str, dict]
  • e0b0dc9 refactor(readme_parser): add _href helper to narrow attrGet return type
  • 486fbf2 refactor(readme_parser): replace _find_first_link with _find_child(inline, "link")
  • 85b55ef refactor(readme_parser): inline _is_leading_link at its call site

📊 Changes

7 files changed (+116 additions, -190 deletions)

View changed files

📝 website/build.py (+38 -56)
📝 website/fetch_github_stars.py (+11 -15)
📝 website/readme_parser.py (+53 -70)
📝 website/static/style.css (+6 -19)
📝 website/templates/index.html (+0 -1)
📝 website/tests/test_build.py (+5 -25)
📝 website/tests/test_readme_parser.py (+3 -4)

📄 Description

Summary

  • Python simplifications in website/ (17 commits): deleted dead code, tightened types, modernized syntax. Tests: 117 → 113 (4 format_stars_short tests removed along with the inlined function). uvx ty check website/: 15 diagnostics → 0.
  • Sponsors section CSS polish (6 commits): bumped section heading size, removed decorative arrow from "Become a sponsor", switched border underline to text-decoration for tighter alignment.

Python cleanup highlights

  • Deleted dead helpers (_find_first_link, _is_leading_link, format_stars_short) and stale StarData TypedDict
  • Tightened extract_entries parameter types, build() now takes Path, load_stars returns dict[str, dict]
  • Added _href helper to narrow attrGet("href") return type
  • Swapped manual batching loop for itertools.batched (3.13 stdlib)
  • Cache-age check now uses timedelta instead of total_seconds()/3600
  • Collapsed render_inline_html/render_inline_text into a shared _render_inline helper
  • Fused _parse_sponsor_item double-walk into a single pass
  • datetime.now(timezone.utc)datetime.now(UTC)
  • Modernized test_readme_parser to use pathlib

Sponsors styling

  • .sponsor-meta .section-label: --text-sm--text-lg
  • Removed <span class="sponsor-become-arrow"> + orphaned CSS rules
  • .sponsor-become: border-bottom + padding-bottomtext-decoration: underline with text-underline-offset: 0.2em
  • Hover state on the underline uses --accent-underline (lighter tan)

Test plan

  • uv run pytest — 113 passing
  • uvx ty check website/ — all checks passed
  • Visually verify sponsors section in browser (make preview)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vinta/awesome-python/pull/3076 **Author:** [@vinta](https://github.com/vinta) **Created:** 4/19/2026 **Status:** ✅ Merged **Merged:** 4/19/2026 **Merged by:** [@vinta](https://github.com/vinta) **Base:** `master` ← **Head:** `chore/code-cleanup` --- ### 📝 Commits (10+) - [`b897676`](https://github.com/vinta/awesome-python/commit/b897676e01e4f24a9995dfda48d923eaea726ab3) refactor(fetch_github_stars): remove redundant early-return guard in build_graphql_query - [`e47d229`](https://github.com/vinta/awesome-python/commit/e47d22952862630b1636bb8a6fa322d93ee3d973) refactor(readme_parser): consolidate state reset to tail of flush_group - [`a358d45`](https://github.com/vinta/awesome-python/commit/a358d45ca48073932ce085a34ab691c8b36124d2) refactor: use datetime.UTC alias instead of timezone.utc - [`b9236c4`](https://github.com/vinta/awesome-python/commit/b9236c4925840d78bec05ea07783422fc7b34fac) refactor(fetch_github_stars): drop unnecessary keyword-only marker on fetch_batch - [`c85f81b`](https://github.com/vinta/awesome-python/commit/c85f81bb24530061373ae35adcbd46400f4912a4) refactor(build): accept Path directly in build() signature - [`7f4a163`](https://github.com/vinta/awesome-python/commit/7f4a163534b0fae0eb95947607c4aaa803372a5d) refactor(build): tighten extract_entries parameter types to ParsedSection/ParsedGroup - [`7e7de19`](https://github.com/vinta/awesome-python/commit/7e7de19ef6c3bcbebc4d2227755767ceff2430e2) refactor(build): remove StarData TypedDict, loosen load_stars return to dict[str, dict] - [`e0b0dc9`](https://github.com/vinta/awesome-python/commit/e0b0dc9c0af3177cb6397a1930a3cdeeb5d89f53) refactor(readme_parser): add _href helper to narrow attrGet return type - [`486fbf2`](https://github.com/vinta/awesome-python/commit/486fbf218505669474206d73ada2003100855418) refactor(readme_parser): replace _find_first_link with _find_child(inline, "link") - [`85b55ef`](https://github.com/vinta/awesome-python/commit/85b55efb2830471aa922648c6eefa6cbea58eaeb) refactor(readme_parser): inline _is_leading_link at its call site ### 📊 Changes **7 files changed** (+116 additions, -190 deletions) <details> <summary>View changed files</summary> 📝 `website/build.py` (+38 -56) 📝 `website/fetch_github_stars.py` (+11 -15) 📝 `website/readme_parser.py` (+53 -70) 📝 `website/static/style.css` (+6 -19) 📝 `website/templates/index.html` (+0 -1) 📝 `website/tests/test_build.py` (+5 -25) 📝 `website/tests/test_readme_parser.py` (+3 -4) </details> ### 📄 Description ## Summary - **Python simplifications in `website/` (17 commits)**: deleted dead code, tightened types, modernized syntax. Tests: 117 → 113 (4 `format_stars_short` tests removed along with the inlined function). `uvx ty check website/`: 15 diagnostics → 0. - **Sponsors section CSS polish (6 commits)**: bumped section heading size, removed decorative arrow from "Become a sponsor", switched border underline to text-decoration for tighter alignment. ### Python cleanup highlights - Deleted dead helpers (`_find_first_link`, `_is_leading_link`, `format_stars_short`) and stale `StarData` TypedDict - Tightened `extract_entries` parameter types, `build()` now takes `Path`, `load_stars` returns `dict[str, dict]` - Added `_href` helper to narrow `attrGet("href")` return type - Swapped manual batching loop for `itertools.batched` (3.13 stdlib) - Cache-age check now uses `timedelta` instead of `total_seconds()/3600` - Collapsed `render_inline_html`/`render_inline_text` into a shared `_render_inline` helper - Fused `_parse_sponsor_item` double-walk into a single pass - `datetime.now(timezone.utc)` → `datetime.now(UTC)` - Modernized `test_readme_parser` to use `pathlib` ### Sponsors styling - `.sponsor-meta .section-label`: `--text-sm` → `--text-lg` - Removed `<span class="sponsor-become-arrow">` + orphaned CSS rules - `.sponsor-become`: `border-bottom` + `padding-bottom` → `text-decoration: underline` with `text-underline-offset: 0.2em` - Hover state on the underline uses `--accent-underline` (lighter tan) ## Test plan - [x] `uv run pytest` — 113 passing - [x] `uvx ty check website/` — all checks passed - [ ] Visually verify sponsors section in browser (`make preview`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-24 06:07:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-python#11352