feat: add env plugin for filling fields from environment variables#83
Closed
henryiii wants to merge 1 commit into
Closed
feat: add env plugin for filling fields from environment variables#83henryiii wants to merge 1 commit into
henryiii wants to merge 1 commit into
Conversation
The env plugin fills a scalar string [project] field from an environment variable, with an optional default. An unset variable and no default is a hard error. It implements dynamic_wheel, marking the field Dynamic in SDist metadata (env values can differ per build), except version which may never differ. Assisted-by: ClaudeCode:claude-opus-4-8
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.
🤖 AI text below 🤖
Adds a bundled
envplugin that fills a scalar string[project]field from an environment variable.Settings:
field(required) — the target field; restricted to string fields (version,description,requires-python,license), since the value is a single string. Non-string-shaped fields are rejected.variable(required) — the environment variable name (matches the generic-plugin convention of a short noun setting, alongsideinput/path/name).default(optional) — used when the variable is unset. With no default, an unset variable is a hard error (fail loud, don't silently skip).Design decisions:
dynamic_wheelis dynamic-by-default, not opt-in. An environment variable can hold different values when the SDist and the wheel are built, so the field is markedDynamic(METADATA 2.2) and installers must not trust the SDist's value. This is a new plugin, so there is no existing config output to change (the opt-in convention guards against that); and dynamic is the safe, correct default for env-derived values. The one exception isversion, which may never differ between the SDist and a wheel, so it is never marked dynamic.toml_schema.jsononly describesprovider(additionalProperties: true), so per-plugin settings are not enumerated there.Docs (
docs/plugins.md,README.md) and the agent instructions plugin list are updated.