Skip to content

v1.0.0

Latest

Choose a tag to compare

@matiasb matiasb released this 25 Jul 19:17
5ff054b

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.path now also strips git mnemonic prefixes (c/ i/ o/ w/ and 1/ 2/), so git diff --cached paths resolve to the plain filename (c/README.mdREADME.md). Standard a//b/ diffs are unaffected. (#81, #27)

Highlights

  • File modes via source_mode/target_mode + an is_symlink property. (#125)
  • PatchedFile.diff_line_no to locate hunkless/binary entries. (#122)
  • Accept bytes input directly (decoded with the given encoding, default UTF-8). (#43)
  • Real PEP 484 type annotations + generics (typed iteration) and a py.typed marker. (#117)
  • Parse difflib empty-filename output (#115) and fix a trailing-newline error on hunkless git format-patch files (#73, #74); includes the quoted-filename fix missing from 0.7.5 (#113).
  • from_filename/from_string gain metadata_only; python -m unidiff works; packaging on pyproject.toml with GitHub Actions CI.

Thanks to @danwald, @cpina, @tovrstra and @huichen-cs.

Full changelog: v0.7.5...v1.0.0