Skip to content

Expose path resolution options on convenience accessors - #220

Open
ac1982 wants to merge 1 commit into
beetbox:mainfrom
ac1982:feat/path-accessor-options
Open

ac1982 wants to merge 1 commit into
beetbox:mainfrom
ac1982:feat/path-accessor-options

Conversation

@ac1982

@ac1982 ac1982 commented Oct 15, 2026

Copy link
Copy Markdown

Allow as_filename(), as_path() and as_optional_path() to accept the existing cwd, in_app_dir and in_source_dir options. For example, config['path'].as_path(in_source_dir=True) can resolve a path relative to its YAML source without constructing a template manually.

The accessors forward keyword-only options to the existing templates, preserving resolution precedence, return types and optional-value handling. Document the options and retain mapping templates as the way to use relative_to, which requires sibling validation context.

Fixes #162.

Validation on Python 3.13/Linux:

  • 11 initial regression cases fail before the change; final validation suite has 40 passing tests, including option precedence and updates.
  • Full suite: 314 passed, 1 date-dependent release-helper failure reproduced on the unchanged base (Make release changelog test independent of the date #211).
  • Strict Sphinx build, changed-doc formatting/lint and changed-Python Ruff checks pass.
  • Full mypy and Ruff report only issues reproduced on the unchanged base (3 type errors and 1 lint error); full Python formatting passes.

AI assistance: implemented and tested with Codex.

This branch has not been deployed

No deployments
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.

Exposing some of templates.Filename parameters in templates.Path and as_path(), as_filename()

1 participant