From 5b17f46db1c4966d894324b33f96a1be056e02f4 Mon Sep 17 00:00:00 2001 From: abrichr Date: Sat, 10 Oct 2026 00:11:13 -0400 Subject: [PATCH] docs: show the PyPI badges in the README The README kept the PyPI version and downloads badges inside an HTML comment with a note to uncomment them once the package was published. The package has been on PyPI since 0.1.0, so the badges never showed and the note was out of date. The badges now sit with the License and Python badges, and the note is gone. A new test, tests/test_readme.py, fails if the note comes back or if either PyPI badge ends up inside an HTML comment. Ledger: B253 Co-Authored-By: Claude Opus 5.5 --- README.md | 3 --- tests/test_readme.py | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 tests/test_readme.py diff --git a/README.md b/README.md index 969d443..6610ef3 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,8 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/) - - Unified telemetry and error tracking for OpenAdapt packages. diff --git a/tests/test_readme.py b/tests/test_readme.py new file mode 100644 index 0000000..15bf09b --- /dev/null +++ b/tests/test_readme.py @@ -0,0 +1,24 @@ +"""Checks that the README matches the published state of the package.""" + +import re +from pathlib import Path + +README = Path(__file__).resolve().parent.parent / "README.md" +HTML_COMMENT = re.compile(r"", re.DOTALL) + + +def _visible_readme() -> str: + """Return the README text with HTML comments removed.""" + return HTML_COMMENT.sub("", README.read_text(encoding="utf-8")) + + +def test_readme_does_not_say_package_is_unpublished(): + """The package is on PyPI, so no note may say it isn't yet.""" + assert "uncomment once package is published" not in README.read_text(encoding="utf-8") + + +def test_readme_shows_pypi_badges(): + """The PyPI version and downloads badges render (are not inside a comment).""" + visible = _visible_readme() + assert "img.shields.io/pypi/v/openadapt-telemetry" in visible + assert "img.shields.io/pypi/dm/openadapt-telemetry" in visible