Repository navigation
Required plugin settings (M5 part 2a) - #241
Merged
Merged
Conversation
Plugins can mark a setting as required with paperpi.plugin.setting(..., required=True). A switched-on plugin that is missing one is not shown and not counted as broken; the config check warns and paperpi list shows "needs <settings>". met_no and moon_phase require lat, lon and email (met.no's terms of service ask for a real email address); the example config no longer fills in a made-up address. Part of #238 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
txoof
previously approved these changes
Oct 7, 2026
# Conflicts: # src/paperpi/plugins/default/README.md # src/paperpi/plugins/default/__init__.py # src/paperpi/scheduler.py
Collaborator
Author
|
Merged
All tests pass (1258); CI green. #244 and #245 have the same merges. |
…ettings # Conflicts: # src/paperpi/plugins/splash_screen/README.md # src/paperpi/scheduler.py
txoof
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #238 (M5 web interface, part 2a)
What changed
Plugins can now mark a setting as required: a setting the plugin can't work without, such as a place, an email address or an API key. Agreed with txoof in the terminal on 2026-10-07 (option B).
paperpi.plugin.setting(default, required=True, ...): pydantic'sFieldplus PaperPi's own options. This is the one standard place for a setting's options; later ones (the weblocationhelper that looks up latitude and longitude, part 3c) go here too. A required setting's default must be "not set" (None, empty text or an empty secret), or the plugin is refused as broken.paperpi listshowsneeds emailin its "on" column, andpaperpi runcounts only the plugins it shows. Filling the setting in and reloading starts the plugin.lat,lonandemail. met.no's terms of service ask for a real email address.paperpi render --livestops early and names the missing settings.Choices I made without asking (please check):
you@example.com: that made-up address would be sent to met.no. The example still loads without errors, but the two weather blocks are not shown (and warn) until you fill inemail. README andconfig-format.mdsay so.defaultplugin's message for "nothing to show" is now "No plugins are ready to show." (was "No plugins are switched on."), because a plugin can be switched on and still wait for its settings.Docs:
docs/writing-plugins.md, update notes indocs/decisions/plugin-interface.md,config-format.md,live-config-reload.md; README; met_no and moon_phase READMEs.Next parts (listed in #238): 2b Active Plugins + Plugin Library pages (shows "Needs settings" in place of the on switch), 3a settings form, 3b Preview, 3c location lookup, 4, 5.
Note for after the splash_screen PR (#236) merges: its texts say "no plugin is switched on"; they should say "no plugin is ready to show". Its code needs no change (it uses the scheduler's list, which already leaves these plugins out).
Area
core (
src/paperpi/plugin.py,config.py,scheduler.py,cli.py,example.py), plugins/met_no, plugins/moon_phase, plugins/default, docs,paperpi.example.toml.config.pyandplugin.pyare shared files: the only other open PR changing them is #236 (adds one[display]setting; no overlap withPluginEntry).Tests
New tests for
setting()/is_set/missing, the config warning and its line, the scheduler (not updated; starts after the email is filled in; leaves the screen when the email is removed; default plugin when every plugin waits),paperpi list(needs lat, lon, emailvsno), thepaperpi runcount,render --live, and the example's "(required)" comments.uv run pytestpasses (1123 passed)uv run ruff check .passesReview
setting()keeps otherjson_schema_extravalues, needs a default, andis_requiredsurvives a wrongly shaped option; screen message and docstrings; plain wording in docs; tests for the run count, list, reload and default screen. Not done here: on screen nothing says that a plugin waits for settings while others run (part 2b shows it in the web interface);webrequeststill sends the email in the User-Agent after a redirect to another server (older code, small risk, separate follow-up).Only txoof approves and merges this PR.
🤖 Generated with Claude Code