From 01f0e5ac67fdb8c1835705e8e7fc78fbca1035fe Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:24:27 -0800 Subject: [PATCH 1/3] Graduates wall: the most recent graduate first, and say so The README strip already showed the newest first; the wall page sorted by username. Both now order photos (and the wall's table) by when each graduation was merged, and say 'the most recent first'. Co-Authored-By: Claude Opus 5.5 --- tests/test_check_graduate.py | 12 ++++++++++++ tools/graduates_wall.py | 21 +++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/tests/test_check_graduate.py b/tests/test_check_graduate.py index 3a8aa71..28ac719 100644 --- a/tests/test_check_graduate.py +++ b/tests/test_check_graduate.py @@ -156,6 +156,7 @@ def test_front_page_strip_shows_the_newest_and_links_to_the_wall(tmp_path, monke monkeypatch.setattr(wall, "added_time", lambda path: int(path.stem[4:])) # user34 is the newest block = wall.strip(tmp_path) assert f"**{wall.STRIP_MAX + 5} graduates**" in block and "[See the wall](graduates/)" in block + assert f"Here are the {wall.STRIP_MAX} most recent, newest first." in block assert block.count(" wall.added_time(tmp_path / "late.py") block = wall.strip(tmp_path) assert block.index("early.png") < block.index("late.png"), "merged last, shown first" + + +def test_the_wall_shows_the_newest_first_and_says_so(tmp_path, monkeypatch): + for login in ("anna", "zed"): + (tmp_path / f"{login}.py").write_text(GOOD.replace('"ada"', f'"{login}"')) + monkeypatch.setattr(wall, "added_time", lambda path: {"anna": 1, "zed": 2}[path.stem]) # zed is the newest + page = wall.render(tmp_path) + assert "**2 graduates**, the most recent first." in page + assert page.index("zed.png") < page.index("anna.png"), "photos: newest first" + assert page.index("[@zed]") < page.index("[@anna]"), "table: newest first" + assert "The most recent is first." in wall.strip(tmp_path) diff --git a/tools/graduates_wall.py b/tools/graduates_wall.py index 9066e07..9e21775 100644 --- a/tools/graduates_wall.py +++ b/tools/graduates_wall.py @@ -95,12 +95,17 @@ def graduates(folder: Path) -> list[Graduate]: return out +def newest_first(people: list[Graduate]) -> list[Graduate]: + """The most recently merged graduate first; usernames break ties.""" + return sorted(people, key=lambda g: (-g.added, g.login.lower())) + + def rows(folder: Path) -> list[str]: return [ f"| {escape(g.name)} | [@{g.login}](https://github.com/{g.login}) " f"| [{g.owner}/{g.repo}#{g.number}](https://github.com/{g.owner}/{g.repo}/pull/{g.number}) " f"| {escape(g.message)} |" - for g in graduates(folder) + for g in newest_first(graduates(folder)) ] @@ -123,8 +128,8 @@ def render(folder: Path) -> str: return HEADER + "No graduates yet. You could be the first!\n" return ( HEADER - + f"**{count(len(people))}**\n\n" - + photos(people, 64) + + f"**{count(len(people))}**, the most recent first.\n\n" + + photos(newest_first(people), 64) + "\n\n| Name | GitHub | Contribution | Message |\n|---|---|---|---|\n" + "\n".join(rows(folder)) + "\n" @@ -137,11 +142,15 @@ def strip(folder: Path) -> str: join = "[Join them](lessons/15-capstone/)" if not people: return f"No graduates yet. You could be the first! {join}.\n" - newest = sorted(people, key=lambda g: (-g.added, g.login.lower()))[:STRIP_MAX] - more = f" These are the {STRIP_MAX} most recent." if len(people) > STRIP_MAX else "" + newest = newest_first(people)[:STRIP_MAX] + order = ( + f"Here are the {STRIP_MAX} most recent, newest first." + if len(people) > STRIP_MAX + else "The most recent is first." + ) return ( f"**{count(len(people))}** finished the course with a pull request merged in a real open source " - f"project.{more} [See the wall](graduates/) · {join}\n\n" + photos(newest, 48) + "\n" + f"project. {order} [See the wall](graduates/) · {join}\n\n" + photos(newest, 48) + "\n" ) From dd703f7716f6ada022a54862bb0fde0a3917a139 Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:25:18 -0800 Subject: [PATCH 2/3] README and wall: the most recent graduate first Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- graduates/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3dc407e..f7024c9 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ a key, add `--voice Aman` to narrate with a macOS voice instead. ## Graduates -**3 graduates** finished the course with a pull request merged in a real open source project. [See the wall](graduates/) · [Join them](lessons/15-capstone/) +**3 graduates** finished the course with a pull request merged in a real open source project. The most recent is first. [See the wall](graduates/) · [Join them](lessons/15-capstone/) @divya0795 @karthikaun diff --git a/graduates/README.md b/graduates/README.md index 5b38430..73426d0 100644 --- a/graduates/README.md +++ b/graduates/README.md @@ -6,7 +6,7 @@ merged in a real open source project. See This page is generated by `tools/graduates_wall.py`. Don't edit it by hand. -**3 graduates** +**3 graduates**, the most recent first. @divya0795 @karthikaun From 16ccc3d32026525487f8d32f8d3b47d6bc52708d Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:25:18 -0800 Subject: [PATCH 3/3] Remove the test graduation for karthikaun It linked a test project made only to try the graduation flow. Co-Authored-By: Claude Opus 5.5 --- README.md | 3 +-- graduates/README.md | 4 +--- graduates/karthikaun.py | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 graduates/karthikaun.py diff --git a/README.md b/README.md index f7024c9..2e60cbb 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,9 @@ a key, add `--voice Aman` to narrate with a macOS voice instead. ## Graduates -**3 graduates** finished the course with a pull request merged in a real open source project. The most recent is first. [See the wall](graduates/) · [Join them](lessons/15-capstone/) +**2 graduates** finished the course with a pull request merged in a real open source project. The most recent is first. [See the wall](graduates/) · [Join them](lessons/15-capstone/) @divya0795 -@karthikaun @thejesh23 diff --git a/graduates/README.md b/graduates/README.md index 73426d0..b771b14 100644 --- a/graduates/README.md +++ b/graduates/README.md @@ -6,14 +6,12 @@ merged in a real open source project. See This page is generated by `tools/graduates_wall.py`. Don't edit it by hand. -**3 graduates**, the most recent first. +**2 graduates**, the most recent first. @divya0795 -@karthikaun @thejesh23 | Name | GitHub | Contribution | Message | |---|---|---|---| | Divya | [@divya0795](https://github.com/divya0795) | [psf/black#5711](https://github.com/psf/black/pull/5711) | Made Black reject --line-ranges for notebooks detected by their .ipynb extension. | -| Karthik | [@karthikaun](https://github.com/karthikaun) | [thejesh23/capstone-test-project#1](https://github.com/thejesh23/capstone-test-project/pull/1) | Fixed a typo in a greeting script \(a test of the graduation flow\). | | Thejesh | [@thejesh23](https://github.com/thejesh23) | [python/cpython#162029](https://github.com/python/cpython/pull/162029) | My first CPython fix, in the json module. | diff --git a/graduates/karthikaun.py b/graduates/karthikaun.py deleted file mode 100644 index 4f07d0c..0000000 --- a/graduates/karthikaun.py +++ /dev/null @@ -1,4 +0,0 @@ -name = "Karthik" -github = "karthikaun" -pr = "https://github.com/thejesh23/capstone-test-project/pull/1" -message = "Fixed a typo in a greeting script (a test of the graduation flow)."