-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Description
Proposal
Add a PathBase class that can be subclassed by users to implement "virtual paths", e.g. paths within .zip files or on FTP servers, and publish it as an external PyPI package.
Phase 1: Private support in pathlib
- Add private
_PathBaseclass - Merge
WalkTestsintoDummyPathTest - Sort out
__hash__(),__eq__, etc - we shouldn't inherit thePurePathimplementation - Simplify/speed up path walking and globbing
- Add
from_uri()classmethod
Phase 2: Experimental support in PyPI package
- Move ABCs into
pathlib._abc - Figure out the default value for
pathmod, if any - Publish PyPI package
Previous Discussion
https://discuss.python.org/t/make-pathlib-extensible/3428
Linked PRs
- GH-110109: Simplify pathlib test setup #110308
- GH-110109: pathlib docs: bring
from_uri()andas_uri()together. #110312 - [WIP] GH-110109: Make pathlib extensible #110321
- GH-110109: Speed up
pathlib._PathBase.resolve()#110412 - GH-110109: Move tests for
pathlib.Path.walk()into main test classes. #110655 - GH-110109: Add
pathlib._PurePathBase#110670 - GH-110109: Churn
pathlib.PurePathmethods #112012 - GH-110109: Fix misplaced tests for
pathlib.WindowsPath.owner()andgroup()#112239 - GH-110109: Test pure functionality of
pathlib.Pathuser subclasses #112242 - GH-110109: Move pathlib ABCs to new
pathlib._abcmodule. #112881 - gh-110109: Fix installed buildbots now
pathlibis a package #112901 - GH-110109: Move tests for pathlib ABCs to new module. #112904
- GH-110109: pathlib ABCs: do not vary path syntax by host OS. #113219
- GH-110109: pathlib tests: store base directory as test class attribute #113221
- GH-110109: Drop use of new regex features in
pathlib._abc. #113292 - GH-110109: Fix misleading
pathlib._abc.PurePathBaserepr #113376 - GH-110109: Adjust
test_pathlib_abcimports to ease backporting #113411 - GH-110109: pathlib ABCs: drop use of
io.text_encoding()#113417 - GH-110109: pathlib ABCs: drop use of
warnings._deprecated()#113419
ap--, briantist, Marcelotsvaz, arrdem and edgarrmondragon
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement