Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python3-ipython: update to 8.14.0.
@ 2023-06-04 21:07 tornaria
  2023-06-04 21:27 ` tornaria
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tornaria @ 2023-06-04 21:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages ipython
https://github.com/void-linux/void-packages/pull/44268

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

#### Testing the changes
- I tested the changes in this PR: **briefly**

I will run sagemath testsuite with this update and report back.

@ahesford here's one package where testing with `PYTHONPATH` breaks and testing in a venv works. I wrote a custom `do_check()` function but you'll see it's quite generic and could be moved to `build-style/python3-pep517.sh`.

Maybe you can figure out a different way to make the generic testing with `PYTHONPATH` to work.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ipython-44268.patch --]
[-- Type: text/x-diff, Size: 2516 bytes --]

From a36beda891dfeb232cc5ec73b7d902be01143afd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 3 Jun 2023 15:50:15 -0300
Subject: [PATCH] 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
---
 srcpkgs/python3-ipython/template | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

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 <ajh@sideband.org>"
 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*

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

* Re: python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
@ 2023-06-04 21:27 ` tornaria
  2023-06-04 21:34 ` [PR PATCH] [Updated] " tornaria
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-04 21:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#issuecomment-1575736315

Comment:
There was a test failure on x86_64-musl:
```
FAILED IPython/utils/tests/test_process.py::SubProcessTestCase::test_system_interrupt
```
But in my local test this passed.

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

* Re: [PR PATCH] [Updated] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
  2023-06-04 21:27 ` tornaria
@ 2023-06-04 21:34 ` tornaria
  2023-06-05  1:19 ` tornaria
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-04 21:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages ipython
https://github.com/void-linux/void-packages/pull/44268

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

#### Testing the changes
- I tested the changes in this PR: **briefly**

I will run sagemath testsuite with this update and report back.

@ahesford here's one package where testing with `PYTHONPATH` breaks and testing in a venv works. I wrote a custom `do_check()` function but you'll see it's quite generic and could be moved to `build-style/python3-pep517.sh`.

Maybe you can figure out a different way to make the generic testing with `PYTHONPATH` to work.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ipython-44268.patch --]
[-- Type: text/x-diff, Size: 2516 bytes --]

From 64c5622c8254a3b9316fc0c2916f67074dda41d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 3 Jun 2023 15:50:15 -0300
Subject: [PATCH] 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
---
 srcpkgs/python3-ipython/template | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

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 <ajh@sideband.org>"
 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*

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

* Re: [PR PATCH] [Updated] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
  2023-06-04 21:27 ` tornaria
  2023-06-04 21:34 ` [PR PATCH] [Updated] " tornaria
@ 2023-06-05  1:19 ` tornaria
  2023-06-05  1:42 ` tornaria
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-05  1:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages ipython
https://github.com/void-linux/void-packages/pull/44268

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

#### Testing the changes
- I tested the changes in this PR: **briefly**

I will run sagemath testsuite with this update and report back.

@ahesford here's one package where testing with `PYTHONPATH` breaks and testing in a venv works. I wrote a custom `do_check()` function but you'll see it's quite generic and could be moved to `build-style/python3-pep517.sh`.

Maybe you can figure out a different way to make the generic testing with `PYTHONPATH` to work.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ipython-44268.patch --]
[-- Type: text/x-diff, Size: 4228 bytes --]

From cbf8ba548f0e9e1e624f4d62b1b55ee37593ff32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 3 Jun 2023 15:50:15 -0300
Subject: [PATCH] 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 <ajh@sideband.org>"
 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*

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

* Re: python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (2 preceding siblings ...)
  2023-06-05  1:19 ` tornaria
@ 2023-06-05  1:42 ` tornaria
  2023-06-05  6:20 ` [PR REVIEW] " tornaria
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-05  1:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#issuecomment-1575916884

Comment:
I rerun CI without changes and got the same failure. Locally I can reproduce if I change the sleep time from 0.5 to 0.0.

I added a reasonably looking patch that I submitted upstream at https://github.com/ipython/ipython/issues/12164. Now all tests pass (even with sleep time 0.0).

I also run the sage testsuite with this update without any issue so this is ready to merge.

I would appreciate any comments on what to do about `do_check()`.

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (3 preceding siblings ...)
  2023-06-05  1:42 ` tornaria
@ 2023-06-05  6:20 ` tornaria
  2023-06-05 15:05 ` ahesford
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-05  6:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1217564972

Comment:
Can this `conflict=` line be removed?

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (4 preceding siblings ...)
  2023-06-05  6:20 ` [PR REVIEW] " tornaria
@ 2023-06-05 15:05 ` ahesford
  2023-06-05 15:05 ` ahesford
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2023-06-05 15:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1218086861

Comment:
No. People might still have an old copy of `python-ipython` installed. Because that package used an alternative to set a symlink that conflicts with the copy of `ipython` installed by this package, XBPS fails to detect the conflict at install time and instead just messes with configured alternatives.

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (5 preceding siblings ...)
  2023-06-05 15:05 ` ahesford
@ 2023-06-05 15:05 ` ahesford
  2023-06-05 15:05 ` ahesford
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2023-06-05 15:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1218069109

