Hello community, here is the log from the commit of package python-mutagen for openSUSE:Factory checked in at 2018-04-22 14:29:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mutagen (Old) and /work/SRC/openSUSE:Factory/.python-mutagen.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mutagen" Sun Apr 22 14:29:09 2018 rev:29 rq:596193 version:1.40.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mutagen/python-mutagen.changes 2017-11-12 18:00:44.356331174 +0100 +++ /work/SRC/openSUSE:Factory/.python-mutagen.new/python-mutagen.changes 2018-04-22 14:29:10.719682792 +0200 @@ -1,0 +2,13 @@ +Thu Apr 12 21:16:26 UTC 2018 - alarr...@suse.com + +- Update to version 1.40.0: + * APEv2: Ensures tags are saved in a deterministic way + * easymp4: Fix EasyMP4.add_tags() when no tags exist + * id3: Fix PyCharm not being able to resolve id3 frame class references + * Support pathlib.Path objects for paths (PEP 519) + * Use semver for versioning + +- Add ignore-W504.patch to ignore PEP8's W504 messages which make the pep8 + test fail. + +------------------------------------------------------------------- Old: ---- mutagen-1.39.tar.gz New: ---- ignore-W504.patch mutagen-1.40.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mutagen.spec ++++++ --- /var/tmp/diff_new_pack.UaPExy/_old 2018-04-22 14:29:11.367659338 +0200 +++ /var/tmp/diff_new_pack.UaPExy/_new 2018-04-22 14:29:11.367659338 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-mutagen # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,17 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-mutagen -Version: 1.39 +Version: 1.40.0 Release: 0 Summary: Python module to Handle Audio Metadata -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Development/Libraries/Python Url: https://pypi.python.org/pypi/mutagen Source: https://files.pythonhosted.org/packages/source/m/mutagen/mutagen-%{version}.tar.gz # PATCH-FIX-OPENSUSE reduce-test-length.diff alarr...@suse.com -- Reduce the number of iterations so tests don't take so long to finish Patch0: reduce-test-length.diff +# PATCH-FIX-UPSTREAM ignore-W504.patch alarr...@suse.com -- Ignore PEP8's W504 which makes tests fail +Patch1: ignore-W504.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module pycodestyle} @@ -51,6 +53,7 @@ %prep %setup -q -n mutagen-%{version} %patch0 -p1 +%patch1 -p1 # remove shebangs from library files find mutagen/ -name "*.py" -exec sed -i -e '/^#!\s\?\/usr\/bin\/\(env\s\)\?python$/d' {} ';' ++++++ ignore-W504.patch ++++++ Index: mutagen-1.40.0/setup.cfg =================================================================== --- mutagen-1.40.0.orig/setup.cfg +++ mutagen-1.40.0/setup.cfg @@ -6,6 +6,6 @@ omit= mutagen/_senf/* [flake8] -ignore=E128,W601,E402,E731,W503,E741,E305,E121,E124 +ignore=E128,W601,E402,E731,W503,E741,E305,E121,E124,W504 builtins=cmp,unicode,long,xrange,basestring exclude= ++++++ mutagen-1.39.tar.gz -> mutagen-1.40.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/NEWS new/mutagen-1.40.0/NEWS --- old/mutagen-1.39/NEWS 2017-11-05 20:28:45.000000000 +0100 +++ new/mutagen-1.40.0/NEWS 2018-01-25 17:09:13.000000000 +0100 @@ -1,3 +1,17 @@ +1.40.0 - 2018-01-25 +------------------- + +* APEv2: Ensures tags are saved in a deterministic way :pr:`329` + (:user:`cushy007`) +* Restore WinXP support for the CLI tools :bug:`332` +* easymp4: Fix EasyMP4.add_tags() when no tags exist :bug:`334` +* id3: Fix PyCharm not being able to resolve id3 frame class references + :bug:`336` +* Support pathlib.Path objects for paths (PEP 519) :bug:`337` :pr:`338` + (:user:`Andrew Rabert <nvllsvm>`) +* Use semver for versioning + + 1.39 - 2017-11-05 ----------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/PKG-INFO new/mutagen-1.40.0/PKG-INFO --- old/mutagen-1.39/PKG-INFO 2017-11-05 20:29:29.000000000 +0100 +++ new/mutagen-1.40.0/PKG-INFO 2018-01-25 17:09:43.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mutagen -Version: 1.39 +Version: 1.40.0 Summary: read and write audio tags for many formats Home-page: https://github.com/quodlibet/mutagen Author: Michael Urman diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/docs/user/id3.rst new/mutagen-1.40.0/docs/user/id3.rst --- old/mutagen-1.39/docs/user/id3.rst 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/docs/user/id3.rst 2017-12-28 12:33:30.000000000 +0100 @@ -224,6 +224,31 @@ audio.save() +Dealing with Frame Uniqueness of ID3 Frames +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ID3 spec defines for each frame type which combination of the contained +data needs to be unique in the whole tag and acts as an identifier for that +frame. This manifests itself in mutagen in that adding a frame using +:meth:`ID3Tags.add`, which has the same key as an existing frame, will replace +the old one. + +One frame type where this commonly leads to confusing results is the APIC +frame, which requires that only the description field needs to be unique in +the whole tag and not the description and picture type. + +If you want to add a new frame without replacing an existing one, check the +HashKey property and adjust your new frame until it no longer matches any +existing frame. + +.. code:: python + + tag = ID3() + new = APIC() + while new.HashKey in tag: + new.desc += u"x" + tag.add(new) + Compatibility / Bugs ^^^^^^^^^^^^^^^^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/__init__.py new/mutagen-1.40.0/mutagen/__init__.py --- old/mutagen-1.39/mutagen/__init__.py 2017-11-05 20:28:45.000000000 +0100 +++ new/mutagen-1.40.0/mutagen/__init__.py 2018-01-25 17:09:13.000000000 +0100 @@ -23,7 +23,7 @@ from mutagen._file import FileType, StreamInfo, File from mutagen._tags import Tags, Metadata, PaddingInfo -version = (1, 39) +version = (1, 40, 0) """Version tuple.""" version_string = ".".join(map(str, version)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_senf/__init__.py new/mutagen-1.40.0/mutagen/_senf/__init__.py --- old/mutagen-1.39/mutagen/_senf/__init__.py 2017-11-05 19:55:19.000000000 +0100 +++ new/mutagen-1.40.0/mutagen/_senf/__init__.py 2018-01-23 13:57:07.000000000 +0100 @@ -42,7 +42,7 @@ supports_ansi_escape_codes, fsn2norm -version = (1, 3, 3) +version = (1, 3, 4) """Tuple[`int`, `int`, `int`]: The version tuple (major, minor, micro)""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_senf/_fsnative.py new/mutagen-1.40.0/mutagen/_senf/_fsnative.py --- old/mutagen-1.39/mutagen/_senf/_fsnative.py 2017-07-29 17:32:39.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/_senf/_fsnative.py 2018-01-23 12:14:10.000000000 +0100 @@ -473,22 +473,21 @@ return fsnative(text) -def fsn2bytes(path, encoding): +def fsn2bytes(path, encoding="utf-8"): """ Args: path (fsnative): The path to convert - encoding (`str` or `None`): `None` if you don't care about Windows + encoding (`str`): encoding used for Windows Returns: `bytes` Raises: TypeError: If no `fsnative` path is passed - ValueError: If encoding fails or no encoding is given + ValueError: If encoding fails or the encoding is invalid Converts a `fsnative` path to `bytes`. The passed *encoding* is only used on platforms where paths are not - associated with an encoding (Windows for example). If you don't care about - Windows you can pass `None`. + associated with an encoding (Windows for example). For Windows paths, lone surrogates will be encoded like normal code points and surrogate pairs will be merged before encoding. In case of ``utf-8`` @@ -510,22 +509,24 @@ return path -def bytes2fsn(data, encoding): +def bytes2fsn(data, encoding="utf-8"): """ Args: data (bytes): The data to convert - encoding (`str` or `None`): `None` if you don't care about Windows + encoding (`str`): encoding used for Windows Returns: `fsnative` Raises: TypeError: If no `bytes` path is passed - ValueError: If decoding fails or no encoding is given + ValueError: If decoding fails or the encoding is invalid Turns `bytes` to a `fsnative` path. The passed *encoding* is only used on platforms where paths are not - associated with an encoding (Windows for example). If you don't care about - Windows you can pass `None`. + associated with an encoding (Windows for example). + + For Windows paths ``WTF-8`` is accepted if ``utf-8`` is used and + ``WTF-16`` accepted if ``utf-16-le`` is used. """ if not isinstance(data, bytes): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_senf/_print.py new/mutagen-1.40.0/mutagen/_senf/_print.py --- old/mutagen-1.39/mutagen/_senf/_print.py 2017-07-27 17:56:41.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/_senf/_print.py 2017-12-24 09:21:21.000000000 +0100 @@ -378,6 +378,10 @@ winapi.MAX_PATH * ctypes.sizeof(winapi.WCHAR) buf = ctypes.create_string_buffer(size) + if winapi.GetFileInformationByHandleEx is None: + # Windows XP + return None + status = winapi.GetFileInformationByHandleEx( handle, winapi.FileNameInfo, buf, size) if status == 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_senf/_winapi.py new/mutagen-1.40.0/mutagen/_senf/_winapi.py --- old/mutagen-1.39/mutagen/_senf/_winapi.py 2017-07-30 17:12:06.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/_senf/_winapi.py 2017-12-24 09:21:02.000000000 +0100 @@ -191,10 +191,14 @@ MoveFileW.argtypes = [LPCTSTR, LPCTSTR] MoveFileW.restype = BOOL -GetFileInformationByHandleEx = kernel32.GetFileInformationByHandleEx -GetFileInformationByHandleEx.argtypes = [ - HANDLE, ctypes.c_int, ctypes.c_void_p, DWORD] -GetFileInformationByHandleEx.restype = BOOL +if hasattr(kernel32, "GetFileInformationByHandleEx"): + GetFileInformationByHandleEx = kernel32.GetFileInformationByHandleEx + GetFileInformationByHandleEx.argtypes = [ + HANDLE, ctypes.c_int, ctypes.c_void_p, DWORD] + GetFileInformationByHandleEx.restype = BOOL +else: + # Windows XP + GetFileInformationByHandleEx = None MAX_PATH = 260 FileNameInfo = 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_tools/mid3v2.py new/mutagen-1.40.0/mutagen/_tools/mid3v2.py --- old/mutagen-1.39/mutagen/_tools/mid3v2.py 2017-06-14 18:44:44.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/_tools/mid3v2.py 2018-01-23 13:53:38.000000000 +0100 @@ -133,12 +133,12 @@ assert isinstance(arg, fsnative) if escape: - bytes_ = fsn2bytes(arg, "utf-8") + bytes_ = fsn2bytes(arg) if PY2: bytes_ = bytes_.decode("string_escape") else: bytes_ = codecs.escape_decode(bytes_)[0] - arg = bytes2fsn(bytes_, "utf-8") + arg = bytes2fsn(bytes_) text = fsn2text(arg, strict=True) return text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/_util.py new/mutagen-1.40.0/mutagen/_util.py --- old/mutagen-1.39/mutagen/_util.py 2017-11-03 12:33:23.000000000 +0100 +++ new/mutagen-1.40.0/mutagen/_util.py 2018-01-23 11:36:25.000000000 +0100 @@ -50,8 +50,8 @@ file object """ - # open() only handles str/bytes, so we can be strict - return not isinstance(fileobj, (text_type, bytes)) + return not (isinstance(fileobj, (text_type, bytes)) or + hasattr(fileobj, "__fspath__")) def verify_fileobj(fileobj, writable=False): @@ -210,6 +210,10 @@ if filething is not None: if is_fileobj(filething): fileobj = filething + elif hasattr(filething, "__fspath__"): + filename = filething.__fspath__() + if not isinstance(filename, (bytes, text_type)): + raise TypeError("expected __fspath__() to return a filename") else: filename = filething diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/apev2.py new/mutagen-1.40.0/mutagen/apev2.py --- old/mutagen-1.39/mutagen/apev2.py 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/apev2.py 2017-12-24 09:25:00.000000000 +0100 @@ -459,7 +459,7 @@ # "APE tags items should be sorted ascending by size... This is # not a MUST, but STRONGLY recommended. Actually the items should # be sorted by importance/byte, but this is not feasible." - tags.sort(key=len) + tags.sort(key=lambda tag: (len(tag), tag)) num_tags = len(tags) tags = b"".join(tags) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/easymp4.py new/mutagen-1.40.0/mutagen/easymp4.py --- old/mutagen-1.39/mutagen/easymp4.py 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/easymp4.py 2018-01-01 18:05:05.000000000 +0100 @@ -42,11 +42,14 @@ self.load = self.__mp4.load self.save = self.__mp4.save self.delete = self.__mp4.delete - self._padding = self.__mp4._padding filename = property(lambda s: s.__mp4.filename, lambda s, fn: setattr(s.__mp4, 'filename', fn)) + @property + def _padding(self): + return self.__mp4._padding + @classmethod def RegisterKey(cls, key, getter=None, setter=None, deleter=None, lister=None): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/id3/__init__.py new/mutagen-1.40.0/mutagen/id3/__init__.py --- old/mutagen-1.39/mutagen/id3/__init__.py 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/id3/__init__.py 2018-01-20 12:38:14.000000000 +0100 @@ -38,18 +38,26 @@ from ._util import ID3NoHeaderError, error, ID3UnsupportedVersionError from ._id3v1 import ParseID3v1, MakeID3v1 from ._tags import ID3Tags +from ._frames import (AENC, APIC, ASPI, BUF, CHAP, CNT, COM, COMM, COMR, CRA, + CRM, CTOC, ENCR, EQU2, ETC, ETCO, GEO, GEOB, GP1, GRID, GRP1, IPL, IPLS, + LINK, LNK, MCDI, MCI, MLL, MLLT, MVI, MVIN, MVN, MVNM, OWNE, PCNT, PCST, + PIC, POP, POPM, POSS, PRIV, RBUF, REV, RVA, RVA2, RVAD, RVRB, SEEK, SIGN, + SLT, STC, SYLT, SYTC, TAL, TALB, TBP, TBPM, TCAT, TCM, TCMP, TCO, TCOM, + TCON, TCOP, TCP, TCR, TDA, TDAT, TDEN, TDES, TDLY, TDOR, TDRC, TDRL, TDTG, + TDY, TEN, TENC, TEXT, TFLT, TFT, TGID, TIM, TIME, TIPL, TIT1, TIT2, TIT3, + TKE, TKEY, TKWD, TLA, TLAN, TLE, TLEN, TMCL, TMED, TMOO, TMT, TOA, TOAL, + TOF, TOFN, TOL, TOLY, TOPE, TOR, TORY, TOT, TOWN, TP1, TP2, TP3, TP4, TPA, + TPB, TPE1, TPE2, TPE3, TPE4, TPOS, TPRO, TPUB, TRC, TRCK, TRD, TRDA, TRK, + TRSN, TRSO, TS2, TSA, TSC, TSI, TSIZ, TSO2, TSOA, TSOC, TSOP, TSOT, TSP, + TSRC, TSS, TSSE, TSST, TST, TT1, TT2, TT3, TXT, TXX, TXXX, TYE, TYER, UFI, + UFID, ULT, USER, USLT, WAF, WAR, WAS, WCM, WCOM, WCOP, WCP, WFED, WOAF, + WOAR, WOAS, WORS, WPAY, WPB, WPUB, WXX, WXXX) # deprecated from ._util import ID3EncryptionUnsupportedError, ID3JunkFrameError, \ ID3BadUnsynchData, ID3BadCompressedData, ID3TagError, ID3Warning, \ BitPaddedInt as _BitPaddedIntForPicard - -for f in Frames: - globals()[f] = Frames[f] -for f in Frames_2_2: - globals()[f] = Frames_2_2[f] - # support open(filename) as interface Open = ID3 @@ -62,6 +70,20 @@ ID3JunkFrameError, ID3BadUnsynchData, ID3BadCompressedData, ID3TagError, ID3Warning +AENC, APIC, ASPI, BUF, CHAP, CNT, COM, COMM, COMR, CRA, CRM, CTOC, ENCR, EQU2, +ETC, ETCO, GEO, GEOB, GP1, GRID, GRP1, IPL, IPLS, LINK, LNK, MCDI, MCI, MLL, +MLLT, MVI, MVIN, MVN, MVNM, OWNE, PCNT, PCST, PIC, POP, POPM, POSS, PRIV, +RBUF, REV, RVA, RVA2, RVAD, RVRB, SEEK, SIGN, SLT, STC, SYLT, SYTC, TAL, TALB, +TBP, TBPM, TCAT, TCM, TCMP, TCO, TCOM, TCON, TCOP, TCP, TCR, TDA, TDAT, TDEN, +TDES, TDLY, TDOR, TDRC, TDRL, TDTG, TDY, TEN, TENC, TEXT, TFLT, TFT, TGID, +TIM, TIME, TIPL, TIT1, TIT2, TIT3, TKE, TKEY, TKWD, TLA, TLAN, TLE, TLEN, +TMCL, TMED, TMOO, TMT, TOA, TOAL, TOF, TOFN, TOL, TOLY, TOPE, TOR, TORY, TOT, +TOWN, TP1, TP2, TP3, TP4, TPA, TPB, TPE1, TPE2, TPE3, TPE4, TPOS, TPRO, TPUB, +TRC, TRCK, TRD, TRDA, TRK, TRSN, TRSO, TS2, TSA, TSC, TSI, TSIZ, TSO2, TSOA, +TSOC, TSOP, TSOT, TSP, TSRC, TSS, TSSE, TSST, TST, TT1, TT2, TT3, TXT, TXX, +TXXX, TYE, TYER, UFI, UFID, ULT, USER, USLT, WAF, WAR, WAS, WCM, WCOM, WCOP, +WCP, WFED, WOAF, WOAR, WOAS, WORS, WPAY, WPB, WPUB, WXX, WXXX + # Workaround for http://tickets.musicbrainz.org/browse/PICARD-833 class _DummySpecForPicard(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/mp4/__init__.py new/mutagen-1.40.0/mutagen/mp4/__init__.py --- old/mutagen-1.39/mutagen/mp4/__init__.py 2017-06-01 17:42:11.000000000 +0200 +++ new/mutagen-1.40.0/mutagen/mp4/__init__.py 2018-01-01 18:05:05.000000000 +0100 @@ -1067,7 +1067,6 @@ if not MP4Tags._can_load(atoms): self.tags = None - self._padding = 0 else: try: self.tags = self.MP4Tags(atoms, fileobj) @@ -1075,8 +1074,13 @@ raise except Exception as err: reraise(MP4MetadataError, err, sys.exc_info()[2]) - else: - self._padding = self.tags._padding + + @property + def _padding(self): + if self.tags is None: + return 0 + else: + return self.tags._padding def save(self, *args, **kwargs): """save(filething=None, padding=None)""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/mutagen/trueaudio.py new/mutagen-1.40.0/mutagen/trueaudio.py --- old/mutagen-1.39/mutagen/trueaudio.py 2017-11-05 19:55:19.000000000 +0100 +++ new/mutagen-1.40.0/mutagen/trueaudio.py 2018-01-20 12:43:44.000000000 +0100 @@ -10,7 +10,7 @@ True Audio is a lossless format designed for real-time encoding and decoding. This module is based on the documentation at -http://www.true-audio.com/TTA_Lossless_Audio_Codec_-_Format_Description +http://www.true-audio.com/TTA_Lossless_Audio_Codec\\_-_Format_Description True Audio files use ID3 tags. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/setup.py new/mutagen-1.40.0/setup.py --- old/mutagen-1.39/setup.py 2017-08-09 11:40:04.000000000 +0200 +++ new/mutagen-1.40.0/setup.py 2018-01-25 15:19:47.000000000 +0100 @@ -14,12 +14,18 @@ import subprocess import tarfile -from distutils.core import setup, Command -from distutils.command.clean import clean as distutils_clean -from distutils.command.sdist import sdist +from distutils.core import setup, Command, Distribution from distutils import dir_util +def get_command_class(name): + # Returns the right class for either distutils or setuptools + return Distribution({}).get_command_class(name) + + +distutils_clean = get_command_class("clean") + + class clean(distutils_clean): def run(self): # In addition to what the normal clean run does, remove pyc @@ -51,7 +57,10 @@ shutil.rmtree(path) -class distcheck(sdist): +distutils_sdist = get_command_class("sdist") + + +class distcheck(distutils_sdist): def _check_manifest(self): assert self.get_archive_files() @@ -71,7 +80,8 @@ assert process.returncode == 0 tracked_files = out.splitlines() - for ignore in [".travis.yml", "run_wine.sh", ".gitignore"]: + for ignore in [".travis.yml", ".gitignore", ".codecov.yml", + ".appveyor.yml"]: tracked_files.remove(ignore) diff = set(tracked_files) - set(included_files) @@ -105,7 +115,7 @@ os.chdir(old_pwd) def run(self): - sdist.run(self) + distutils_sdist.run(self) self._check_manifest() self._check_dist() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/tests/__init__.py new/mutagen-1.40.0/tests/__init__.py --- old/mutagen-1.39/tests/__init__.py 2017-08-09 11:40:04.000000000 +0200 +++ new/mutagen-1.40.0/tests/__init__.py 2018-01-23 11:48:05.000000000 +0100 @@ -3,7 +3,6 @@ import re import os import sys -import warnings import shutil import contextlib from unittest import TestCase as BaseTestCase @@ -27,12 +26,6 @@ "Try setting LANG=C.UTF-8") -# Make sure we see all deprecation warnings so we either have to avoid them -# or capture them in the test suite -warnings.simplefilter("always") -warnings.simplefilter("ignore", PendingDeprecationWarning) - - def get_temp_copy(path): """Returns a copy of the file with the same extension""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/tests/test__util.py new/mutagen-1.40.0/tests/test__util.py --- old/mutagen-1.39/tests/test__util.py 2017-11-03 12:33:38.000000000 +0100 +++ new/mutagen-1.40.0/tests/test__util.py 2018-01-23 11:39:31.000000000 +0100 @@ -4,7 +4,7 @@ decode_terminated, dict_match, enum, get_size, BitReader, BitReaderError, \ resize_bytes, seek_end, mmap_move, verify_fileobj, fileobj_name, \ read_full, flags, resize_file, fallback_move, encode_endian, loadfile, \ - intround + intround, verify_filename from mutagen._compat import text_type, itervalues, iterkeys, iteritems, PY2, \ cBytesIO, xrange, BytesIO, builtins from tests import TestCase, get_temp_empty @@ -19,6 +19,8 @@ except ImportError: fcntl = None +import pytest + def test_intround(): assert intround(2.5) == 2 @@ -788,6 +790,35 @@ assert raised + def test_filename_from_fspath(self): + + class FilePath(object): + def __init__(self, filename): + self.filename = filename + + def __fspath__(self): + return self.filename + + @loadfile(method=False, writable=True) + def file_func(filething): + fileobj = filething.fileobj + assert fileobj.read(3) == b"foo" + fileobj.seek(0, 2) + fileobj.write(b"bar") + + filename = get_temp_empty() + try: + with open(filename, "wb") as h: + h.write(b"foo") + file_func(FilePath(filename)) + with open(filename, "rb") as h: + assert h.read() == b"foobar" + finally: + os.unlink(filename) + + with pytest.raises(TypeError, match=r'.*__fspath__.*'): + file_func(FilePath(42)) + class Tread_full(TestCase): @@ -966,3 +997,22 @@ self.assertFalse(r.is_aligned()) r.bits(1) self.assertTrue(r.is_aligned()) + + +class Tverify_filename(TestCase): + + def test_verify_filename_fail(self): + self.assertRaises(ValueError, verify_filename, object()) + + def test_verify_filename(self): + + class FilePath(object): + def __init__(self, filename): + self.filename = filename + + def __fspath__(self): + return self.filename + + verify_filename(FilePath("foo")) + verify_filename("foo") + verify_filename(b"foo") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/tests/test_apev2.py new/mutagen-1.40.0/tests/test_apev2.py --- old/mutagen-1.39/tests/test_apev2.py 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/tests/test_apev2.py 2017-12-24 09:25:00.000000000 +0100 @@ -141,6 +141,15 @@ tag[u"cba"] = "abc" tag.save() + def test_save_sort_is_deterministic(self): + tag = mutagen.apev2.APEv2(SAMPLE + ".new") + tag["cba"] = "my cba value" + tag["abc"] = "my abc value" + tag.save() + with open(SAMPLE + ".new", 'rb') as fobj: + content = fobj.read() + self.assertTrue(content.index(b"abc") < content.index(b"cba")) + def tearDown(self): os.unlink(SAMPLE + ".new") os.unlink(BROKEN + ".new") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/tests/test_easymp4.py new/mutagen-1.40.0/tests/test_easymp4.py --- old/mutagen-1.39/tests/test_easymp4.py 2017-05-25 15:49:20.000000000 +0200 +++ new/mutagen-1.40.0/tests/test_easymp4.py 2018-01-01 18:05:05.000000000 +0100 @@ -18,6 +18,17 @@ def tearDown(self): os.unlink(self.filename) + def test_no_tags(self): + audio = EasyMP4(os.path.join(DATA_DIR, 'no-tags.m4a')) + assert audio.tags is None + audio.add_tags() + assert audio.tags is not None + + def test_padding(self): + assert self.mp4._padding == 1634 + self.mp4.save(padding=lambda x: 42) + assert EasyMP4(self.mp4.filename)._padding == 42 + def test_pprint(self): self.mp4["artist"] = "baz" self.mp4.pprint() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mutagen-1.39/tests/test_id3.py new/mutagen-1.40.0/tests/test_id3.py --- old/mutagen-1.39/tests/test_id3.py 2017-05-31 11:17:00.000000000 +0200 +++ new/mutagen-1.40.0/tests/test_id3.py 2018-01-20 12:37:28.000000000 +0100 @@ -9,7 +9,7 @@ CHAP, CTOC, TT1, TCON, COMM, TORY, PIC, MakeID3v1, TRCK, TYER, TDRC, \ TDAT, TIME, LNK, IPLS, TPE1, BinaryFrame, TIT3, POPM, APIC, CRM, \ TALB, TPE2, TSOT, TDEN, TIPL, ParseID3v1, Encoding, ID3Tags, RVAD, \ - ID3NoHeaderError + ID3NoHeaderError, Frames_2_2 from mutagen.id3._util import BitPaddedInt, error as ID3Error from mutagen.id3._tags import determine_bpi, ID3Header, \ save_frame, ID3SaveConfig @@ -19,6 +19,13 @@ from tests import TestCase, DATA_DIR, get_temp_copy, get_temp_empty +def test_id3_module_exports_all_frames(): + for key in Frames: + assert getattr(id3, key) is Frames[key] + for key in Frames_2_2: + assert getattr(id3, key) is Frames_2_2[key] + + class TID3Read(TestCase): empty = os.path.join(DATA_DIR, 'emptyfile.mp3')