diff options
Diffstat (limited to 'dev-python/pexpect')
-rw-r--r-- | dev-python/pexpect/Manifest | 3 | ||||
-rw-r--r-- | dev-python/pexpect/files/pexpect-4.9.0-py314.patch | 107 | ||||
-rw-r--r-- | dev-python/pexpect/pexpect-4.9.0.ebuild | 6 |
3 files changed, 114 insertions, 2 deletions
diff --git a/dev-python/pexpect/Manifest b/dev-python/pexpect/Manifest index 11752a419a01..12fe0e0f5470 100644 --- a/dev-python/pexpect/Manifest +++ b/dev-python/pexpect/Manifest @@ -1,4 +1,5 @@ AUX pexpect-4.9.0-py313.patch 1787 BLAKE2B e3328efdf42a769bec2b718a5a563e810807bfca4b23931ba386a5aaf844b3eb2ae15f27dcfc1d7df073ec9203194e58684312e1d38dacf621ff8ebc12e2d695 SHA512 ac8f16a04943f279bd76accac79d74c95d620bc777a3f93807f1d0394dd02b238036868749086364257d3473adacd978e2498686ef22b2bbb20b0cff8ae5da57 +AUX pexpect-4.9.0-py314.patch 4346 BLAKE2B 5b2e203a14c17a595ecb976019077f341497195364ee8380779f92f39cabdc93b8470aae93e7f93fdf4fd10eaed3258cd5e59ef80dd9585ec0c40acbdbbe7c60 SHA512 0620f8b084bfab8dfa31c5d308ea91b29c88930a1e05833dc4c4f4e04bb801e02e7eeb0f9e39fe610cb4c9414843d44f172e0d77a93d370073804502d4937560 DIST pexpect-4.9.0.tar.gz 166450 BLAKE2B a08e10deb9f21e49a04021d78dc1ff6c9eeded5825ef73b236c3dac725e6877a4fe74deaa6844c8aa4b1beab4b915d7612e682529c4ed97b364a737a1960b30f SHA512 0e4b3a6978b94aee221ff23cd7bd771517e0e0f1a1a8b17f77f15bf78edd3130ad093d925b7d1e86fe6ba7eb956205d4c616b4e52b2fcfa1e944d4860dd7b3a0 -EBUILD pexpect-4.9.0.ebuild 1552 BLAKE2B 372dd51b11ce5450e6e627a2811496e89365e7e39e286e841d3a159f4b6a2834a237f3af369aa8cd11cc3fa52964b8dc88d0438a65d7678b8508a98edbedc188 SHA512 9703bb70485e38a54dc7c3fe08338e3faf45076f1a0d7344a4548e384ea317854ab39da0017a1171cfa6e78f2ca5f9840dae683f52580710f667255ffca9b528 +EBUILD pexpect-4.9.0.ebuild 1703 BLAKE2B 7a8618699cec6828ba20b8fa276917791f7ada8a2eb76593a69352c9dd7eecd7abaf7bc943fe0b16f4d1bd71dac83edde3ea7bee371b821913c74d7e3d51859f SHA512 e588108ada51a5dae4f919ec0afc2db3f98888cc5c08b627507e35cf6b1f3c30ac1753b910d3d6dce8effabff4c7191fbcfb3731453a14aa1d377eadd6b47dd8 MISC metadata.xml 403 BLAKE2B 0e07f64f32ee9f6776e53f5e59b91e0e22675ebb0e8c8b98eadfb9a46d29af3e7daaafbf4e60fd7fa20bf57d42619ebdf26994b087ed0773a943acd6fddc8ab4 SHA512 4c3e18b98b69213899a6af8366ade2ebfaa4eabef76f880cd71c300b03fc7725246200bc00491942b3f7b4b4f87bdfbc9181663fe5c8b7c5325f1e7c6e76356d diff --git a/dev-python/pexpect/files/pexpect-4.9.0-py314.patch b/dev-python/pexpect/files/pexpect-4.9.0-py314.patch new file mode 100644 index 000000000000..a7d1f8f83593 --- /dev/null +++ b/dev-python/pexpect/files/pexpect-4.9.0-py314.patch @@ -0,0 +1,107 @@ +https://github.com/pexpect/pexpect/commit/456bc10d94b57e254568e7ea9a8b3cffb856ebff + +From 456bc10d94b57e254568e7ea9a8b3cffb856ebff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz> +Date: Fri, 22 Nov 2024 16:41:55 +0100 +Subject: [PATCH] Tests: Avoid the multiprocessing forkserver method + +Fixes https://github.com/pexpect/pexpect/issues/807 +--- + tests/test_expect.py | 12 ++++++++++-- + tests/test_socket.py | 24 ++++++++++++++++-------- + 2 files changed, 26 insertions(+), 10 deletions(-) + +diff --git a/tests/test_expect.py b/tests/test_expect.py +index c16e0551..fb1e30e2 100755 +--- a/tests/test_expect.py ++++ b/tests/test_expect.py +@@ -33,6 +33,14 @@ + + PY3 = bool(sys.version_info.major >= 3) + ++# Python 3.14 changed the non-macOS POSIX default to forkserver ++# but the code in this module does not work with it ++# See https://github.com/python/cpython/issues/125714 ++if multiprocessing.get_start_method() == 'forkserver': ++ mp_context = multiprocessing.get_context(method='fork') ++else: ++ mp_context = multiprocessing.get_context() ++ + # Many of these test cases blindly assume that sequential directory + # listings of the /bin directory will yield the same results. + # This may not be true, but seems adequate for testing now. +@@ -682,7 +690,7 @@ def test_stdin_closed(self): + ''' + Ensure pexpect continues to operate even when stdin is closed + ''' +- class Closed_stdin_proc(multiprocessing.Process): ++ class Closed_stdin_proc(mp_context.Process): + def run(self): + sys.__stdin__.close() + cat = pexpect.spawn('cat') +@@ -698,7 +706,7 @@ def test_stdin_stdout_closed(self): + ''' + Ensure pexpect continues to operate even when stdin and stdout is closed + ''' +- class Closed_stdin_stdout_proc(multiprocessing.Process): ++ class Closed_stdin_stdout_proc(mp_context.Process): + def run(self): + sys.__stdin__.close() + sys.__stdout__.close() +diff --git a/tests/test_socket.py b/tests/test_socket.py +index b801b00a..6521d368 100644 +--- a/tests/test_socket.py ++++ b/tests/test_socket.py +@@ -29,6 +29,14 @@ + import time + import errno + ++# Python 3.14 changed the non-macOS POSIX default to forkserver ++# but the code in this module does not work with it ++# See https://github.com/python/cpython/issues/125714 ++if multiprocessing.get_start_method() == 'forkserver': ++ mp_context = multiprocessing.get_context(method='fork') ++else: ++ mp_context = multiprocessing.get_context() ++ + + class SocketServerError(Exception): + pass +@@ -83,8 +91,8 @@ def setUp(self): + self.prompt3 = b'Press X to exit:' + self.enter = b'\r\n' + self.exit = b'X\r\n' +- self.server_up = multiprocessing.Event() +- self.server_process = multiprocessing.Process(target=self.socket_server, args=(self.server_up,)) ++ self.server_up = mp_context.Event() ++ self.server_process = mp_context.Process(target=self.socket_server, args=(self.server_up,)) + self.server_process.daemon = True + self.server_process.start() + counter = 0 +@@ -189,9 +197,9 @@ def test_timeout(self): + session.expect(b'Bogus response') + + def test_interrupt(self): +- timed_out = multiprocessing.Event() +- all_read = multiprocessing.Event() +- test_proc = multiprocessing.Process(target=self.socket_fn, args=(timed_out, all_read)) ++ timed_out = mp_context.Event() ++ all_read = mp_context.Event() ++ test_proc = mp_context.Process(target=self.socket_fn, args=(timed_out, all_read)) + test_proc.daemon = True + test_proc.start() + while not all_read.is_set(): +@@ -203,9 +211,9 @@ def test_interrupt(self): + self.assertEqual(test_proc.exitcode, errno.ETIMEDOUT) + + def test_multiple_interrupts(self): +- timed_out = multiprocessing.Event() +- all_read = multiprocessing.Event() +- test_proc = multiprocessing.Process(target=self.socket_fn, args=(timed_out, all_read)) ++ timed_out = mp_context.Event() ++ all_read = mp_context.Event() ++ test_proc = mp_context.Process(target=self.socket_fn, args=(timed_out, all_read)) + test_proc.daemon = True + test_proc.start() + while not all_read.is_set(): + diff --git a/dev-python/pexpect/pexpect-4.9.0.ebuild b/dev-python/pexpect/pexpect-4.9.0.ebuild index 325f441e2429..4e64fc6c3c6f 100644 --- a/dev-python/pexpect/pexpect-4.9.0.ebuild +++ b/dev-python/pexpect/pexpect-4.9.0.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..13} python3_13t pypy3 pypy3_11 ) +PYTHON_COMPAT=( python3_{11..14} python3_{13,14}t pypy3_11 ) PYTHON_REQ_USE="threads(+)" inherit distutils-r1 pypi @@ -32,6 +32,8 @@ distutils_enable_sphinx doc \ PATCHES=( # https://github.com/pexpect/pexpect/pull/794 "${FILESDIR}/${P}-py313.patch" + # https://github.com/pexpect/pexpect/pull/808 + "${FILESDIR}/${P}-py314.patch" ) src_test() { @@ -50,6 +52,8 @@ python_test() { tests/test_replwrap.py::REPLWrapTestCase::test_zsh # flaky tests/test_env.py::TestCaseEnv::test_spawn_uses_env + # flaky & hangy + tests/test_socket.py::ExpectTestCase::test_interrupt ) local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 |