public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pexpect/files/, dev-python/pexpect/
@ 2021-10-02 14:19 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2021-10-02 14:19 UTC (permalink / raw
  To: gentoo-commits

commit:     6665137997d6d28883a233ea9a13f7d56e5c7b12
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  2 14:17:06 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  2 14:19:06 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66651379

dev-python/pexpect: fix PS1, cleanup ebuild

Closes: https://bugs.gentoo.org/629754
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../pexpect/files/pexpect-4.8.0-fix-PS1.patch       | 16 ++++++++++++++++
 ...pect-4.8.0-r1.ebuild => pexpect-4.8.0-r2.ebuild} | 21 ++++-----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/dev-python/pexpect/files/pexpect-4.8.0-fix-PS1.patch b/dev-python/pexpect/files/pexpect-4.8.0-fix-PS1.patch
new file mode 100644
index 00000000000..903b742f71d
--- /dev/null
+++ b/dev-python/pexpect/files/pexpect-4.8.0-fix-PS1.patch
@@ -0,0 +1,16 @@
+From: whitley-delamora <62795654+whitley-delamora@users.noreply.github.com>
+Date: Sat, 28 Mar 2020 13:46:47 +0100
+Subject: [PATCH] REPLWrapTestCase.test_bash_env(): export variable PS1
+
+https://github.com/pexpect/pexpect/commit/51c0b09f92f140eda10b62d234710f65ad56dee2
+
+--- a/tests/test_replwrap.py
++++ b/tests/test_replwrap.py
+@@ -45,6 +45,7 @@ def test_bash_env(self):
+         """env, which displays PS1=..., should not mess up finding the prompt.
+         """
+         bash = replwrap.bash()
++        res = bash.run_command("export PS1")
+         res = bash.run_command("env")
+         self.assertIn('PS1', res)
+         res = bash.run_command("echo $HOME")

diff --git a/dev-python/pexpect/pexpect-4.8.0-r1.ebuild b/dev-python/pexpect/pexpect-4.8.0-r2.ebuild
similarity index 73%
rename from dev-python/pexpect/pexpect-4.8.0-r1.ebuild
rename to dev-python/pexpect/pexpect-4.8.0-r2.ebuild
index 7baa9ab2af8..9e985d413ab 100644
--- a/dev-python/pexpect/pexpect-4.8.0-r1.ebuild
+++ b/dev-python/pexpect/pexpect-4.8.0-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python3_{7..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
 PYTHON_REQ_USE="threads(+)"
 DISTUTILS_USE_SETUPTOOLS=no
 
@@ -16,21 +16,17 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
-IUSE="doc examples"
+IUSE="examples"
 
 RDEPEND=">=dev-python/ptyprocess-0.5[${PYTHON_USEDEP}]"
-DEPEND="
-	doc? ( dev-python/sphinx )"
 
 PATCHES=(
 	"${FILESDIR}"/${P}-sphinx-3.patch
+	"${FILESDIR}"/${P}-fix-PS1.patch
 )
 
 distutils_enable_tests pytest
-
-python_compile_all() {
-	use doc && emake -C doc html
-}
+distutils_enable_sphinx doc
 
 src_test() {
 	# workaround new readline defaults
@@ -39,16 +35,7 @@ src_test() {
 	distutils-r1_src_test
 }
 
-python_install() {
-	distutils-r1_python_install
-	if ! python_is_python3; then
-		# https://bugs.gentoo.org/703100
-		rm "${D}$(python_get_sitedir)/pexpect/_async.py" || die
-	fi
-}
-
 python_install_all() {
-	use doc && local HTML_DOCS=( doc/_build/html/. )
 	if use examples; then
 		dodoc -r examples
 		docompress -x /usr/share/doc/${PF}/examples


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pexpect/files/, dev-python/pexpect/
@ 2025-05-10 20:04 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-05-10 20:04 UTC (permalink / raw
  To: gentoo-commits

commit:     70c13d4b58cd883d2a1029d560b642c0416a66aa
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May 10 19:23:06 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May 10 19:23:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70c13d4b

dev-python/pexpect: enable py3.14

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/pexpect/files/pexpect-4.9.0-py314.patch | 107 +++++++++++++++++++++
 dev-python/pexpect/pexpect-4.9.0.ebuild            |   4 +-
 2 files changed, 110 insertions(+), 1 deletion(-)

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..fe72a02d12cd 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_{10..14} python3_13t pypy3 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() {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-10 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-10 20:04 [gentoo-commits] repo/gentoo:master commit in: dev-python/pexpect/files/, dev-python/pexpect/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2021-10-02 14:19 Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox