From 2135b5caf7de153ec69092de542e0a413983af764d3102e72484d1795194bbcb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 17 Oct 2018 15:11:53 +0000 Subject: [PATCH 1/4] Testing upstream bug# 390 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=52 --- python-cffi.spec | 14 +++++++++++++- test_cos_01.py | 6 ++++++ test_cos_02.py | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test_cos_01.py create mode 100644 test_cos_02.py diff --git a/python-cffi.spec b/python-cffi.spec index 626e2b0..6de9784 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -26,6 +26,8 @@ Group: Development/Languages/Python URL: http://cffi.readthedocs.org Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz Source1: python-cffi-rpmlintrc +Source2: test_cos_01.py +Source3: test_cos_02.py # https://bitbucket.org/cffi/cffi/issues/384/ Patch0: e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch # https://bitbucket.org/cffi/cffi/issues/378 @@ -50,6 +52,9 @@ is to provide a convenient and reliable way of calling C code from Python. %setup -q -n cffi-%{version} %autopatch -p1 +cp -v -p %{SOURCE2} . +cp -v -p %{SOURCE3} . + %build export CFLAGS="%{optflags}" %python_build @@ -59,7 +64,14 @@ export CFLAGS="%{optflags}" %python_expand %fdupes %{buildroot}%{$python_sitearch} %check -%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} py.test-%$python_bin_suffix -W ignore::UserWarning c/ testing/ +# https://bitbucket.org/cffi/cffi/issues/390/ +%{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} +py.test-%$python_bin_suffix -k test_dlopen_filename -W ignore::UserWarning c/ testing/ +echo "Testing test_cos_01.py" +%python_exec test_cos_01.py +echo "Testing test_cos_02.py" +%python_exec test_cos_02.py +} %files %{python_files} %license LICENSE diff --git a/test_cos_01.py b/test_cos_01.py new file mode 100644 index 0000000..216d4f5 --- /dev/null +++ b/test_cos_01.py @@ -0,0 +1,6 @@ +import cffi, ctypes.util +ctypes.util.find_library('m') +ffi = cffi.FFI() +ffi.cdef("double cos(double);") +print(ffi.dlopen('m').cos(1.23)) +print(ffi.dlopen('libm.so.6').cos(1.23)) diff --git a/test_cos_02.py b/test_cos_02.py new file mode 100644 index 0000000..023f2fc --- /dev/null +++ b/test_cos_02.py @@ -0,0 +1,6 @@ +import cffi, ctypes.util +ctypes.util.find_library('m') +ffi = cffi.FFI() +ffi.cdef("double cos(double);") +print(ffi.dlopen('libm.so.6').cos(1.23)) +print(ffi.dlopen('m').cos(1.23)) From b8ddb5dcdb8eee40570021a6d7386fc23713f028f886040600406bede643b3b0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 17 Oct 2018 15:28:45 +0000 Subject: [PATCH 2/4] Test again OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=53 --- python-cffi.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python-cffi.spec b/python-cffi.spec index 6de9784..06292bc 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -65,13 +65,14 @@ export CFLAGS="%{optflags}" %check # https://bitbucket.org/cffi/cffi/issues/390/ -%{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} py.test-%$python_bin_suffix -k test_dlopen_filename -W ignore::UserWarning c/ testing/ -echo "Testing test_cos_01.py" -%python_exec test_cos_01.py -echo "Testing test_cos_02.py" -%python_exec test_cos_02.py } +export PYTHONPATH=%{buildroot}%{python2_sitearch} +echo "Testing test_cos_01.py" +python2 test_cos_01.py +echo "Testing test_cos_02.py" +python2 test_cos_02.py %files %{python_files} %license LICENSE From 5b720e63b6f2b7672758356fc971616c96b0da1e24815df3cb4664384ce0ec71 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 17 Oct 2018 16:45:01 +0000 Subject: [PATCH 3/4] Fix py.test calling OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=54 --- python-cffi.spec | 12 +----------- test_cos_01.py | 6 ------ test_cos_02.py | 6 ------ 3 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 test_cos_01.py delete mode 100644 test_cos_02.py diff --git a/python-cffi.spec b/python-cffi.spec index 06292bc..624bdc5 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -26,8 +26,6 @@ Group: Development/Languages/Python URL: http://cffi.readthedocs.org Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz Source1: python-cffi-rpmlintrc -Source2: test_cos_01.py -Source3: test_cos_02.py # https://bitbucket.org/cffi/cffi/issues/384/ Patch0: e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch # https://bitbucket.org/cffi/cffi/issues/378 @@ -52,9 +50,6 @@ is to provide a convenient and reliable way of calling C code from Python. %setup -q -n cffi-%{version} %autopatch -p1 -cp -v -p %{SOURCE2} . -cp -v -p %{SOURCE3} . - %build export CFLAGS="%{optflags}" %python_build @@ -66,13 +61,8 @@ export CFLAGS="%{optflags}" %check # https://bitbucket.org/cffi/cffi/issues/390/ %{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} -py.test-%$python_bin_suffix -k test_dlopen_filename -W ignore::UserWarning c/ testing/ +py.test-%$python_bin_suffix -v -k 'not test_dlopen' -W ignore::UserWarning c/ testing/ } -export PYTHONPATH=%{buildroot}%{python2_sitearch} -echo "Testing test_cos_01.py" -python2 test_cos_01.py -echo "Testing test_cos_02.py" -python2 test_cos_02.py %files %{python_files} %license LICENSE diff --git a/test_cos_01.py b/test_cos_01.py deleted file mode 100644 index 216d4f5..0000000 --- a/test_cos_01.py +++ /dev/null @@ -1,6 +0,0 @@ -import cffi, ctypes.util -ctypes.util.find_library('m') -ffi = cffi.FFI() -ffi.cdef("double cos(double);") -print(ffi.dlopen('m').cos(1.23)) -print(ffi.dlopen('libm.so.6').cos(1.23)) diff --git a/test_cos_02.py b/test_cos_02.py deleted file mode 100644 index 023f2fc..0000000 --- a/test_cos_02.py +++ /dev/null @@ -1,6 +0,0 @@ -import cffi, ctypes.util -ctypes.util.find_library('m') -ffi = cffi.FFI() -ffi.cdef("double cos(double);") -print(ffi.dlopen('libm.so.6').cos(1.23)) -print(ffi.dlopen('m').cos(1.23)) From e2182e7d2afc02f2bb3d32b55a541499d73708f3fe82318e9bd5de2bae2f7137 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 17 Oct 2018 16:53:51 +0000 Subject: [PATCH 4/4] Fix *.changes file OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=55 --- python-cffi.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python-cffi.changes b/python-cffi.changes index 73c0c1d..87659af 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 17 18:53:19 CEST 2018 - mcepl@suse.com + +- Fix calling of py.test executor. + ------------------------------------------------------------------- Fri Sep 21 07:24:58 CEST 2018 - mcepl@suse.com