GNU bug report logs - #30556
Python tests should run with multiple python versions

Previous Next

Package: automake;

Reported by: Mathieu Lirzin <mthl <at> gnu.org>

Date: Tue, 20 Feb 2018 20:40:02 UTC

Severity: wishlist

Tags: confirmed

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mathieu Lirzin <mthl <at> gnu.org>
Subject: bug#30556: closed (Re: bug#30556: [PATCH] Python tests should run
 with multiple python versions)
Date: Fri, 07 Jul 2023 01:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#30556: Python tests should run with multiple python versions

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 30556 <at> debbugs.gnu.org.

-- 
30556: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30556
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Karl Berry <karl <at> freefriends.org>
To: bogdro_rep <at> gmx.us, mthl <at> gnu.org
Cc: 30556 <at> debbugs.gnu.org
Subject: Re: bug#30556: [PATCH] Python tests should run with multiple python
 versions
Date: Thu, 6 Jul 2023 19:28:16 -0600
Mathieu and all - back on this report from 2018:
https://bugs.gnu.org/30556.

Mike (Frysinger) and Bogdan both made various patches that together
have, I think, fixed all these issues. Thanks x 2 :).

Here is the patch from Bogdan that I've just pushed to finish it.
Closing, with fingers crossed. --karl

2023-07-06  Bogdan  <bogdro_rep <at> gmx.us>

python: generalize tests.

This change finishes fixing https://bugs.gnu.org/30556.

* t/python-prefix.sh: use $PYTHON if set, not hardwiring "python".
* t/python-virtualenv.sh (get-pyexecdir): new make target;
use it instead of hardwiring $py_site.
diff --git a/t/python-prefix.sh b/t/python-prefix.sh
index df15e4300..766f47258 100644
--- a/t/python-prefix.sh
+++ b/t/python-prefix.sh
@@ -43,7 +43,12 @@ echo-python-exec-prefix:
 	@echo $(PYTHON_EXEC_PREFIX)
 END

-py_version=$(python -c 'import sys; print("%u.%u" % sys.version_info[:2])')
+if test -z "$PYTHON"; then
+  py_exec=python
+else
+  py_exec=$PYTHON
+fi
+py_version=$("$py_exec" -c 'import sys; print("%u.%u" % sys.version_info[:2])')
 py_inst_site=inst/lib/python$py_version/site-packages
 py_instexec_site=instexec/lib/python$py_version/site-packages

diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh
index ae5d96ad6..b06964b90 100644
--- a/t/python-virtualenv.sh
+++ b/t/python-virtualenv.sh
@@ -100,6 +100,8 @@ test-run:
 	python -c 'from am_foo import foo_func; assert (foo_func () == 12345)'
 	python -c 'from am_virtenv import old_am; assert (old_am () == "AutoMake")'
 all-local: debug
+get-pyexecdir:
+	@echo $(pyexecdir)
x END

 cat > am_foo.py << 'END'
@@ -127,8 +129,8 @@ check_install ()
   py_installed "$py_site"/am_foo.pyc
   py_installed "$py_site"/am_virtenv/__init__.py
   py_installed "$py_site"/am_virtenv/__init__.pyc
-  test -f      "$py_site"/libquux.a
-  test -f      "$py_site"/am_virtenv/libzardoz.a
+  test -f      "$($MAKE get-pyexecdir ${1+"$@"})"/libquux.a
+  test -f      "$($MAKE get-pyexecdir ${1+"$@"})"/am_virtenv/libzardoz.a
 }

 check_uninstall ()
@@ -139,8 +141,8 @@ check_uninstall ()
   py_installed --not "$py_site"/am_foo.pyc
   test ! -e          "$py_site"/am_virtenv/__init__.py
   py_installed --not "$py_site"/am_virtenv/__init__.pyc
-  test ! -e          "$py_site"/libquux.a
-  test ! -e          "$py_site"/am_virtenv/libzardoz.a
+  test ! -e          "$($MAKE get-pyexecdir ${1+"$@"})"/libquux.a
+  test ! -e          "$($MAKE get-pyexecdir ${1+"$@"})"/am_virtenv/libzardoz.a
 }

 $ACLOCAL

compile finished at Thu Jul  6 18:27:36 2023

[Message part 3 (message/rfc822, inline)]
From: Mathieu Lirzin <mthl <at> gnu.org>
To: bug-automake <at> gnu.org
Subject: Python tests should run with multiple python versions
Date: Tue, 20 Feb 2018 21:39:14 +0100
[Message part 4 (text/plain, inline)]
The test suite applies its tests only with the ‘python’ executable which
is an issue since on most systems it corresponds to ‘python2’, and for
systems having only ‘python3’ the tests are simply skipped.

Moreover, when ‘python’ corresponds to ‘python3’ as it is the case on
distributions not following PEP394 [1] like Arch Linux, the test suite
fails (See attached log).

[test-suite.log (application/octet-stream, attachment)]
[Message part 6 (text/plain, inline)]
[1] https://www.python.org/dev/peps/pep-0394/

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

This bug report was last modified 1 year and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.