Comment:
Don't drop `python3-setuptools` from `hostmakedepends` here; it is strictly required to build the package and the fact that `python3-wheel` pulls it in is incidental.

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (6 preceding siblings ...)
  2023-06-05 15:05 ` ahesford
@ 2023-06-05 15:05 ` ahesford
  2023-06-05 17:03 ` tornaria
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2023-06-05 15:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1218208379

Comment:
The problem isn't that this works in a `venv`, it's how you're calling `pytest`. The default `do_build` runs `pytest3` but you are running `python3 -m pytest`, which means you add `.` to the Python path by default. If you were to run
```sh
ln -Tsf /usr/bin/pytest3 "${testdir}/bin/pytest3"
"${testdir}/bin/pytest3"
```
instead of `python3 -m pytest`, the tests would again fail with an inability to find `IPython`.

This suggests that `pytest` is not actually testing against the contents of the wheel, but is instead testing the contents of the source tree. (Although, in the single test `test_ipython_embed`, it expects to find an `ipython` entrypoint and fails.) In fact, it is sufficient to do
```sh
do_check() {
    python3 -m pytest -k 'not(test_ipython_embed)'
}
```
for a successful test run.

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (7 preceding siblings ...)
  2023-06-05 15:05 ` ahesford
@ 2023-06-05 17:03 ` tornaria
  2023-06-05 17:05 ` [PR PATCH] [Updated] " tornaria
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-05 17:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1218351910

Comment:
> The problem isn't that this works in a `venv`, it's how you're calling `pytest`. The default `do_build` runs `pytest3` but you are running `python3 -m pytest`, which means you add `.` to the Python path by default.

I see, it's really misleading that the python path changes  depending on this.

> If you were to run
> 
> ```shell
> ln -Tsf /usr/bin/pytest3 "${testdir}/bin/pytest3"
> "${testdir}/bin/pytest3"
> ```
> 
> instead of `python3 -m pytest`, the tests would again fail with an inability to find `IPython`.

I don' t think that will run pytest in the venv, since the shebang for `/usr/bin/pytest3` is `/usr/bin/python3`. It does what you claim if I do something like
```
"${testdir}/bin/python3" /usr/bin/pytest3
```
so TIL that `python3 -m pytest` is not the same as `python3 /usr/bin/pytest`.



> This suggests that `pytest` is not actually testing against the contents of the wheel, but is instead testing the contents of the source tree.

Sure and since all the test files are actually installed in the wheel, we get a conflict between the files pytest is trying to load (from `.`) and the modules that are installed in `$testdir`.

So an easy way to make `.` into the python path would be
```
make_check_pre='env PYTHONPATH=.'
```

With this in place and the standard `do_check()`, all tests pass (even `test_ipython_embed`). What do you think?

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

* Re: [PR PATCH] [Updated] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (8 preceding siblings ...)
  2023-06-05 17:03 ` tornaria
@ 2023-06-05 17:05 ` tornaria
  2023-06-05 17:07 ` [PR REVIEW] " ahesford
  2023-06-05 17:35 ` [PR PATCH] [Closed]: " ahesford
  11 siblings, 0 replies; 13+ messages in thread
From: tornaria @ 2023-06-05 17:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages ipython
https://github.com/void-linux/void-packages/pull/44268

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

#### Testing the changes
- I tested the changes in this PR: **briefly**

I will run sagemath testsuite with this update and report back.

@ahesford here's one package where testing with `PYTHONPATH` breaks and testing in a venv works. I wrote a custom `do_check()` function but you'll see it's quite generic and could be moved to `build-style/python3-pep517.sh`.

Maybe you can figure out a different way to make the generic testing with `PYTHONPATH` to work.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44268.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ipython-44268.patch --]
[-- Type: text/x-diff, Size: 5760 bytes --]

From cbf8ba548f0e9e1e624f4d62b1b55ee37593ff32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
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 <ajh@sideband.org>"
 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?= <tornaria@cmat.edu.uy>
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

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

* Re: [PR REVIEW] python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (9 preceding siblings ...)
  2023-06-05 17:05 ` [PR PATCH] [Updated] " tornaria
@ 2023-06-05 17:07 ` ahesford
  2023-06-05 17:35 ` [PR PATCH] [Closed]: " ahesford
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2023-06-05 17:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44268#discussion_r1218355714

Comment:
I think that's the best option, because it requires a single line without overriding the default functions.

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

* Re: [PR PATCH] [Closed]: python3-ipython: update to 8.14.0.
  2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
                   ` (10 preceding siblings ...)
  2023-06-05 17:07 ` [PR REVIEW] " ahesford
@ 2023-06-05 17:35 ` ahesford
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2023-06-05 17:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

There's a closed pull request on the void-packages repository

python3-ipython: update to 8.14.0.
https://github.com/void-linux/void-packages/pull/44268

Description:
 - switch to pep517 build style: needs using a venv
 - update depends and checkdepends
 - break unnecessary checkdepends cycle with ipython_ipykernel

#### Testing the changes
- I tested the changes in this PR: **briefly**

I will run sagemath testsuite with this update and report back.

@ahesford here's one package where testing with `PYTHONPATH` breaks and testing in a venv works. I wrote a custom `do_check()` function but you'll see it's quite generic and could be moved to `build-style/python3-pep517.sh`.

Maybe you can figure out a different way to make the generic testing with `PYTHONPATH` to work.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

end of thread, other threads:[~2023-06-05 17:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-04 21:07 [PR PATCH] python3-ipython: update to 8.14.0 tornaria
2023-06-04 21:27 ` tornaria
2023-06-04 21:34 ` [PR PATCH] [Updated] " tornaria
2023-06-05  1:19 ` tornaria
2023-06-05  1:42 ` tornaria
2023-06-05  6:20 ` [PR REVIEW] " tornaria
2023-06-05 15:05 ` ahesford
2023-06-05 15:05 ` ahesford
2023-06-05 15:05 ` ahesford
2023-06-05 17:03 ` tornaria
2023-06-05 17:05 ` [PR PATCH] [Updated] " tornaria
2023-06-05 17:07 ` [PR REVIEW] " ahesford
2023-06-05 17:35 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).