- Add patch to build without python2:
* no-python-binary.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pexpect?expand=0&rev=53
This commit is contained in:
parent
89afa07900
commit
f24bc875de
96
no-python-binary.patch
Normal file
96
no-python-binary.patch
Normal file
@ -0,0 +1,96 @@
|
||||
Index: pexpect-4.8.0/tests/test_performance.py
|
||||
===================================================================
|
||||
--- pexpect-4.8.0.orig/tests/test_performance.py
|
||||
+++ pexpect-4.8.0/tests/test_performance.py
|
||||
@@ -45,7 +45,7 @@ class PerformanceTestCase (PexpectTestCa
|
||||
return 'for n in range(1, %d+1): print(n)' % n
|
||||
|
||||
def plain_range(self, n):
|
||||
- e = pexpect.spawn('python', timeout=100)
|
||||
+ e = pexpect.spawn(sys.executable, timeout=100)
|
||||
self.assertEqual(e.expect(b'>>>'), 0)
|
||||
e.sendline(self._iter_n(n))
|
||||
self.assertEqual(e.expect(br'\.{3}'), 0)
|
||||
@@ -53,7 +53,7 @@ class PerformanceTestCase (PexpectTestCa
|
||||
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
|
||||
|
||||
def window_range(self, n):
|
||||
- e = pexpect.spawn('python', timeout=100)
|
||||
+ e = pexpect.spawn(sys.executable, timeout=100)
|
||||
self.assertEqual(e.expect(b'>>>'), 0)
|
||||
e.sendline(self._iter_n(n))
|
||||
self.assertEqual(e.expect(r'\.{3}'), 0)
|
||||
@@ -61,7 +61,7 @@ class PerformanceTestCase (PexpectTestCa
|
||||
self.assertEqual(e.expect([b'inquisition', '%d' % n], searchwindowsize=20), 1)
|
||||
|
||||
def exact_range(self, n):
|
||||
- e = pexpect.spawn('python', timeout=100)
|
||||
+ e = pexpect.spawn(sys.executable, timeout=100)
|
||||
self.assertEqual(e.expect_exact([b'>>>']), 0)
|
||||
e.sendline(self._iter_n(n))
|
||||
self.assertEqual(e.expect_exact([b'...']), 0)
|
||||
@@ -69,7 +69,7 @@ class PerformanceTestCase (PexpectTestCa
|
||||
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n],timeout=520), 1)
|
||||
|
||||
def ewin_range(self, n):
|
||||
- e = pexpect.spawn('python', timeout=100)
|
||||
+ e = pexpect.spawn(sys.executable, timeout=100)
|
||||
self.assertEqual(e.expect_exact([b'>>>']), 0)
|
||||
e.sendline(self._iter_n(n))
|
||||
self.assertEqual(e.expect_exact([b'...']), 0)
|
||||
@@ -77,7 +77,7 @@ class PerformanceTestCase (PexpectTestCa
|
||||
self.assertEqual(e.expect_exact([b'inquisition', '%d' % n], searchwindowsize=20), 1)
|
||||
|
||||
def faster_range(self, n):
|
||||
- e = pexpect.spawn('python', timeout=100)
|
||||
+ e = pexpect.spawn(sys.executable, timeout=100)
|
||||
self.assertEqual(e.expect(b'>>>'), 0)
|
||||
e.sendline(('list(range(1, %d+1))' % n).encode('ascii'))
|
||||
self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
|
||||
Index: pexpect-4.8.0/tests/test_replwrap.py
|
||||
===================================================================
|
||||
--- pexpect-4.8.0.orig/tests/test_replwrap.py
|
||||
+++ pexpect-4.8.0/tests/test_replwrap.py
|
||||
@@ -2,6 +2,7 @@ import platform
|
||||
import unittest
|
||||
import re
|
||||
import os
|
||||
+import sys
|
||||
|
||||
import pexpect
|
||||
from pexpect import replwrap
|
||||
@@ -108,7 +109,7 @@ class REPLWrapTestCase(unittest.TestCase
|
||||
if platform.python_implementation() == 'PyPy':
|
||||
raise unittest.SkipTest(skip_pypy)
|
||||
|
||||
- child = pexpect.spawn('python', echo=False, timeout=5, encoding='utf-8')
|
||||
+ child = pexpect.spawn(sys.executable, echo=False, timeout=5, encoding='utf-8')
|
||||
# prompt_change=None should mean no prompt change
|
||||
py = replwrap.REPLWrapper(child, u">>> ", prompt_change=None,
|
||||
continuation_prompt=u"... ")
|
||||
Index: pexpect-4.8.0/tests/test_run.py
|
||||
===================================================================
|
||||
--- pexpect-4.8.0.orig/tests/test_run.py
|
||||
+++ pexpect-4.8.0/tests/test_run.py
|
||||
@@ -69,7 +69,7 @@ class RunFuncTestCase(PexpectTestCase.Pe
|
||||
super(RunFuncTestCase, self).tearDown()
|
||||
|
||||
def test_run_exit(self):
|
||||
- (data, exitstatus) = self.runfunc('python exit1.py', withexitstatus=1)
|
||||
+ (data, exitstatus) = self.runfunc(sys.executable + ' exit1.py', withexitstatus=1)
|
||||
assert exitstatus == 1, "Exit status of 'python exit1.py' should be 1."
|
||||
|
||||
def test_run(self):
|
||||
Index: pexpect-4.8.0/pexpect/replwrap.py
|
||||
===================================================================
|
||||
--- pexpect-4.8.0.orig/pexpect/replwrap.py
|
||||
+++ pexpect-4.8.0/pexpect/replwrap.py
|
||||
@@ -108,7 +108,7 @@ class REPLWrapper(object):
|
||||
+ command)
|
||||
return u''.join(res + [self.child.before])
|
||||
|
||||
-def python(command="python"):
|
||||
+def python(command=sys.executable):
|
||||
"""Start a Python shell and return a :class:`REPLWrapper` object."""
|
||||
return REPLWrapper(command, u">>> ", u"import sys; sys.ps1={0!r}; sys.ps2={1!r}")
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 12 11:32:53 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Add patch to build without python2:
|
||||
* no-python-binary.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 14 12:44:51 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||
|
||||
|
@ -22,9 +22,9 @@ Version: 4.8.0
|
||||
Release: 0
|
||||
Summary: Pure Python Expect-like module
|
||||
License: ISC
|
||||
Group: Development/Libraries/Python
|
||||
URL: http://pexpect.readthedocs.org/en/latest/
|
||||
URL: https://pexpect.readthedocs.org/en/latest/
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pexpect/pexpect-%{version}.tar.gz
|
||||
Patch0: no-python-binary.patch
|
||||
BuildRequires: %{python_module ptyprocess}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
@ -46,6 +46,7 @@ controlling them; and responding to expected patterns in their output.
|
||||
|
||||
%prep
|
||||
%setup -q -n pexpect-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
# Fix wrong-script-interpreter
|
||||
find examples -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python||" {} \;
|
||||
|
Loading…
Reference in New Issue
Block a user