diff --git a/fix-for-regex-2020.1.7.patch b/fix-for-regex-2020.1.7.patch new file mode 100644 index 0000000..4c2224b --- /dev/null +++ b/fix-for-regex-2020.1.7.patch @@ -0,0 +1,21 @@ +From: Antonio Larrosa +Subject: Fix for incompatible changes in python-regex 2020.1.7 + +See the comments on https://github.com/Toilal/rebulk/issues/20 + +This fixes also https://github.com/pymedusa/Medusa/issues/7743 +and https://github.com/Diaoul/subliminal/issues/992 + +Index: rebulk-2.0.0/rebulk/loose.py +=================================================================== +--- rebulk-2.0.0.orig/rebulk/loose.py ++++ rebulk-2.0.0/rebulk/loose.py +@@ -56,7 +56,7 @@ def call(function, *args, **kwargs): + :rtype: object + """ + func = constructor_args if isclass(function) else function_args +- call_args, call_kwargs = func(function, *args, **kwargs) ++ call_args, call_kwargs = func(function, *args, ignore_unused=True, **kwargs) + return function(*call_args, **call_kwargs) + + diff --git a/python-rebulk.changes b/python-rebulk.changes index ae8d7c8..e823d4a 100644 --- a/python-rebulk.changes +++ b/python-rebulk.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Apr 21 09:54:25 UTC 2020 - Antonio Larrosa + +- Add patch to fix an incompatible change introduced in + python-regex 2020.1.7, where unused arguments now raise an + exception: + * fix-for-regex-2020.1.7.patch +- Use %pytest in %check section + ------------------------------------------------------------------- Mon Oct 14 14:40:59 UTC 2019 - Matej Cepl diff --git a/python-rebulk.spec b/python-rebulk.spec index fa8dbb4..7aed114 100644 --- a/python-rebulk.spec +++ b/python-rebulk.spec @@ -1,7 +1,7 @@ # # spec file for package python-rebulk # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,12 +24,14 @@ Summary: Library for defining bulk search patterns to perform advanced st License: MIT URL: https://github.com/Toilal/rebulk Source0: https://files.pythonhosted.org/packages/source/r/rebulk/rebulk-%{version}.tar.gz +Patch0: fix-for-regex-2020.1.7.patch BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch +Recommends: python-regex %python_subpackages %description @@ -42,6 +44,8 @@ allow building a custom and complex string matcher. %prep %setup -q -n rebulk-%{version} +%patch0 -p1 + # Remove shebang from non-executable files for i in {'builder','chain','debug','formatters','__init__','introspector','loose','match','pattern','processors','rebulk','remodule','rules','toposort','utils','validators','__version__'}; do sed -i -e "1d" "rebulk/$i.py" @@ -59,9 +63,7 @@ done %check export PYTHONDONTWRITEBYTECODE=1 -%{python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} -py.test-%{$python_version} rebulk/test/ -} +%pytest rebulk/test/ %files %{python_files} %doc README.rst