Skip to content

Make path-based config loading public #34

Description

@gkennos

Pre-flight

  • I searched existing issues and this has not been requested before.

Problem or motivation

_load_from_path(path) is private, but loading a stack config from an explicit path is a genuine application need

e.g. groundworkers has bootstrap.py::load_stack_config_from_path, a near-line-for-line reimplementation

The copy does one thing better: it formats ValidationError into a ConfigurationError naming the offending field paths, where upstream lets the raw pydantic error propagate.

Proposed solution

Promote it, taking the improved error formatting from groundworkers while we are at it

def load_stack_config_from_path(path: str | Path) -> StackConfig: ...

Keep load_stack_config() as the no-argument, CONFIG_PATH-driven entry point for application code

Alternatives considered

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions