File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,10 @@ def parent(self) -> Path:
261261 "A common parent directory for all the top-level paths in the file-set"
262262 return Path (os .path .commonpath ([p .parent for p in self .fspaths ]))
263263
264+ @property
265+ def parents (self ) -> ty .Sequence [Path ]:
266+ return [self .parent ] + list (self .parent .parents )
267+
264268 @property
265269 def relative_fspaths (self ) -> ty .Iterator [Path ]:
266270 "Paths for all top-level paths in the file-set relative to the common parent directory"
Original file line number Diff line number Diff line change @@ -81,14 +81,6 @@ def owner(self) -> ty.Optional[str]:
8181 return None
8282 return self .fspath .owner ()
8383
84- @property
85- def parent (self ) -> Path :
86- return self .fspath .parent
87-
88- @property
89- def parents (self ) -> ty .Sequence [Path ]:
90- return self .fspath .parents
91-
9284 @property
9385 def parts (self ) -> ty .Tuple [str , ...]:
9486 return self .fspath .parts
You can’t perform that action at this time.
0 commit comments