Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] build-style/python3-module: prefer pytest in do_check
@ 2020-12-03  3:46 ahesford
  2020-12-03  4:09 ` ericonr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ahesford @ 2020-12-03  3:46 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ahesford/void-packages pytest
https://github.com/void-linux/void-packages/pull/26901

build-style/python3-module: prefer pytest in do_check
Closes #25052.

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

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

From ef48e45d79acbeb751e4c8ed4cbcbf5f5ebb9e56 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 2 Dec 2020 22:22:31 -0500
Subject: [PATCH 1/4] build-style/python3-module: prefer pytest in do_check

Closes: #25052.
---
 common/build-style/python3-module.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index db56feb5e0e..ad5fdff252b 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -24,15 +24,20 @@ do_build() {
 }
 
 do_check() {
-	if [ -z "$make_check_target" ]; then
-		if ! python3 setup.py --help test >/dev/null 2>&1; then
-			msg_warn "No command 'test' defined by setup.py.\n"
-			return 0
+	if python3 -m pytest --help >/dev/null 2>&1; then
+		python3 -m pytest ${make_check_args} ${make_check_target}
+	else
+		# Fall back to deprecated setup.py test orchestration without pytest
+		if [ -z "$make_check_target" ]; then
+			if ! python3 setup.py --help test >/dev/null 2>&1; then
+				msg_warn "No command 'test' defined by setup.py.\n"
+				return 0
+			fi
 		fi
-	fi
 
-	: ${make_check_target:=test}
-	python3 setup.py ${make_check_target} ${make_check_args}
+		: ${make_check_target:=test}
+		python3 setup.py ${make_check_target} ${make_check_args}
+	fi
 }
 
 do_install() {

From 50755980e6cc82c2c267a48e1e47abc7b73d88ec Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 2 Dec 2020 14:00:31 -0500
Subject: [PATCH 2/4] python3-tifffile: employ improved, automatic do_check

---
 srcpkgs/python3-tifffile/template | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/srcpkgs/python3-tifffile/template b/srcpkgs/python3-tifffile/template
index c5bf27a1424..1d6dcb2a522 100644
--- a/srcpkgs/python3-tifffile/template
+++ b/srcpkgs/python3-tifffile/template
@@ -15,10 +15,6 @@ changelog="https://raw.githubusercontent.com/cgohlke/tifffile/master/CHANGES.rst
 distfiles="${homepage}/archive/v${version}.tar.gz"
 checksum=64fc7602330301e910cc343e99bac02f9b453e933c1ee2050f316cbfee725df3
 
-do_check() {
-	python3 -m pytest
-}
-
 post_install() {
 	vlicense LICENSE
 }

From 1d74aed369f2c2c49a16d31d35db7ae79e146ad8 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 2 Dec 2020 22:34:34 -0500
Subject: [PATCH 3/4] virt-manager: employ improved, automatic do_check

---
 srcpkgs/virt-manager/template | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/srcpkgs/virt-manager/template b/srcpkgs/virt-manager/template
index e32b5bfec00..768530547dd 100644
--- a/srcpkgs/virt-manager/template
+++ b/srcpkgs/virt-manager/template
@@ -19,10 +19,6 @@ distfiles="https://virt-manager.org/download/sources/${pkgname}/${pkgname}-${ver
 checksum=2b6fe3d90d89e1130227e4b05c51e6642d89c839d3ea063e0e29475fd9bf7b86
 python_version=3
 
-do_check() {
-	python3 -m pytest
-}
-
 post_install() {
 	rm $DESTDIR/usr/share/glib-2.0/schemas/gschemas.compiled \
 		$DESTDIR/usr/share/icons/hicolor/icon-theme.cache

From 3e6966cc6fa8684415b8f985d95dff6d9793e285 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 2 Dec 2020 22:35:54 -0500
Subject: [PATCH 4/4] python3-lz4: employ improved, automatic do_check

---
 srcpkgs/python3-lz4/template | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/srcpkgs/python3-lz4/template b/srcpkgs/python3-lz4/template
index 02ed0982e18..9ef8d0abae5 100644
--- a/srcpkgs/python3-lz4/template
+++ b/srcpkgs/python3-lz4/template
@@ -16,10 +16,6 @@ changelog="https://github.com/python-lz4/python-lz4/releases"
 distfiles="${PYPI_SITE}/l/lz4/lz4-${version}.tar.gz"
 checksum=1ac354804cb2d5fb3d213857a6bf8590a301ef051cc16fbb4938bd2d6e524bda
 
-do_check() {
-	python3 -m pytest
-}
-
 post_install() {
 	vlicense LICENSE
 }

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

* Re: build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
@ 2020-12-03  4:09 ` ericonr
  2020-12-04  3:23 ` fosslinux
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-03  4:09 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#issuecomment-737652920

Comment:
IIRC there are a couple templates that call `pytest` as an executable directly, if you want to include those.

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

* Re: build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
  2020-12-03  4:09 ` ericonr
