Major modernization: Python 2 is dropped, the code is fully type-annotated, packaging moves to pyproject.toml, and several long-standing parser issues are fixed.
⚠️ Breaking
- Minimum supported Python is now 3.9 (Python 2 dropped).
PatchedFile.pathnow also strips git mnemonic prefixes (c/ i/ o/ w/and1/ 2/), sogit diff --cachedpaths resolve to the plain filename (c/README.md→README.md). Standarda//b/diffs are unaffected. (#81, #27)
Highlights
- File modes via
source_mode/target_mode+ anis_symlinkproperty. (#125) PatchedFile.diff_line_noto locate hunkless/binary entries. (#122)- Accept
bytesinput directly (decoded with the given encoding, default UTF-8). (#43) - Real PEP 484 type annotations + generics (typed iteration) and a
py.typedmarker. (#117) - Parse
difflibempty-filename output (#115) and fix a trailing-newline error on hunklessgit format-patchfiles (#73, #74); includes the quoted-filename fix missing from 0.7.5 (#113). from_filename/from_stringgainmetadata_only;python -m unidiffworks; packaging onpyproject.tomlwith GitHub Actions CI.
Thanks to @danwald, @cpina, @tovrstra and @huichen-cs.
Full changelog: v0.7.5...v1.0.0