Add as_optional_path accessor - #202
Open
snejus wants to merge 1 commit into
Open
Conversation
snejus
requested review from
semohr and
wisp3rwind
and
a lite review from Copilot
and removed request for
Copilot
August 27, 2026 10:04
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
snejus
force-pushed
the
add-as-optional-path
branch
from
August 27, 2026 10:05
af4aeab to
51a90d6
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds a convenience accessor to retrieve optional path configuration values as pathlib.Path | None, aligning with common usage patterns during pathlib migration work.
Changes:
- Add
as_optional_path()accessor implemented viaOptional(Path()). - Update validation tests to cover the new accessor and simplify
as_path()testing now thatpathlibis unconditionally available. - Document the change in the changelog and tune Ruff’s
flake8-pytest-styleconfiguration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| confuse/core.py | Adds the new as_optional_path() accessor (wrapper around Optional(Path())). |
| test/test_validation.py | Adds tests for as_optional_path() and simplifies as_path() test logic. |
| docs/changelog.rst | Notes the new accessor in the Unreleased changelog. |
| pyproject.toml | Adds Ruff flake8-pytest-style configuration adjustments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
snejus
force-pushed
the
add-as-optional-path
branch
from
August 27, 2026 10:18
51a90d6 to
e58c0e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As I've been migrating
beetstopathlibI realised that I use this pattern a lot: