Skip to content

feat: add env plugin for filling fields from environment variables#83

Closed
henryiii wants to merge 1 commit into
mainfrom
feat/env-plugin
Closed

feat: add env plugin for filling fields from environment variables#83
henryiii wants to merge 1 commit into
mainfrom
feat/env-plugin

Conversation

@henryiii

@henryiii henryiii commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Adds a bundled env plugin 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, alongside input/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_wheel is 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 marked Dynamic (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 is version, which may never differ between the SDist and a wheel, so it is never marked dynamic.
  • No JSON schema change: toml_schema.json only describes provider (additionalProperties: true), so per-plugin settings are not enumerated there.

Docs (docs/plugins.md, README.md) and the agent instructions plugin list are updated.

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
@henryiii henryiii closed this Jul 3, 2026
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.

1 participant