From 4a228144f67abb1606fc73973fe67af592523d32c0df693a0dd625bf26c7d653 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sat, 28 Jul 2018 10:45:33 +0000 Subject: [PATCH] Accepting request 625840 from devel:languages:python:numeric OBS-URL: https://build.opensuse.org/request/show/625840 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-numba?expand=0&rev=13 --- numba-0.39.0-fix-3135.patch | 48 +++++++++++++++++++++++++++++++++++++ python-numba.changes | 6 +++++ python-numba.spec | 14 ++++++----- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 numba-0.39.0-fix-3135.patch diff --git a/numba-0.39.0-fix-3135.patch b/numba-0.39.0-fix-3135.patch new file mode 100644 index 0000000..95d6d65 --- /dev/null +++ b/numba-0.39.0-fix-3135.patch @@ -0,0 +1,48 @@ +From 99d35798b2e833792624574fd1b31b41bd1f496e Mon Sep 17 00:00:00 2001 +From: Stuart Archibald +Date: Thu, 19 Jul 2018 20:38:31 +0100 +Subject: [PATCH] Fix #3135 + +This fixes #3135 by adding guards to make sure that only line +numbers in Z^+ are accessed and if no lines are found then they +are not addressed. Test case from bug report is added. +--- + numba/ir.py | 18 ++++++++++++------ + numba/tests/test_errorhandling.py | 16 ++++++++++++++++ + 2 files changed, 28 insertions(+), 6 deletions(-) + +--- a/numba/ir.py ++++ b/numba/ir.py +@@ -63,7 +63,12 @@ class Loc(object): + spaces += 1 + return spaces + +- selected = lines[self.line - nlines_up:self.line] ++ # A few places in the code still use no `loc` or default to line 1 ++ # this is often in places where exceptions are used for the purposes ++ # of flow control. As a result max is in use to prevent slice from ++ # `[negative: positive]` ++ selected = lines[max(0, self.line - nlines_up):self.line] ++ + # see if selected contains a definition + def_found = False + for x in selected: +@@ -83,12 +88,13 @@ class Loc(object): + spaces = count_spaces(x) + ret.append(' '*(4 + spaces) + '\n') + +- ret.extend(selected[:-1]) +- ret.append(_termcolor.highlight(selected[-1])) ++ if selected: ++ ret.extend(selected[:-1]) ++ ret.append(_termcolor.highlight(selected[-1])) + +- # point at the problem with a caret +- spaces = count_spaces(selected[-1]) +- ret.append(' '*(spaces) + _termcolor.indicate("^")) ++ # point at the problem with a caret ++ spaces = count_spaces(selected[-1]) ++ ret.append(' '*(spaces) + _termcolor.indicate("^")) + + # if in the REPL source may not be available + if not ret: diff --git a/python-numba.changes b/python-numba.changes index 6e40538..6e859ee 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 20 13:09:58 UTC 2018 - mcepl@suse.com + +- Add patch numba-0.39.0-fix-3135.patch to make not fail datashader + tests. (https://github.com/bokeh/datashader/issues/620) + ------------------------------------------------------------------- Fri Jul 13 09:20:32 UTC 2018 - tchvatal@suse.com diff --git a/python-numba.spec b/python-numba.spec index 186f115..f4f629d 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -25,6 +25,7 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: http://numba.github.com Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{version}.tar.gz +Patch0: numba-0.39.0-fix-3135.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module llvmlite >= 0.24} BuildRequires: %{python_module numpy-devel >= 1.10} @@ -76,6 +77,7 @@ This package contains files for developing applications using numba. %prep %setup -q -n numba-%{version} +%patch0 -p1 sed -i '1{\@^#!%{_bindir}/env python@d}' numba/appdirs.py %build @@ -89,12 +91,12 @@ sed -i '1{\@^#!%{_bindir}/env python@d}' numba/appdirs.py %python_clone -a %{buildroot}%{_bindir}/pycc %check -# Sadly needs 3 hours to finish in OBS run localy when updating! -#%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} -#pushd $PYTHONPATH -#$python -Wd -m pytest numba/tests -v -rs -#popd -#} +# # Sadly needs 3 hours to finish in OBS run localy when updating! +# %{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} +# pushd $PYTHONPATH +# $python -Wd -m pytest numba/tests -v -rs +# popd +# } %post %{python_install_alternative numba pycc}