From 8813d46bcafec271182bd98fb82cd8d832cb469490240366fb2ed6f82715acae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 17 May 2018 13:17:40 +0000 Subject: [PATCH] Accepting request 610076 from home:mcepl:work Depends on new package python-portalocker and fixes Python singlespec. OBS-URL: https://build.opensuse.org/request/show/610076 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-concurrentloghandler?expand=0&rev=10 --- ConcurrentLogHandler-0.9.1-testpath.patch | 15 ++++++- python-concurrentloghandler.changes | 18 ++++++++ python-concurrentloghandler.spec | 52 +++++++++++++---------- 3 files changed, 60 insertions(+), 25 deletions(-) diff --git a/ConcurrentLogHandler-0.9.1-testpath.patch b/ConcurrentLogHandler-0.9.1-testpath.patch index 0d75e92..48c3d86 100644 --- a/ConcurrentLogHandler-0.9.1-testpath.patch +++ b/ConcurrentLogHandler-0.9.1-testpath.patch @@ -1,5 +1,5 @@ ---- setup.py -+++ setup.py +--- a/setup.py ++++ b/setup.py @@ -262,13 +262,7 @@ setup(name='ConcurrentLogHandler', "portalocker", ], @@ -15,3 +15,14 @@ url="http://launchpad.net/python-concurrent-log-handler", license = "http://www.apache.org/licenses/LICENSE-2.0", description=doc.pop(0), +--- /dev/null ++++ b/run_tests.sh +@@ -0,0 +1,8 @@ ++#!/bin/sh ++set -x ++ ++RET=$($1 stresstest.py \ ++ |& sed -n '/^Running internal diff/,/^\s*--- end of diff ----/p' \ ++ |wc -l) ++rm -f test/*.log* ++[ $RET -eq 2 ] diff --git a/python-concurrentloghandler.changes b/python-concurrentloghandler.changes index 82a794b..e9b10a5 100644 --- a/python-concurrentloghandler.changes +++ b/python-concurrentloghandler.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu May 17 13:09:05 UTC 2018 - mcepl@suse.com + +- Fix tests + +------------------------------------------------------------------- +Thu May 17 10:26:32 UTC 2018 - mcepl@suse.com + +- Run spec-cleaner on the SPEC file. +- Fix SPEC file to work according to the latest standards +- Failed to make tests working. + +------------------------------------------------------------------- +Thu Aug 24 13:34:37 UTC 2017 - jmatejek@suse.com + +- singlespec auto-conversion + ------------------------------------------------------------------- Wed Jul 20 17:05:26 UTC 2016 - antoine.belvire@laposte.net @@ -40,3 +57,4 @@ Tue Jun 22 13:10:25 UTC 2010 - hvogel@novell.com - Initial Package, Version 0.8.4 + diff --git a/python-concurrentloghandler.spec b/python-concurrentloghandler.spec index 02d490f..85e49a9 100644 --- a/python-concurrentloghandler.spec +++ b/python-concurrentloghandler.spec @@ -1,7 +1,7 @@ # # spec file for package python-concurrentloghandler # -# Copyright (c) 2016 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 @@ -17,44 +17,50 @@ %define modname ConcurrentLogHandler - +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-concurrentloghandler Version: 0.9.1 Release: 0 Summary: Concurrent logging handler License: Apache-2.0 Group: Development/Libraries/Python -Url: http://pypi.python.org/pypi/ConcurrentLogHandler -Source: https://pypi.python.org/packages/source/C/ConcurrentLogHandler/%{modname}-%{version}.tar.gz -Patch0: %modname-0.9.1-testpath.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-setuptools -%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 +URL: http://pypi.python.org/pypi/ConcurrentLogHandler +Source: https://files.pythonhosted.org/packages/source/C/ConcurrentLogHandler/%{modname}-%{version}.tar.gz +Patch0: %{modname}-0.9.1-testpath.patch +BuildRequires: %{python_module portalocker} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: sed BuildArch: noarch -%endif +%python_subpackages %description -This module provides an additional log handler for Python's standard logging -package (PEP 282). This handler will write log events to log file which is -rotated when the log file reaches a certain size. Multiple processes can safely -write to the same log file concurrently. +This module provides an additional log handler for Python's +standard logging package (PEP 282). This handler will write log +events to log file which is rotated when the log file reaches +a certain size. Multiple processes can safely write to the same +log file concurrently. %prep %setup -q -n %{modname}-%{version} -%patch0 +%patch0 -p1 +rm -v src/portalocker.py %build -export CFLAGS="$RPM_OPT_FLAGS" -python setup.py build +export CFLAGS="%{optflags}" +%python_build %install -python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --install-data=%_defaultdocdir/%name --record-rpm=INSTALLED_FILES +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -%files -f INSTALLED_FILES -%defattr(-,root,root) -%doc README LICENSE +%check +%{python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} sh run_tests.sh $python } + +%files %{python_files} +%license LICENSE +%doc README +%{python_sitelib}/* %changelog