The configuration resolution process (resolve_config) supports advanced features via the schema:
Environment Variable Expansion
If a schema option includes "env", string values can use the %(VAR_NAME)% syntax to expand environment variables.
- Example:
"path": "%(HOME)%/data" will expand to the value of the HOME environment variable. - If an environment variable expands to an empty string, the configuration key is removed.
Path Resolution
If a schema option includes "path", the configuration value is treated as a path:
- Relative Paths: If the value comes from a configuration file, it is resolved relative to the directory containing that file.
- Environment Variables: If the value is expanded from an environment variable, it is resolved relative to the current working directory.
URI Conversion
If a schema option includes "uri", the value is converted to a URI string using .as_uri() if available, or cast to a string.