[packages/python-cffi] - adjusted tests PYTHONPATH, dropped tests patch; now tests are passing both with python 2.7 and 3.7

qboosh qboosh at pld-linux.org
Wed Aug 1 21:12:18 CEST 2018


commit 62cfd15038dece9c13f206457b4be77846e3a8bf
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Aug 1 21:14:22 2018 +0200

    - adjusted tests PYTHONPATH, dropped tests patch; now tests are passing both with python 2.7 and 3.7 (for me at least...)

 python-cffi-tests.patch | 24 ------------------------
 python-cffi.spec        |  6 ++----
 2 files changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/python-cffi.spec b/python-cffi.spec
index 961f024..c4bb80e 100644
--- a/python-cffi.spec
+++ b/python-cffi.spec
@@ -16,7 +16,6 @@ Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/cffi/
 Source0:	https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
 # Source0-md5:	ac8492f4ad952360737413e82d661908
-Patch0:		%{name}-tests.patch
 URL:		http://cffi.readthedocs.org/
 BuildRequires:	libffi-devel >= 3
 BuildRequires:	pkgconfig
@@ -96,14 +95,13 @@ Dokumentacja API modułu Pythona CFFI.
 
 %prep
 %setup -q -n cffi-%{version}
-%patch0 -p1
 
 %build
 %if %{with python2}
 %py_build
 
 %if %{with tests}
-PYTHONPATH=$(echo build-2/lib.linux-*) \
+PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
 py.test-2 --ignore=testing/embedding/test_thread.py c testing
 %endif
 %endif
@@ -112,7 +110,7 @@ py.test-2 --ignore=testing/embedding/test_thread.py c testing
 %py3_build
 
 %if %{with tests}
-PYTHONPATH=$(echo build-3/lib.linux-*) \
+PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
 py.test-3 --ignore=testing/embedding/test_thread.py c testing
 %endif
 %endif
diff --git a/python-cffi-tests.patch b/python-cffi-tests.patch
deleted file mode 100644
index 7771ecf..0000000
--- a/python-cffi-tests.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- cffi-1.11.5/testing/cffi1/test_zdist.py.orig	2018-02-27 19:15:41.000000000 +0100
-+++ cffi-1.11.5/testing/cffi1/test_zdist.py	2018-05-27 11:40:42.977033830 +0200
-@@ -17,8 +17,8 @@
- 
-     def setup_method(self, meth):
-         self.executable = os.path.abspath(sys.executable)
--        self.rootdir = os.path.abspath(os.path.dirname(os.path.dirname(
--            cffi.__file__)))
-+        self.rootdir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(
-+            cffi.__file__))))
-         self.udir = udir.join(meth.__name__)
-         os.mkdir(str(self.udir))
-         if meth.chdir_to_tmp:
---- cffi-1.11.5/testing/embedding/test_basic.py.orig	2018-02-27 19:15:41.000000000 +0100
-+++ cffi-1.11.5/testing/embedding/test_basic.py	2018-05-27 11:41:38.247033196 +0200
-@@ -26,7 +26,7 @@
- 
- 
- def prefix_pythonpath():
--    cffi_base = os.path.dirname(os.path.dirname(local_dir))
-+    cffi_base = os.path.dirname(os.path.dirname(os.path.dirname(local_dir)))
-     pythonpath = org_env.get('PYTHONPATH', '').split(os.pathsep)
-     if cffi_base not in pythonpath:
-         pythonpath.insert(0, cffi_base)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-cffi.git/commitdiff/62cfd15038dece9c13f206457b4be77846e3a8bf



More information about the pld-cvs-commit mailing list