Skip to content

v0.0.6

Compare
Choose a tag to compare
@MrMino MrMino released this 01 Jul 01:22
· 109 commits to master since this release

0.0.6 - 2021-07-01

This release introduces backwards-incompatible changes in WheelFile.write.
Overall, it makes the method safer and easier to use. One will no longer create
a wheel-bomb by calling write('./').

If you were passing relative paths as filename without setting arcname, you
probably want to set resolve=False for retaining compatibility with this
release. See the "Changed" section.

Added

  • WheelFile.write and WheelFile.write_data now have a new, keyword-only
    resolve argument, that substitutes the default arcname with the name of
    the file the path in filename points to. This is set to True by default
    now.
  • New WheelFile.write_distinfo method, as a safe shorthand for writing to
    .dist-info/.
  • New resolved utility function.
  • New ProhibitedWriteError exception class.

Changed

  • WheelMeta no longer prohibits reading metadata in versions other than v2.1.
    It uses 2.1 afterwards, and its still not changeable though.
  • Since WheelFile.write and WheelFile.write_data methods have resolve
    argument set to True by default now, paths are no longer being put verbatim
    into the archive, only the filenames they point to. Set resolve to False
    to get the old behavior, the one exhibited by ZipFile.write.
  • Parts of WheelFile.__init__ have been refactored for parity between "named"
    and "unnamed" modes, i.e. it no longer raises different exceptions based on
    whether it is given a file, path to a directory, path to a file, or an io
    buffer.
  • Wheels generated by WheelFile are now reproducible. The modification times
    written into the resulting archives using .write(...) no longer differ
    between builds consisting of the same, unchanged files - they are taken from
    the files itself.

Fixed

  • WheelFile no longer accepts arguments of types other than Version and
    str in its version argument, when an io buffer is given. TypeError is
    raised instead.
  • MetaData started accepting keywords given via single string (comma
    separated). Previously this support was documented, but missing.
  • The wheelfile package itself should now have the keywords set properly ;).