click_extra.config.builtin module

Click Extra’s own built-in configuration schema.

The dataclasses describing click-extra’s own [tool.click-extra] section: ClickExtraConfig and its test-suite and prebake sub-tables. They are a concrete instance of the configuration machinery, kept apart from the reusable engine in schema and the option classes in option. Only the click-extra CLI reads them, so import click_extra does not load this module.

A downstream project defines its own equivalent of this module; click-extra just happens to ship one, built on the same generic engine.

class click_extra.config.builtin.TestSuiteConfig(file='./tests/cli-test-suite.toml', cases=list(), timeout=None)[source]

Bases: object

Config schema for a project’s test suite, read from [tool.<cli>.test-suite].

The test-suite CLI command resolves its cases from this config when no suite is given on the command line. Map it onto an app’s config section with a field carrying metadata={CONFIG_PATH_METADATA_KEY: "test-suite"}.

file: str = './tests/cli-test-suite.toml'

Path to a test suite file, resolved relative to the project root.

Its format is detected from the extension; the default is TOML, which (like JSON) parses with no optional dependency, unlike YAML and the others.

cases: list[dict]

Test cases written natively in the config format, an alternative to a file suite, taking precedence over it when both are set.

Each entry is a mapping of CLITestCase directive names, equivalent to one item of a suite list. In TOML this reads as a [[tool.<cli>.test-suite.cases]] array of tables. Declared as an extension point so the configuration engine passes the raw mappings through unprocessed; the test-suite command turns them into CLITestCase instances.

timeout: int | None = None

Default timeout (seconds) for each case that does not set its own.

None leaves cases unbounded unless --timeout is passed.

class click_extra.config.builtin.PrebakeConfig(module=None)[source]

Bases: object

Config schema for the prebake commands, read from [tool.<cli>.prebake].

Lets a project pin the target __init__.py once for its build pipeline, instead of passing --module to every click-extra prebake command.

module: str | None = None

Path to the __init__.py to pre-bake, resolved relative to the project root. Overrides the [project.scripts] auto-discovery; leave unset to keep it.

class click_extra.config.builtin.ClickExtraConfig(test_suite=TestSuiteConfig(), prebake=PrebakeConfig())[source]

Bases: object

Schema for the [tool.click-extra] configuration section.

Wired as the config_schema of the top-level click-extra group, so every subcommand reads the same section and pulls its own sub-table through get_tool_config().

test_suite: TestSuiteConfig

The [tool.click-extra.test-suite] sub-table (file/cases/timeout).

prebake: PrebakeConfig

The [tool.click-extra.prebake] sub-table (target module).