From 2113dd21ef66827c4dfbb0c1ab47028d2cc38b12 Mon Sep 17 00:00:00 2001 From: icp 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 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 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 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