README: tells authors to call postulo.plugins.http.client(), which the surface check refuses, and omits the distribution name from the rename steps #10
Labels
No labels
bug
documentation
enhancement
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-helloworld#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo-helloworld at
19f0bcc29, reading the README against the code and tests it describes.This is the repository people copy, and its README gives two instructions that the repository's own code contradicts. One names a module past the plugin surface in the sentence after the rule that forbids it. The other leaves a renamed copy unable to import.
1.
postulo.plugins.http.client()is past the surfaceREADME.md:82-85, under "Rules worth keeping". Line 82 says "Importpostulo.plugins.apiand nothing else from Postulo."; line 84 says "Usepostulo.plugins.http.client()for every request". The same sentence is in the wiki,Writing-a-plugin.md:332(postulo.wiki at de1f52467).clienthas been onpostulo.plugins.apisince postulo/postulo#229 (it is inapi.__all__), andsrc/postulo_helloworld/notifier.py:11already names it correctly aspostulo.plugins.api.client(). An author who follows the README writesfrom postulo.plugins.http import client;tests/test_surface.py:39then fails with "reaches past the plugin surface: ['postulo.plugins.http']" (checked by runningassert_imports_only_the_surfacefrom the core snapshot over a one-line package).allowedentry for a module that needs none, or a deleted test.postulo.plugins.api.client()inREADME.md:84, and inWriting-a-plugin.md:332in the wiki.#1 and #3 (both closed) moved the code and the test to the surface; this line of the README was left behind.
2. "Make it yours" does not mention the distribution name
README.md:42-45(steps 1 to 3);src/postulo_helloworld/__init__.py:27;pyproject.toml:2andpyproject.toml:40;tests/test_surface.py:29.postulo_helloworldto your package" and step 3 to change the entry points. Nothing says to change[project] name, yetpostulo-messagesin step 4 requires it:core/messages_tool.py:83(use) finds the package as the project's name with hyphens as underscores, undersrc/. Once the project is renamed,__version__ = version("postulo-helloworld")raisesPackageNotFoundErroron import, because that string is the old distribution's name and the line has no fallback (postulo-paperless,postulo-imap,postulo-davandpostulo-mcpeach catch it). The comment above it, "the metadata is always there", holds only while the two names match. If the originalpostulo-helloworldhappens to be installed beside the copy, nothing raises and the copy reports the wrong plugin's version instead.[project] nameand[tool.hatch.build.targets.wheel] packagesinpyproject.toml, the string in__init__.py, andPACKAGEintests/test_surface.py. Better, remove the string to forget: derive the version from the distribution that provides the package (importlib.metadata.packages_distributions()[__name__][0]), so a rename needs no edit there.Done when
README.mdand the wiki namepostulo.plugins.api.client(), and a test intests/test_surface.pyfails ifREADME.mdmentions anypostulo.module other thanpostulo.plugins.apiandpostulo.plugins.testingas something to import or call.tests/test_helloworld.pyasserts that the name passed toversion()insrc/postulo_helloworld/__init__.pyequals[project] nameinpyproject.toml(or the string is gone), and step 1 of "Make it yours" names every file a rename touches.