Skip to content

Add pathlib-compatible Path.is_mount - #267

Open
AkshayRKapur0205 wants to merge 1 commit into
jaraco:mainfrom
AkshayRKapur0205:akshayrkapur0205-path-mount-predicate-compatibility
Open

AkshayRKapur0205 wants to merge 1 commit into
jaraco:mainfrom
AkshayRKapur0205:akshayrkapur0205-path-mount-predicate-compatibility

Conversation

@AkshayRKapur0205

Copy link
Copy Markdown

Summary

Add Path.is_mount() as an alias for the existing ismount() predicate, following the class-alias pattern used by cd = chdir. Both spellings retain the same configurable Path.module delegation; 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_mount subtask only, not the whole compatibility checklist.

Validation

Run on Windows with CPython 3.11.9, using .tox\is-mount\Scripts\python.exe and 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.
  • Ruff reports the same 21 pre-existing diagnostics in the two changed Python files; exact diagnostic comparison against unchanged source found no additions or removals.
  • python -m mypy path tests: the same pre-existing unused-ignore failure at the win32security.LookupAccountSid call (original line 1209, now 1211); no new errors.

The missing API was also reproduced directly on unchanged upstream main 67319bba24b0986abcf6c5a749a1b8ab6359bb22, including Path.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.

Refs jaraco#214 -- is_mount subtask only.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant