Hello community, here is the log from the commit of package python-mutagen for openSUSE:Factory checked in at 2017-04-28 10:37:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mutagen (Old) and /work/SRC/openSUSE:Factory/.python-mutagen.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mutagen" Fri Apr 28 10:37:57 2017 rev:27 rq:487700 version:1.37 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mutagen/python-mutagen.changes 2017-03-31 15:02:01.979616273 +0200 +++ /work/SRC/openSUSE:Factory/.python-mutagen.new/python-mutagen.changes 2017-04-28 10:38:10.251284608 +0200 @@ -1,0 +2,11 @@ +Thu Apr 6 15:52:21 UTC 2017 - [email protected] + +- Use singlespec macros. +- Drop fix-tests-tools-names.diff which is not needed anymore. +- Add reduce-test-length.diff to reduce the number of iterations in a test + that is repeated for each data test file, for every byte, so it only tests + each file for the first 10 bytes. This way we reduce the time it takes to + test mutagen (and the corresponding cpu usage in obs) from 1078 seconds + (nearly 18 minutes) to 53 seconds (for each python version). + +------------------------------------------------------------------- Old: ---- fix-tests-tools-names.diff New: ---- reduce-test-length.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mutagen.spec ++++++ --- /var/tmp/diff_new_pack.27N3Qd/_old 2017-04-28 10:38:12.974899644 +0200 +++ /var/tmp/diff_new_pack.27N3Qd/_new 2017-04-28 10:38:12.978899078 +0200 @@ -16,11 +16,7 @@ # -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else -BuildArch: noarch -%endif +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-mutagen Version: 1.37 Release: 0 @@ -29,14 +25,16 @@ 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 fix-tests-tools-names.diff -- Undo the alternate-names of the tools when importing the modules so tests build successfully. -Patch0: fix-tests-tools-names.diff -BuildRequires: python-devel -BuildRequires: python-pytest -BuildRequires: python-setuptools -Requires(post): update-alternatives -Requires(preun): update-alternatives +# PATCH-FIX-OPENSUSE reduce-test-length.diff [email protected] -- Reduce the number of iterations so tests don't take so long to finish +Patch0: reduce-test-length.diff +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch +%python_subpackages %description Mutagen is a Python module to handle audio metadata. It supports FLAC, @@ -53,94 +51,45 @@ # remove shebangs from library files find mutagen/ -name "*.py" -exec sed -i -e '/^#!\s\?\/usr\/bin\/\(env\s\)\?python$/d' {} ';' -export LANG=en_US.UTF-8 -for i in mid3cp mid3iconv mid3v2 moggsplit mutagen-inspect mutagen-pony; do - j=`echo $i|tr '-' '_'` - sed -i "s/\"${i}\"/\"${i}-%{py_ver}\"/g" setup.py - sed -i "s/u\"${i}\"/u\"${i}-%{py_ver}\"/g" tests/test_tools_${j}.py - mv tools/${i} tools/${i}-%{py_ver} - mv man/${i}.1 man/${i}-%{py_ver}.1 -done - %build -python setup.py build +%python_build %install -python setup.py install --root=%{buildroot} --prefix="%{_prefix}" +%python_install -# Prepare for update-alternatives usage -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -for p in mid3cp mid3iconv mid3v2 moggsplit mutagen-inspect mutagen-pony; do - ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p - ln -s -f %{_sysconfdir}/alternatives/$p.1.gz %{buildroot}%{_mandir}/man1/${p}.1.gz +for i in mid3cp mid3iconv mid3v2 moggsplit mutagen-inspect mutagen-pony; do + %python_clone -a %{buildroot}%{_bindir}/${i} + %python_clone -a %{buildroot}%{_mandir}/man1/${i}.1 done +%python_expand %fdupes %{buildroot}%{$python_sitelib}/mutagen %post -%{_sbindir}/update-alternatives \ - --install %{_bindir}/mid3cp mid3cp %{_bindir}/mid3cp-%{py_ver} 30 \ - --slave %{_bindir}/mid3iconv mid3iconv %{_bindir}/mid3iconv-%{py_ver} \ - --slave %{_bindir}/mid3v2 mid3v2 %{_bindir}/mid3v2-%{py_ver} \ - --slave %{_bindir}/moggsplit moggsplit %{_bindir}/moggsplit-%{py_ver} \ - --slave %{_bindir}/mutagen-inspect mutagen-inspect %{_bindir}/mutagen-inspect-%{py_ver} \ - --slave %{_bindir}/mutagen-pony mutagen-pony %{_bindir}/mutagen-pony-%{py_ver} \ - --slave %{_mandir}/man1/mid3cp.1.gz mid3cp.1.gz %{_mandir}/man1/mid3cp-%{py_ver}.1.gz \ - --slave %{_mandir}/man1/mid3iconv.1.gz mid3iconv.1.gz %{_mandir}/man1/mid3iconv-%{py_ver}.1.gz \ - --slave %{_mandir}/man1/mid3v2.1.gz mid3v2.1.gz %{_mandir}/man1/mid3v2-%{py_ver}.1.gz \ - --slave %{_mandir}/man1/moggsplit.1.gz moggsplit.1.gz %{_mandir}/man1/moggsplit-%{py_ver}.1.gz \ - --slave %{_mandir}/man1/mutagen-inspect.1.gz mutagen-inspect.1.gz %{_mandir}/man1/mutagen-inspect-%{py_ver}.1.gz \ - --slave %{_mandir}/man1/mutagen-pony.1.gz mutagen-pony.1.gz %{_mandir}/man1/mutagen-pony-%{py_ver}.1.gz +%{python_install_alternative mid3cp mid3iconv mid3v2 moggsplit mutagen-inspect mutagen-pony mid3cp.1 mid3iconv.1 mid3v2.1 moggsplit.1 mutagen-inspect.1 mutagen-pony.1} %preun -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove mid3cp %{_bindir}/mid3cp-%{py_ver} -fi +%{python_uninstall_alternative mid3cp} %check export LANG=en_US.UTF-8 -export PATH="$PATH:%{buildroot}%{_bindir}" -export PYTHONPATH="$PYTHONPATH:%{buildroot}%{python_sitelib}" -python setup.py test +#export PATH="$PATH:%%{buildroot}%%{_bindir}" +%python_exec setup.py test -%files +%files %{python_files} %defattr(-, root, root, 0755) %doc COPYING NEWS README.rst -%{_bindir}/mid3cp -%{_bindir}/mid3iconv -%{_bindir}/mid3v2 -%{_bindir}/moggsplit -%{_bindir}/mutagen-inspect -%{_bindir}/mutagen-pony -%{_bindir}/mid3cp-%{py_ver} -%{_bindir}/mid3iconv-%{py_ver} -%{_bindir}/mid3v2-%{py_ver} -%{_bindir}/moggsplit-%{py_ver} -%{_bindir}/mutagen-inspect-%{py_ver} -%{_bindir}/mutagen-pony-%{py_ver} -%ghost %{_sysconfdir}/alternatives/mid3cp -%ghost %{_sysconfdir}/alternatives/mid3iconv -%ghost %{_sysconfdir}/alternatives/mid3v2 -%ghost %{_sysconfdir}/alternatives/moggsplit -%ghost %{_sysconfdir}/alternatives/mutagen-inspect -%ghost %{_sysconfdir}/alternatives/mutagen-pony -%{_mandir}/man1/mid3cp.1%{ext_man} -%{_mandir}/man1/mid3iconv.1%{ext_man} -%{_mandir}/man1/mid3v2.1%{ext_man} -%{_mandir}/man1/moggsplit.1%{ext_man} -%{_mandir}/man1/mutagen-inspect.1%{ext_man} -%{_mandir}/man1/mutagen-pony.1%{ext_man} -%{_mandir}/man1/mid3cp-%{py_ver}.1%{ext_man} -%{_mandir}/man1/mid3iconv-%{py_ver}.1%{ext_man} -%{_mandir}/man1/mid3v2-%{py_ver}.1%{ext_man} -%{_mandir}/man1/moggsplit-%{py_ver}.1%{ext_man} -%{_mandir}/man1/mutagen-inspect-%{py_ver}.1%{ext_man} -%{_mandir}/man1/mutagen-pony-%{py_ver}.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/mid3cp.1.gz -%ghost %{_sysconfdir}/alternatives/mid3iconv.1.gz -%ghost %{_sysconfdir}/alternatives/mid3v2.1.gz -%ghost %{_sysconfdir}/alternatives/moggsplit.1.gz -%ghost %{_sysconfdir}/alternatives/mutagen-inspect.1.gz -%ghost %{_sysconfdir}/alternatives/mutagen-pony.1.gz +%python_alternative %{_bindir}/mid3cp +%python_alternative %{_bindir}/mid3iconv +%python_alternative %{_bindir}/mid3v2 +%python_alternative %{_bindir}/moggsplit +%python_alternative %{_bindir}/mutagen-inspect +%python_alternative %{_bindir}/mutagen-pony +%python_alternative %{_mandir}/man1/mid3cp.1%{ext_man} +%python_alternative %{_mandir}/man1/mid3iconv.1%{ext_man} +%python_alternative %{_mandir}/man1/mid3v2.1%{ext_man} +%python_alternative %{_mandir}/man1/moggsplit.1%{ext_man} +%python_alternative %{_mandir}/man1/mutagen-inspect.1%{ext_man} +%python_alternative %{_mandir}/man1/mutagen-pony.1%{ext_man} %{python_sitelib}/mutagen -%{python_sitelib}/mutagen-%{version}-py*.egg-info +%{python_sitelib}/mutagen-%{version}-py%{python_version}.egg-info %changelog ++++++ reduce-test-length.diff ++++++ Index: mutagen-1.37/tests/test___init__.py =================================================================== --- mutagen-1.37.orig/tests/test___init__.py +++ mutagen-1.37/tests/test___init__.py @@ -270,7 +270,7 @@ def iter_test_file_objects(fileobj): # first figure out how much a successful attempt reads and how many # file object operations it executes. yield t - for i in xrange(t.dataread): + for i in xrange(min(t.dataread, 10)): yield _TestFileObj(fileobj, stop_after=i) for i in xrange(t.operations): yield _TestFileObj(fileobj, fail_after=i)
