From cbf8ba548f0e9e1e624f4d62b1b55ee37593ff32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 3 Jun 2023 15:50:15 -0300 Subject: [PATCH 1/2] python3-ipython: update to 8.14.0. - switch to pep517 build style: needs using a venv - update depends and checkdepends - break unnecessary checkdepends cycle with ipython_ipykernel - fix a race (https://github.com/ipython/ipython/issues/12164) --- .../python3-ipython/patches/fix-race.patch | 28 +++++++++++++++++++ srcpkgs/python3-ipython/template | 27 ++++++++++++------ 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 srcpkgs/python3-ipython/patches/fix-race.patch diff --git a/srcpkgs/python3-ipython/patches/fix-race.patch b/srcpkgs/python3-ipython/patches/fix-race.patch new file mode 100644 index 000000000000..a6fdf5726815 --- /dev/null +++ b/srcpkgs/python3-ipython/patches/fix-race.patch @@ -0,0 +1,28 @@ +See: https://github.com/ipython/ipython/issues/12164 + +diff --git a/IPython/utils/_process_posix.py b/IPython/utils/_process_posix.py +index 59b5c2389..e83da39c6 100644 +--- a/IPython/utils/_process_posix.py ++++ b/IPython/utils/_process_posix.py +@@ -136,6 +136,7 @@ def system(self, cmd): + # record how far we've printed, so that next time we only print *new* + # content from the buffer. + out_size = 0 ++ child = None + try: + # Since we're not really searching the buffer for text patterns, we + # can set pexpect's search window to be tiny and it won't matter. +@@ -158,6 +159,13 @@ def system(self, cmd): + # Update the pointer to what we've already printed + out_size = len(child.before) + except KeyboardInterrupt: ++ ++ if child is None: ++ # the interrupt was received before pexpect.spawn() ++ # was done... recover as best as possible. ++ import signal ++ return -signal.SIGINT ++ + # We need to send ^C to the process. The ascii code for '^C' is 3 + # (the character is known as ETX for 'End of Text', see + # curses.ascii.ETX). diff --git a/srcpkgs/python3-ipython/template b/srcpkgs/python3-ipython/template index 14b1cc291123..65a74e218d40 100644 --- a/srcpkgs/python3-ipython/template +++ b/srcpkgs/python3-ipython/template @@ -1,24 +1,35 @@ # Template file for 'python3-ipython' pkgname=python3-ipython -version=8.13.2 +version=8.14.0 revision=1 -build_style=python3-module -hostmakedepends="python3-setuptools" -depends="python3-setuptools python3-jedi python3-decorator python3-pickleshare +build_style=python3-pep517 +hostmakedepends="python3-wheel" +depends="python3-jedi python3-decorator python3-pickleshare python3-traitlets python3-prompt_toolkit python3-Pygments python3-backcall python3-matplotlib-inline python3-pexpect python3-stack_data" -checkdepends="python3-pytest $depends python3-matplotlib python3-Pillow - python3-requests python3-testpath python3-numpy python3-ipython_ipykernel - python3-jupyter_nbformat python3-Pygments" +checkdepends="$depends python3-pytest-asyncio python3-testpath + python3-curio python3-jupyter_nbformat python3-matplotlib + python3-numpy python3-pandas python3-trio" short_desc="Enhanced interactive Python3 shell" maintainer="Andrew J. Hesford " license="BSD-3-Clause" homepage="https://ipython.org/" changelog="https://github.com/ipython/ipython/raw/main/docs/source/whatsnew/version8.rst" distfiles="${PYPI_SITE}/i/ipython/ipython-${version}.tar.gz" -checksum=7dff3fad32b97f6488e02f87b970f309d082f758d7b7fc252e3b19ee0e432dbb +checksum=1d197b907b6ba441b692c48cf2a3a2de280dc0ac91a3405b39349a50272ca0a1 conflicts="python-ipython<=5.8.0_2" +do_check() { + # Running via PYTHONPATH breaks... venv works + # This could be moved to build-style/python3-pep517.sh + local testdir="${wrksrc}/.xbps-testdir" + rm -rf "${testdir}" + python3 -m venv --system-site-packages --without-pip "${testdir}" + local -x PATH="${testdir}/bin:${PATH}" + python3 -m installer dist/*.whl + python3 -m pytest +} + post_install() { # remove iptest rm -f ${DESTDIR}/usr/bin/iptest* From 243931b4f6131d5e2ddddf4924613f9bd7407282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 5 Jun 2023 14:04:54 -0300 Subject: [PATCH 2/2] changes requested (draft) --- srcpkgs/python3-ipython/template | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/srcpkgs/python3-ipython/template b/srcpkgs/python3-ipython/template index 65a74e218d40..baf40a68e578 100644 --- a/srcpkgs/python3-ipython/template +++ b/srcpkgs/python3-ipython/template @@ -3,7 +3,7 @@ pkgname=python3-ipython version=8.14.0 revision=1 build_style=python3-pep517 -hostmakedepends="python3-wheel" +hostmakedepends="python3-setuptools python3-wheel" depends="python3-jedi python3-decorator python3-pickleshare python3-traitlets python3-prompt_toolkit python3-Pygments python3-backcall python3-matplotlib-inline python3-pexpect python3-stack_data" @@ -19,16 +19,7 @@ distfiles="${PYPI_SITE}/i/ipython/ipython-${version}.tar.gz" checksum=1d197b907b6ba441b692c48cf2a3a2de280dc0ac91a3405b39349a50272ca0a1 conflicts="python-ipython<=5.8.0_2" -do_check() { - # Running via PYTHONPATH breaks... venv works - # This could be moved to build-style/python3-pep517.sh - local testdir="${wrksrc}/.xbps-testdir" - rm -rf "${testdir}" - python3 -m venv --system-site-packages --without-pip "${testdir}" - local -x PATH="${testdir}/bin:${PATH}" - python3 -m installer dist/*.whl - python3 -m pytest -} +make_check_pre='env PYTHONPATH=.' post_install() { # remove iptest