Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/build-style/python3-{module,pep517}.sh: enable `PY_IGNORE_IMPORTMISMATCH` for testing
@ 2023-07-09 10:12 icp1994
  2023-10-09  1:45 ` github-actions
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: icp1994 @ 2023-07-09 10:12 UTC (permalink / raw)
  To: ml

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

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

https://github.com/icp1994/void-packages build-style/python3
https://github.com/void-linux/void-packages/pull/44941

common/build-style/python3-{module,pep517}.sh: enable `PY_IGNORE_IMPORTMISMATCH` for testing
Python packages which enables pytest's `--doctest-modules` flag fails while testing against an installed package - ref. https://github.com/pytest-dev/pytest/issues/2042#issuecomment-381309723. Currently it's worked around in `python3-keyring` & `python3-fpylll` but is needed for `python3-path`, `python3-inflect`, `python3-zipp` etc - basically anything that follows https://github.com/jaraco/skeleton and there's quite a few of those in our repos.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-build-style/python3-44941.patch --]
[-- Type: text/x-diff, Size: 3545 bytes --]

From 2113dd21ef66827c4dfbb0c1ab47028d2cc38b12 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 21:59:23 +0530
Subject: [PATCH 1/4] common/build-style/python3-module.sh: enable
 `PY_IGNORE_IMPORTMISMATCH` for testing

Fixes `ImportMismatchError` for doctest-modules in pytest
Ref: https://github.com/pytest-dev/pytest/issues/2042#issuecomment-381309723
---
 common/build-style/python3-module.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index b76d89c8b502..09d0b8b6ee18 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -8,6 +8,7 @@ do_build() {
 
 do_check() {
 	local testjobs
+	export PY_IGNORE_IMPORTMISMATCH=1
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
 		if python3 -c 'import xdist' >/dev/null 2>&1; then
 			testjobs="-n $XBPS_MAKEJOBS"

From 636872e6b14e9a0989fc1b897963c34c5e73f4ab Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 22:00:55 +0530
Subject: [PATCH 2/4] common/build-style/python3-pep517.sh: enable
 `PY_IGNORE_IMPORTMISMATCH` for testing

Fixes `ImportMismatchError` for doctest-modules in pytest
Ref: https://github.com/pytest-dev/pytest/issues/2042#issuecomment-381309723
---
 common/build-style/python3-pep517.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34e..98ab30ca9625 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -23,6 +23,7 @@ do_check() {
 	python3 -m installer --destdir "${testdir}" \
 		${make_install_args} ${make_install_target:-dist/*.whl}
 
+	export PY_IGNORE_IMPORTMISMATCH=1
 	PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
 		${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
 }

From 5bb33eb72530ac49e007f271b4cd070c1d873368 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 22:17:09 +0530
Subject: [PATCH 3/4] python3-fpylll: remove redundant
 `PY_IGNORE_IMPORTMISMATCH` export

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

diff --git a/srcpkgs/python3-fpylll/template b/srcpkgs/python3-fpylll/template
index e4fd9584c795..78c8daf1058c 100644
--- a/srcpkgs/python3-fpylll/template
+++ b/srcpkgs/python3-fpylll/template
@@ -20,7 +20,3 @@ case $XBPS_TARGET_MACHINE in
 	# skip a test with numerical noise on 32 bit
 	i686*) make_check_args="-k not(averaged_simulate_prob)" ;;
 esac
-
-pre_check() {
-	export PY_IGNORE_IMPORTMISMATCH=1
-}

From c171ce7068044827803ec59902e99fb06b547d87 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 22:21:43 +0530
Subject: [PATCH 4/4] python3-keyring: remove redundant
 `PY_IGNORE_IMPORTMISMATCH` export

---
 srcpkgs/python3-keyring/template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/srcpkgs/python3-keyring/template b/srcpkgs/python3-keyring/template
index 6280ed9d4a2e..caef618f46e3 100644
--- a/srcpkgs/python3-keyring/template
+++ b/srcpkgs/python3-keyring/template
@@ -14,7 +14,6 @@ homepage="https://pypi.org/project/keyring/"
 changelog="https://raw.githubusercontent.com/jaraco/keyring/main/NEWS.rst"
 distfiles="${PYPI_SITE}/k/keyring/keyring-${version}.tar.gz"
 checksum=ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509
-make_check_pre="env PY_IGNORE_IMPORTMISMATCH=1"
 
 pre_check() {
 	vsed -e '/addopts/d' -i pytest.ini

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

end of thread, other threads:[~2024-01-21 21:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 10:12 [PR PATCH] common/build-style/python3-{module,pep517}.sh: enable `PY_IGNORE_IMPORTMISMATCH` for testing icp1994
2023-10-09  1:45 ` github-actions
2023-10-10  5:32 ` [PR PATCH] [Updated] " icp1994
2023-10-10  5:44 ` icp1994
2023-10-10 16:38 ` tornaria
2023-10-10 16:41 ` classabbyamp
2023-10-10 16:51 ` tornaria
2023-10-10 17:15 ` icp1994
2023-10-10 17:17 ` classabbyamp
2024-01-09  1:47 ` github-actions
2024-01-11 19:28 ` [PR PATCH] [Updated] " icp1994
2024-01-21 21:04 ` [PR PATCH] [Merged]: " classabbyamp

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