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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30556 in the body.
You can then email your comments to 30556 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Tue, 20 Feb 2018 20:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Lirzin <mthl <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Tue, 20 Feb 2018 20:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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 3 (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

Severity set to 'wishlist' from 'normal' Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2022 03:49:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2022 03:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Sun, 26 Mar 2023 11:23:02 GMT) Full text and rfc822 format available.

Message #12 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bogdan <bogdro_rep <at> gmx.us>
To: automake-patches <at> gnu.org, 30556 <at> debbugs.gnu.org
Subject: [bug#30556][PATCH] Python tests should run with multiple python
 versions
Date: Sun, 26 Mar 2023 13:21:45 +0200
[Message part 1 (text/plain, inline)]
Hi.

 I have both Python v2 and v3 installed on my system. The tests shown 
in the provided error log pass for me, in all cases:

- no version - defaults to 3.9.8

make check TESTS='t/nobase-python.sh t/py-compile-basic.sh 
t/py-compile-basedir.sh t/py-compile-destdir.sh 
t/py-compile-option-terminate.sh t/python3.sh t/python10.sh 
t/python12.sh '

- explicit v2 (2.7.18):

PYTHON=python2 make check TESTS='t/nobase-python.sh 
t/py-compile-basic.sh t/py-compile-basedir.sh t/py-compile-destdir.sh 
t/py-compile-option-terminate.sh t/python3.sh t/python10.sh 
t/python12.sh '

- explicit v3:

PYTHON=python3 make check TESTS='t/nobase-python.sh 
t/py-compile-basic.sh t/py-compile-basedir.sh t/py-compile-destdir.sh 
t/py-compile-option-terminate.sh t/python3.sh t/python10.sh 
t/python12.sh '


I guess this got fixed in the repository since the defect was 
reported. Some of the tests touch the "uninstall" target and that 
certainly was changed.

My Automake version:
- branch: master
- last commit ID: 0901ccdd0cb21bfa3911a2668615e388fef94426
- last commit date: Wed Mar 1 15:03:30 2023 -0800

Actually, I could fix t/python-prefix.sh to work with Python v2 and 
t/python-virtualenv.sh to work at all (didn't work by default for me). 
Patch attached. Now all tests with "py" in the name pass on my system 
(both with v2 and v3). I assume that Automake, 'make install' and 
'make uninstall' do their job correctly (and that's most probably 
true) and it's just the tests that were doing wrong.


-- 
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
[automake-fix-python-tests-mail.diff (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Sun, 26 Mar 2023 11:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Sun, 26 Mar 2023 22:48:02 GMT) Full text and rfc822 format available.

Message #18 received at 30556 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: bogdro_rep <at> gmx.us, 30556 <at> debbugs.gnu.org
Subject: Re: bug#30556: [PATCH] Python tests should run with multiple python
 versions
Date: Sun, 26 Mar 2023 16:47:18 -0600
    Subject: bug#30556: [PATCH] Python tests should run with multiple python
     versions

Thanks Bogdan (for this and other recent patches).

    I guess this got fixed in the repository 

Yes, Mike (Frysinger) has installed several Python-related patches since
the last release. And I think others are still pending. I've kind of
lost track of the current situation.

(Myself, I remain blocked due to the random test failure
problem. Someday I'll get back to Automake, I hope, but not this week. :()

karl




Information forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Mon, 27 Mar 2023 10:50:01 GMT) Full text and rfc822 format available.

Message #21 received at 30556 <at> debbugs.gnu.org (full text, mbox):

From: Bogdan <bogdro_rep <at> gmx.us>
To: Karl Berry <karl <at> freefriends.org>, 30556 <at> debbugs.gnu.org
Subject: Re: bug#30556: [PATCH] Python tests should run with multiple python
 versions
Date: Mon, 27 Mar 2023 12:48:52 +0200
Karl Berry <karl <at> freefriends.org>, Mon Mar 27 2023 00:47:18 GMT+0200 
(Central European Summer Time)
>      Subject: bug#30556: [PATCH] Python tests should run with multiple python
>       versions
> 
> Thanks Bogdan (for this and other recent patches).


 Glad to help. :)


>      I guess this got fixed in the repository
> 
> Yes, Mike (Frysinger) has installed several Python-related patches since
> the last release. And I think others are still pending.


 Yes, I saw a few commits in the history. I didn't dig deeper into 
them, but I saw that some at least touched one of the areas pointed to 
by this bug, so I simply assumed the commits fixed this bug "by the way".
 Python support looks more complicated than I thought (install 
source, complied objects, compiled-optimized objects, one time in 
"lib", the other - in "lib64", ...), but this at least was something I 
more-or-less understand and could help with.


> I've kind of
> lost track of the current situation.
> 
> (Myself, I remain blocked due to the random test failure
> problem. Someday I'll get back to Automake, I hope, but not this week. :()


 Since the defects I understand and maybe can fix are becoming fewer 
and fewer, I'm looking at that myself as well. Right now, I still 
insist the problem is in autom4te, but I'll need to do more analysis 
and testing.


-- 
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org





Information forwarded to bug-automake <at> gnu.org:
bug#30556; Package automake. (Fri, 07 Jul 2023 01:29:01 GMT) Full text and rfc822 format available.

Message #24 received at 30556 <at> debbugs.gnu.org (full text, mbox):

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




Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Fri, 07 Jul 2023 01:29:02 GMT) Full text and rfc822 format available.

Notification sent to Mathieu Lirzin <mthl <at> gnu.org>:
bug acknowledged by developer. (Fri, 07 Jul 2023 01:29:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Aug 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 259 days ago.

Previous Next


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