Repository navigation
Add pathlib-compatible Path.is_mount - #267
Open
AkshayRKapur0205 wants to merge 1 commit into
Open
AkshayRKapur0205 wants to merge 1 commit into
AkshayRKapur0205 wants to merge 1 commit into
Conversation
Refs jaraco#214 -- is_mount subtask only. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Summary
Add
Path.is_mount()as an alias for the existingismount()predicate, following the class-alias pattern used bycd = chdir. Both spellings retain the same configurablePath.moduledelegation;ismount()is unchanged and is not deprecated.Add 12 regression cases covering both spellings for ordinary directories, files, missing paths, a native filesystem root, and substituted path-module results through
Path.using_module(). Include a feature news fragment.Refs #214 -- the
is_mountsubtask only, not the whole compatibility checklist.Validation
Run on Windows with CPython 3.11.9, using
.tox\is-mount\Scripts\python.exeand the repository's declared test/check/cover/enabler/type extras:python -m pytest tests\test_path.py -k is_mount -q --tb=short --cov-report=: before the implementation, 6 expected AttributeError failures and 6 legacy passes; after, 12 passed.python -m pytest tests\test_path.py::TestBasics tests\test_path.py::TestSubclass -q --tb=short --cov-report=: 45 passed, 4 skipped.python -m ruff format --check path\__init__.py tests\test_path.py: passed.python -m mypy path tests: the same pre-existingunused-ignorefailure at thewin32security.LookupAccountSidcall (original line 1209, now 1211); no new errors.The missing API was also reproduced directly on unchanged upstream main
67319bba24b0986abcf6c5a749a1b8ab6359bb22, includingPath.using_module(os.path). Final probes confirmed worktree import provenance, native-root behavior, alias identity, and per-instance module delegation.Linux/macOS runtime tests and the full suite were not run locally. The existing conftest disables module doctests on this Python version. No mounts, system settings, or external services were changed.
AI assistance: implementation, tests, and this description were prepared with GitHub Copilot. No human pre-review is claimed.