Hello community,
here is the log from the commit of package python-logreduce for
openSUSE:Factory checked in at 2019-09-13 15:02:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-logreduce (Old)
and /work/SRC/openSUSE:Factory/.python-logreduce.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-logreduce"
Fri Sep 13 15:02:09 2019 rev:9 rq:730452 version:0.4.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-logreduce/python-logreduce.changes
2019-04-02 09:23:49.684771208 +0200
+++
/work/SRC/openSUSE:Factory/.python-logreduce.new.7948/python-logreduce.changes
2019-09-13 15:03:47.265276259 +0200
@@ -1,0 +2,6 @@
+Thu Sep 12 17:38:32 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Add aptch to fix build with new scikit:
+ * scikit.patch
+
+-------------------------------------------------------------------
New:
----
scikit.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-logreduce.spec ++++++
--- /var/tmp/diff_new_pack.mjuFic/_old 2019-09-13 15:03:48.345276030 +0200
+++ /var/tmp/diff_new_pack.mjuFic/_new 2019-09-13 15:03:48.353276028 +0200
@@ -26,6 +26,7 @@
Group: Development/Languages/Python
URL: https://logreduce.softwarefactory-project.io/
Source:
https://files.pythonhosted.org/packages/source/l/logreduce/logreduce-%{version}.tar.gz
+Patch0: scikit.patch
BuildRequires: %{python_module pbr}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -79,6 +80,8 @@
%prep
%setup -q -n logreduce-%{version}
+%patch0 -p1
+
sed -i -e 's,flake8.*,,' test-requirements.txt
%build
++++++ scikit.patch ++++++
>From e815b790c41a96ef7518a23ab28d9e3bec088541 Mon Sep 17 00:00:00 2001
From: Tristan Cacqueray <[email protected]>
Date: Tue, 30 Jul 2019 14:03:12 +0000
Subject: Fix scikit-learn 0.21.3 support
Recent scikit release doesn't embed the joblib.
Change-Id: Ie8ad434ea08bf72e7418b116b71ed335b38e1252
---
logreduce/process.py | 10 +++++++---
logreduce/tests/test_process.py | 8 ++++++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/logreduce/process.py b/logreduce/process.py
index f0c8d9b..c934840 100644
--- a/logreduce/process.py
+++ b/logreduce/process.py
@@ -22,7 +22,11 @@ import uuid
import numpy as np
import sklearn.utils.validation
import sklearn.exceptions
-import sklearn.externals
+try:
+ from sklearn.externals import joblib
+except ImportError:
+ # Recent sklearn library doesn't vendor joblib anymore
+ import joblib
from logreduce.models import models
from logreduce.tokenizer import remove_ansible_std_lines_lists
@@ -63,7 +67,7 @@ class Classifier:
fileobj = open(fileobj, 'wb')
fileobj.write(b'LGRD')
fileobj.write(struct.pack('I', self.version))
- sklearn.externals.joblib.dump(self, fileobj, compress=True)
+ joblib.dump(self, fileobj, compress=True)
self.log.debug("%s: written" % fileobj.name)
@staticmethod
@@ -81,7 +85,7 @@ class Classifier:
if isinstance(fileobj, str):
fileobj = open(fileobj, 'rb')
Classifier.check(fileobj)
- return sklearn.externals.joblib.load(fileobj)
+ return joblib.load(fileobj)
@staticmethod
def filename2modelname(filename):
diff --git a/logreduce/tests/test_process.py b/logreduce/tests/test_process.py
index 0889bb6..b27e692 100644
--- a/logreduce/tests/test_process.py
+++ b/logreduce/tests/test_process.py
@@ -43,8 +43,12 @@ class ProcessTests(unittest.TestCase):
logreduce.process.Classifier.check(model)
# joblib load reset the seek for io bytes, bypass model check in test
model = io.BytesIO(model.read())
- import sklearn
- clf = sklearn.externals.joblib.load(model)
+ try:
+ from sklearn.externals import joblib
+ except ImportError:
+ # Recent sklearn library doesn't vendor joblib anymore
+ import joblib
+ clf = joblib.load(model)
# Re-use the model with another test file
target = os.path.join(os.path.dirname(baseline), "test_units.py")
--
cgit v1.2.1