@ 2020-12-04  3:23 ` fosslinux
  2020-12-04  3:24 ` fosslinux
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fosslinux @ 2020-12-04  3:23 UTC (permalink / raw)
  To: ml

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

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#issuecomment-738540650

Comment:
How about tox as well? We could go `pytest` -> `tox` -> `setuptools`

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

* Re: build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
  2020-12-03  4:09 ` ericonr
  2020-12-04  3:23 ` fosslinux
@ 2020-12-04  3:24 ` fosslinux
  2020-12-04 21:12 ` [PR REVIEW] " ericonr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fosslinux @ 2020-12-04  3:24 UTC (permalink / raw)
  To: ml

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

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#issuecomment-738540650

Comment:
How about tox as well? We could go `pytest` -> `tox` -> `setuptools`

Never mind, I forgot #25052

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

* Re: [PR REVIEW] build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
                   ` (2 preceding siblings ...)
  2020-12-04  3:24 ` fosslinux
@ 2020-12-04 21:12 ` ericonr
  2020-12-05  5:32 ` sgn
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-04 21:12 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#discussion_r536382313

Comment:
I'm not against leaving a historical comment like "we don't try to use tox because ...."

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

* Re: [PR REVIEW] build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
                   ` (3 preceding siblings ...)
  2020-12-04 21:12 ` [PR REVIEW] " ericonr
@ 2020-12-05  5:32 ` sgn
  2020-12-08 15:19 ` ahesford
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-12-05  5:32 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#discussion_r536518908

Comment:
Not sure if this is better:
```sh
PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest ${make_check_args} ${make_check_target}
```

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

* Re: [PR REVIEW] build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
                   ` (4 preceding siblings ...)
  2020-12-05  5:32 ` sgn
@ 2020-12-08 15:19 ` ahesford
  2020-12-09 20:55 ` ahesford
  2020-12-09 20:55 ` [PR PATCH] [Closed]: " ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2020-12-08 15:19 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#discussion_r538488456

Comment:
Setting `PYTHONPATH` this way might improve support for testing compiled extensions, but I'm not sure it should be the default. If tests break because they can't be run with the default path (plus `.`, which is automatically added in the `python3 -m pytest` form of invocation), maybe that should be a manual override situation.

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

* Re: build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
                   ` (5 preceding siblings ...)
  2020-12-08 15:19 ` ahesford
@ 2020-12-09 20:55 ` ahesford
  2020-12-09 20:55 ` [PR PATCH] [Closed]: " ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2020-12-09 20:55 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26901#issuecomment-742043771

Comment:
Closed in a3227ffb485c7c4c0993fd8929c0d48359482a81

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

* Re: [PR PATCH] [Closed]: build-style/python3-module: prefer pytest in do_check
  2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
                   ` (6 preceding siblings ...)
  2020-12-09 20:55 ` ahesford
@ 2020-12-09 20:55 ` ahesford
  7 siblings, 0 replies; 9+ messages in thread
From: ahesford @ 2020-12-09 20:55 UTC (permalink / raw)
  To: ml

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

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

build-style/python3-module: prefer pytest in do_check
https://github.com/void-linux/void-packages/pull/26901

Description:
Closes #25052.

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

end of thread, other threads:[~2020-12-09 20:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  3:46 [PR PATCH] build-style/python3-module: prefer pytest in do_check ahesford
2020-12-03  4:09 ` ericonr
2020-12-04  3:23 ` fosslinux
2020-12-04  3:24 ` fosslinux
2020-12-04 21:12 ` [PR REVIEW] " ericonr
2020-12-05  5:32 ` sgn
2020-12-08 15:19 ` ahesford
2020-12-09 20:55 ` ahesford
2020-12-09 20:55 ` [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).