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

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).