Github messages for voidlinux
 help / color / mirror / Atom feed
From: icp1994 <icp1994@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] common/build-style/python3-{module,pep517}.sh: enable `PY_IGNORE_IMPORTMISMATCH` for testing
Date: Tue, 10 Oct 2023 07:32:44 +0200	[thread overview]
Message-ID: <20231010053244.eoUfKYU6q1zSxpBQ0IA9Tl3R_0PSqrH-78ZnpIdD-HQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44941@inbox.vuxu.org>

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

There is an updated 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: 3756 bytes --]

From 53edfae84f9b09fce05a301e0c9a572edeb51b91 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index b76d89c8b502a..8aec7a0e45902 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -12,7 +12,7 @@ do_check() {
 		if python3 -c 'import xdist' >/dev/null 2>&1; then
 			testjobs="-n $XBPS_MAKEJOBS"
 		fi
-		PYTHONPATH="$(cd build/lib* && pwd)" \
+		PYTHONPATH="$(cd build/lib* && pwd)" PY_IGNORE_IMPORTMISMATCH=1 \
 			${make_check_pre} \
 			python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
 	else

From 2cd71af0fa04e7a7823c1fc0e6bb9192d739e3d6 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

From 25762ae6e2c7311f89d3d6a95fa6b3846606276c 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 adff12e05ae3a..39f6f7e1d282f 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 81071232bcded8617010427c37a8bf8f4902d296 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 e04682c8ec5d4..20bf6b03811c8 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

  parent reply	other threads:[~2023-10-10  5:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-09 10:12 [PR PATCH] " icp1994
2023-10-09  1:45 ` github-actions
2023-10-10  5:32 ` icp1994 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231010053244.eoUfKYU6q1zSxpBQ0IA9Tl3R_0PSqrH-78ZnpIdD-HQ@z \
    --to=icp1994@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).