Skip to content

Add a v0 notes format, checker, and examples - #33

Merged
patrickballard merged 5 commits into
wheelgap:mainfrom
sarankumar1325:feat/notes-knowledge-base-v0
Nov 11, 2026
Merged

patrickballard merged 5 commits into
wheelgap:mainfrom
sarankumar1325:feat/notes-knowledge-base-v0

Conversation

@sarankumar1325

Copy link
Copy Markdown
Contributor

Summary

The nightly scan can say that a wheel is missing. It cannot say what to do about it: install a binary extra, add a system library first, or follow an upstream issue. This is the v0 knowledge-base format proposed in #27, so notes can start landing before they are shown on the site (#28).

  • One TOML file per package, notes/<normalized-name>.toml, parsed with the standard library (tomllib).
  • scripts/check_notes.py (stdlib only) rejects a file that does not parse, whose name is not a normalized package name, or whose notes have a bad kind, unknown platforms (must be a platform from data/coverage.json, or ["all"]), empty or over-500-character text, non-https links, or a missing date for updated.
  • The Check workflow now runs the checker on every pull request, in addition to the existing pytest job.
  • notes/README.md documents the fields. Three real starter notes, each with a link that backs the claim:
    • psycopg2: official psycopg2-binary / psycopg[binary] alternative
    • mysqlclient: libmysqlclient headers before building the sdist
    • pycrypto: unmaintained; use PyCryptodome
  • Tests in tests/test_check_notes.py cover the error cases, and they also run the checker against the real notes/ and data/coverage.json.

Showing notes in the per-package JSON and on package pages is left to #28. Notes are not published by this change; only the format, the checker, and the first examples are.

Closes #27.

Tests

  • python3 scripts/check_notes.py (the real notes, against data/coverage.json)
  • python3 -m unittest discover -s tests — 46 passed (18 new in test_check_notes.py)

sarankumar1325 and others added 5 commits November 11, 2026 08:46
Introduce notes/<normalized-name>.toml for package knowledge that
the nightly scan cannot infer, with a stdlib checker, tests, and a
Check workflow step. Closes wheelgap#27.

Signed-off-by: sarankumar1325 <[email protected]>
The psycopg2, mysqlclient and pycrypto notes now list only the targets
where the package lacks a wheel and the advice helps, checked against
data/coverage.json, the PyPI file lists and the upstream docs.

check_notes.py rejects unknown keys, versions that aren't a PEP 440
specifier, datetimes in updated, non-UTF-8 files and text of 500
characters or more, and requires a normalized file name. Tests and
notes/README.md cover the new rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
versions is now a small PEP 440 subset: comma-separated ==, !=, <=, >=,
<, > clauses over plain N(.N)* releases, with .* only after == or !=.

The checker also reports non-file and non-.toml entries in notes/,
links without an https host or with whitespace, duplicate platforms and
links, "all" mixed with other platforms, missing required keys,
multi-line text and future updated dates, and suggests the normalized
file name. notes/README.md says what text may contain and how notes
retire. The pycrypto note says pycryptodome has no free-threaded 3.14
wheels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	README.md
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @sarankumar1325! The notes knowledge base now has its format and its checker. Because notes will be shown to users, this got three review passes, two from a second model. I pushed these changes:

  • Example notes, checked against PyPI's file lists and coverage.json:

    • psycopg2 does have win-amd64 wheels, so its note now lists only the platforms where psycopg2-binary / psycopg[binary] actually help, and quotes the docs on -binary being for development.
    • mysqlclient's note covers Linux only (Windows has wheels), with the README's exact package commands.
    • The pycrypto note now says pycryptodome has no free-threaded 3.14 wheels.
  • versions is a narrow v0 subset: ==, !=, <=, >=, < and >, with ASCII N(.N)* versions and .* only after ==/!=. That way Show notes in the per-package data and on package pages, with an "add a note" link #28 can match it without packaging.

  • Checker: it now rejects:

    • unknown or missing keys, duplicates and future dates;
    • datetimes passed as dates;
    • links with no host;
    • files that aren't UTF-8, and anything in notes/ that isn't a .toml file;
    • text of 500 characters or more, or with newlines.

    It also has a clearer message for all mixed with other platforms.

  • README: merged with main's README, which had just gained the upstream how-to.

If you'd like another one, #28 is next: showing these notes in the per-package data and on package pages.

(Review assisted by Claude.)

@patrickballard
patrickballard merged commit ae6bb26 into wheelgap:main Nov 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Knowledge base v0: notes/ files, a checker, and a check on every PR

2 participants