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: Thu, 11 Jan 2024 20:28:16 +0100	[thread overview]
Message-ID: <20240111192816.wftaaljTjhLmF0q7_574VaZPU2jAIWDYFJI2Wz-3ffE@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: 3031 bytes --]

From 5d5d9b4dcdab4adc68e5335455de34239c856748 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 21:59:23 +0530
Subject: [PATCH 1/3] 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 43503603b822b8c83be4792a359f7ee3ae3e9dd8 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 22:00:55 +0530
Subject: [PATCH 2/3] 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 9f6f425d4a4ec9999295839f4220b3d399add334 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Sat, 8 Jul 2023 22:21:43 +0530
Subject: [PATCH 3/3] 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:[~2024-01-11 19:28 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 ` [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 ` icp1994 [this message]
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=20240111192816.wftaaljTjhLmF0q7_574VaZPU2jAIWDYFJI2Wz-3ffE@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).