Skip to content

Commit fa3a086

Browse files
authored
Cut release 0.3.1 (#425)
* readme: update wording regarding pathlib-abc ABC classes and pathlib * readme: add method implementation table * update changelog
1 parent 630c601 commit fa3a086

File tree

2 files changed

+145
-5
lines changed

2 files changed

+145
-5
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99
...
1010

11+
## [0.3.1] - 2025-10-03
12+
### Added
13+
- upath: add `UPath.from_uri()` classmethod (#423)
14+
- upath: add `UPath.move_into()` method (#422)
15+
- upath: implement `.info` property (#416)
16+
- typesafety: add thorough typechecks to UPath interface (#414)
17+
18+
### Fixed
19+
- upath: fix type annotations for upath.core, upath.extensions and upath.implementations (#420)
20+
- upath: backport types and methods to local implementations (#421)
21+
- upath: stricter upath types and remove Compat* protocol (#417)
22+
23+
### Changed
24+
- maintenance: update license identifier and restrict ci permissions (#424)
25+
1126
## [0.3.0] - 2025-09-29
1227
### Fixed
1328
- upath: support relative paths (#405)
@@ -211,7 +226,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
211226
### Added
212227
- started a changelog to keep track of significant changes
213228

214-
[Unreleased]: https://github.com/fsspec/universal_pathlib/compare/v0.3.0...HEAD
229+
[Unreleased]: https://github.com/fsspec/universal_pathlib/compare/v0.3.1...HEAD
230+
[0.3.1]: https://github.com/fsspec/universal_pathlib/compare/v0.3.0...v0.3.1
215231
[0.3.0]: https://github.com/fsspec/universal_pathlib/compare/v0.2.6...v0.3.0
216232
[0.2.6]: https://github.com/fsspec/universal_pathlib/compare/v0.2.5...v0.2.6
217233
[0.2.5]: https://github.com/fsspec/universal_pathlib/compare/v0.2.4...v0.2.5

README.md

Lines changed: 128 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ And of course, contributions for new filesystems are welcome!
111111

112112
The class hierarchy for `UPath` implementations and their relation to base classes
113113
in `pathlib_abc` and the stdlib `pathlib` classes are visualized in the following
114-
diagram:
114+
diagram. Please be aware that the `pathlib_abc.JoinablePath`,
115+
`pathlib_abc.ReadablePath`, and `pathlib_abc.WritablePath` classes are currently
116+
not actual parent classes of the stdlib pathlib classes. This might occur in
117+
later Python releases, but for now, the mental model you should keep is represented
118+
by the diagram.
115119

116120
```mermaid
117121
flowchart TB
@@ -122,14 +126,14 @@ flowchart TB
122126
end
123127
124128
subgraph s0[pathlib]
125-
X --> A
129+
X -.-> A
126130
127131
A----> B
128132
A--> AP
129133
A--> AW
130134
131-
Y --> B
132-
Z --> B
135+
Y -.-> B
136+
Z -.-> B
133137
134138
B--> BP
135139
AP----> BP
@@ -184,6 +188,19 @@ flowchart TB
184188
style s1 fill:none,stroke:#d02,stroke-width:3px,stroke-dasharray:3,color:#d02
185189
```
186190

191+
To be concrete this currently means:
192+
193+
```python
194+
# for all supported Python versions:
195+
from pathlib import Path
196+
from upath import UPath
197+
from upath.types import JoinablePath
198+
199+
assert isinstance(Path(), JoinablePath) is False
200+
assert isinstance(UPath(), JoinablePath) is True
201+
```
202+
203+
187204
When instantiating `UPath` the returned instance type is determined by the path,
188205
or better said, the "protocol" that was provided to the constructor. The `UPath`
189206
class will return a registered implementation for the protocol, if available. If
@@ -255,6 +272,113 @@ with fs.open(p.path) as f:
255272
data = f.read()
256273
```
257274

275+
## Supported Interface
276+
277+
Universal Pathlib provides an implementation of the `pathlib.Path` interface
278+
across different Python versions. The following table shows the compatibility
279+
matrix for stdlib pathlib.Path attributes and methods. Methods supported in
280+
UPath should correctly work for all supported Python versions. If not, we consider
281+
it a bug.
282+
283+
| Method/Attribute | py3.9 | py3.10 | py3.11 | py3.12 | py3.13 | py3.14 | UPath |
284+
|---------------------------|-------|--------|--------|--------|--------|--------|-------|
285+
| **Pure Paths** | | | | | | | |
286+
| _Operators_ | | | | | | | |
287+
| `__truediv__` ||||||||
288+
| `__rtruediv__` ||||||||
289+
| _Access individual Parts_ | | | | | | | |
290+
| `parts` ||||||||
291+
| _Methods and Properties_ | | | | | | | |
292+
| `parser` ||||||||
293+
| `drive` ||||||||
294+
| `root` ||||||||
295+
| `anchor` ||||||||
296+
| `parents` ||||||||
297+
| `parent` ||||||||
298+
| `name` ||||||||
299+
| `suffix` ||||||||
300+
| `suffixes` ||||||||
301+
| `stem` ||||||||
302+
| `as_posix()` ||||||||
303+
| `is_absolute()` ||||||||
304+
| `is_relative_to()` ||||||||
305+
| `is_reserved()` ||||||||
306+
| `joinpath()` ||||||||
307+
| `full_match()` ||||||||
308+
| `match()` ||||||||
309+
| `relative_to()` ||||||||
310+
| `with_name()` ||||||||
311+
| `with_stem()` ||||||||
312+
| `with_suffix()` ||||||||
313+
| `with_segments()` ||||||||
314+
| **Concrete Paths** | | | | | | | |
315+
| _Parsing URIs_ | | | | | | | |
316+
| `from_uri()` ||||||||
317+
| `as_uri()` ||||||||
318+
| _Expanding Paths_ | | | | | | | |
319+
| `home()` ||||||||
320+
| `expanduser()` ||||||||
321+
| `cwd()` ||||||||
322+
| `absolute()` ||||||||
323+
| `resolve()` ||||||||
324+
| `readlink()` ||||||| ⚠️ |
325+
| _Querying File status_ | | | | | | | |
326+
| `stat()` ||||||||
327+
| `lstat()` ||||||||
328+
| `exists()` ||||||||
329+
| `is_file()` ||||||||
330+
| `is_dir()` ||||||||
331+
| `is_symlink()` ||||||||
332+
| `is_junction()` ||||||||
333+
| `is_mount()` ||||||||
334+
| `is_socket()` ||||||||
335+
| `is_fifo()` ||||||||
336+
| `is_block_device()` ||||||||
337+
| `is_char_device()` ||||||||
338+
| `samefile()` ||||||||
339+
| `info` ||||||||
340+
| _Reading & Writing Files_ | | | | | | | |
341+
| `open()` ||||||||
342+
| `read_text()` ||||||||
343+
| `read_bytes()` ||||||||
344+
| `write_text()` ||||||||
345+
| `write_bytes()` ||||||||
346+
| _Reading Directories_ | | | | | | | |
347+
| `iterdir()` ||||||||
348+
| `glob()` ||||||||
349+
| `rglob()` ||||||||
350+
| `walk()` ||||||||
351+
| _Creating Files & Dirs_ | | | | | | | |
352+
| `touch()` ||||||||
353+
| `mkdir()` ||||||||
354+
| `symlink_to()` ||||||| ⚠️ |
355+
| `hardlink_to()` ||||||| ⚠️ |
356+
| _Copying & Moving_ | | | | | | | |
357+
| `copy()` ||||||||
358+
| `copy_into()` ||||||||
359+
| `rename()` ||||||||
360+
| `replace()` ||||||| ⚠️ |
361+
| `move()` ||||||||
362+
| `move_into()` ||||||||
363+
| `unlink()` ||||||||
364+
| `rmdir()` ||||||||
365+
| _Permission & Owner_ | | | | | | | |
366+
| `owner()` ||||||| ⚠️ |
367+
| `group()` ||||||| ⚠️ |
368+
| `chmod()` ||||||| ⚠️ |
369+
| `lchmod()` ||||||| ⚠️ |
370+
| **UPath interface** | | | | | | | |
371+
| `protocol` ||||||||
372+
| `storage_options` ||||||||
373+
| `path` ||||||||
374+
| `fs` ||||||||
375+
| `joinuri()` ||||||||
376+
377+
**Key:**
378+
- ✅ = Available/Supported
379+
- ❌ = Not available in this version
380+
- ⚠️ = Currently raises unsupported error for UPath implementations
381+
258382
## Advanced Usage
259383

260384
If you want to create your own UPath implementations, there are multiple ways to

0 commit comments

Comments
 (0)