From unknown Fri Aug 15 14:45:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8847 <8847@debbugs.gnu.org> To: bug#8847 <8847@debbugs.gnu.org> Subject: Status: New format/layout for byte-compiled files in python >= 3.2 penalizes automake support Reply-To: bug#8847 <8847@debbugs.gnu.org> Date: Fri, 15 Aug 2025 21:45:43 +0000 retitle 8847 New format/layout for byte-compiled files in python >=3D 3.2 p= enalizes automake support reassign 8847 automake submitter 8847 Stefano Lattarini severity 8847 normal tag 8847 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 05:46:11 2011 Received: (at submit) by debbugs.gnu.org; 13 Jun 2011 09:46:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW3ik-0001pX-SD for submit@debbugs.gnu.org; Mon, 13 Jun 2011 05:46:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW3ij-0001pL-Bo for submit@debbugs.gnu.org; Mon, 13 Jun 2011 05:46:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW3id-0002zB-CF for submit@debbugs.gnu.org; Mon, 13 Jun 2011 05:46:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:39354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW3id-0002z7-Ak for submit@debbugs.gnu.org; Mon, 13 Jun 2011 05:46:03 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW3ic-0004GE-33 for bug-automake@gnu.org; Mon, 13 Jun 2011 05:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW3ia-0002yp-Rw for bug-automake@gnu.org; Mon, 13 Jun 2011 05:46:02 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:45015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW3ia-0002yl-MQ for bug-automake@gnu.org; Mon, 13 Jun 2011 05:46:00 -0400 Received: by wwb39 with SMTP id 39so3823577wwb.30 for ; Mon, 13 Jun 2011 02:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=GP8XKhoOiRFwUiaJKS0iJuFNniwDTrrv5q2ojn9deEY=; b=BY9XAymkWRPP+0rUcDYdsq1+tr8DTYIn3tpuh2ga+kEpu7iAVHuYhT4tdqHIQhFoCn NcvS91HJs3eKkbm2HwOO+fcsXpvdleequunB9p64AODRVl/FkSVM3r2hP1bAwNBF1WhZ tlfyIutdAUqpcogV9ly1Nf8HGanM+zvD4fiXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=rNkjbPFm40YVUQFXT5NCkTXTguwAbi0PEPGzywZ4j3tLTa2LxaQquFVlltJH7vLGTN dLUloRbupxlwv1nXDjmdQMJ1P78WLaRiqVJFGypztDA7V/cc3J6qyFmA6Y3OLCEAul3j Y2GlMGTGV9k+e0egKOIq2f4b+uiNjL4Y+d1vI= Received: by 10.227.37.7 with SMTP id v7mr5134397wbd.41.1307958359790; Mon, 13 Jun 2011 02:45:59 -0700 (PDT) Received: from bigio.localnet (host155-99-dynamic.5-87-r.retail.telecomitalia.it [87.5.99.155]) by mx.google.com with ESMTPS id en1sm4109529wbb.1.2011.06.13.02.45.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Jun 2011 02:45:58 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: New format/layout for byte-compiled files in python >= 3.2 penalizes automake support Date: Mon, 13 Jun 2011 11:45:45 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106131145.46301.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) Python 3.2 has changed the way in which byte-compiled files are stored and searched for, introducing the new concept of a cache directory `__pycache__' where version-specific byte-compiled files can be stored, for many different python versions and implementations at once: This bit (from the "Proposal" section) is mostly relevant to us: ``.pyc file outside of __pycache__ will only be imported if the .py source file is missing.'' This means that the byte-compiled files installed by the Python support in Automake will not be used by newer (>= 3.2) python versions :-( Luckily for us, this is "just" an optimization issue, not a correctness one: python 3.2 and later will simply use the *.py files installed by automake, the only downside being that it will have to recompile them on the fly each time. Nonetheless, I think this issue should be fixed in automake 1.12. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:09:16 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:09:16 +0000 Received: from localhost ([127.0.0.1]:55678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZWm-0003GL-Bu for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:09:16 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:51960) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZWj-0003GD-Is for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:09:14 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1541371eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=xV/SAFMkG3cqMtEPX1onI1J/56MOsJzWxfI/lD2rvB8=; b=04DLq053Gt1aMS3r29sV6J41s2rVorswIc5z6DrKkxLZuQbFY8mcTSFeoslDpXUy4m zNrh+g17iwUr6W0QuL3jatXJWgJR/5DKHEOcIfaOAvl1Ty2C9Xb1xzsBJS4YZLtGU29Z skMQHdRwfL39d3ATCJAknk2V8WKkKO4hAwrMgJ2yslNCwjcG8caKLJGfuJ6Sn/dFRsy5 lBqW9JSp6TTn0fF+UWz+SWrjc4J1Rd4BEpnTekbM+spBGdLEB30kDbv27i/5u2pDfYI5 OqAoXPTlAQCi7fIumMMFqzKfY46pGp4hlMfW2vRJ9d5jy5j9a0rBbUMaH0wrlw6FKChT bEsA== Received: by 10.14.210.200 with SMTP id u48mr27118874eeo.29.1353362885970; Mon, 19 Nov 2012 14:08:05 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id v47sm928500eeo.9.2012.11.19.14.08.04 (version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:08:05 -0800 (PST) Message-ID: <50AAADC0.7000104@gmail.com> Date: Mon, 19 Nov 2012 23:08:00 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: "Yaakov (Cygwin/X)" Subject: Re: [PATCH] Improve python support References: <1352137515-10000-1-git-send-email-yselkowitz@users.sourceforge.net> In-Reply-To: <1352137515-10000-1-git-send-email-yselkowitz@users.sourceforge.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: 8847@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) Hi Yaakov. Thanks for the patch, and sorry for the delay. On 11/05/2012 06:45 PM, Yaakov (Cygwin/X) wrote: > From: Yaakov Selkowitz > > * m4/python.m4 (AM_PATH_PYTHON): Add python3.3 to _AM_PYTHON_INTERPRETER_LIST. > * lib/py-compile: Fix compiled filenames for PEP-3147, currently implemented > in CPython 3.2 and newer. Do not create .pyo files for PyPy. > Congratulation, you have just fixed part of automake bug#8847 :-) That is much appreciated. I have now integrated your patch (with some minor fixlets to the commit message); I have also prepared some follow-up patches that do additional cleanup, fix several testsuite issues, and introduce PEP-3147 support in the "make uninstall" target too. I will soon publish the series as a reply to this message, and push it in a couple of days if there will be no objection. I intend for your fix to appear in the next minor Automake release (1.12.6), so the series will be pushed to the maint branch. Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:13:46 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:13:47 +0000 Received: from localhost ([127.0.0.1]:55692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZb7-0003N3-Lt for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:46 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:65453) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZb4-0003Mp-Sx for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:43 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1542729eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=hkSHZ/p6ZX/q2EYE3UJ0CH4JMmTqnhbdAUXUVPIcHsQ=; b=SYuAg9tdrzMJ80OmLkT3cj99rvqDBpi9FMO8y/9ZlRbDbsE32vD3CP3Lhs7lCKzM+O EhP2fQbCvHK+xKeLkeGJ5aSdOlmtSHThxTO7ALxPX4Ahgje0LHvH+F105PcOgMqwd47U udZrA1FSU9vnRkvg4GR5ltBTfyvQxvKJZSc9y9WoTJWIb3ASX4XdO0F6IeJe8IPFMahY IIJfNmcE5E2pMQ1bCr7OhnXsICGDdoWmIWfN7Pn5pwoy/61zYwukPdefWvyaOYNfIDq2 EcK2b0YML3XtNmldI9mir1S2TVLBSlr4pL0duYj/ZHR8rBXkF+Yt09dzl1h1wWyCUDtj IWHg== Received: by 10.14.223.200 with SMTP id v48mr28024641eep.24.1353363156612; Mon, 19 Nov 2012 14:12:36 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:35 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 0/8] tests: support for PEP-3147, and testsuite fixes Date: Mon, 19 Nov 2012 23:12:15 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: <50AAADC0.7000104@gmail.com> References: <50AAADC0.7000104@gmail.com> X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Original patch: Yaakov Selkowitz (1): python: improve support for modern python (CPython 3.2 and PyPy) Stefano Lattarini (7): news: document fix for bug#8847 (PEP-3147, __pycache__) tests: typofix in message tests: honour $PYTHON override tests: improve a comment python: uninstall cater to PEP-3147 python tests: support PEP-3147 installation layout tests: fix a spurious failure when $PYTHON is in the environment NEWS | 3 ++ lib/am/python.am | 30 ++++++++++--- lib/py-compile | 18 ++++++-- m4/python.m4 | 2 +- t/ax/am-test-lib.sh | 66 ++++++++++++++++++++++++++-- t/list-of-tests.mk | 1 - t/nobase-python.sh | 50 +++++++++++---------- t/py-compile-basedir.sh | 18 +++++--- t/py-compile-basic.sh | 19 +++++--- t/py-compile-basic2.sh | 70 ----------------------------- t/py-compile-destdir.sh | 22 ++++++---- t/py-compile-option-terminate.sh | 20 ++++----- t/python-pr10995.sh | 8 ++-- t/python-too-old.sh | 3 +- t/python-vars.sh | 2 - t/python-virtualenv.sh | 95 +++++++++++++++++++++++----------------- t/python10.sh | 36 +++++++-------- t/python11.sh | 3 ++ t/python12.sh | 14 +++--- t/python3.sh | 6 +-- 20 files changed, 272 insertions(+), 214 deletions(-) delete mode 100755 t/py-compile-basic2.sh -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:13:51 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:13:51 +0000 Received: from localhost ([127.0.0.1]:55697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbA-0003NP-Re for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:51 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:44102) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZb6-0003Ms-7M for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:45 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1542736eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=9v+bsX3eJl1MUQCfq8jaW4iRjqsNS97UUJDqdaQLe7g=; b=iswAc4EnMcacJ9MkbxCMC20oCwWUMV/v/o1zMrHVPjYS7ASqPcL4H3E5/gr70nDhqj LViW+OtdzZrspiHtIN32WguOYP8d+GdEDeQH1lNzFKwXYtX2bQ8io48Ben/XAOXTeEod rseYpl2fOp6XgM9dJ7cYf0u5RL4PUt4lGC2PyWHrGA/08S1OmOytE884T0GscjnJxH9E N8Exq2ISlp6iHDCFG2eFiGzt3FDduICVwtUHYfU+WG36CKRpT7+Kqy/nFtIxT7jaW/TY 8daVgHXfov22u/CRuX9P5RAmTBXuWSggIoMWqxbMy3xizIyYhu5caoO1Ohc6wh0wCyQF Cy7g== Received: by 10.14.179.1 with SMTP id g1mr28008511eem.14.1353363157956; Mon, 19 Nov 2012 14:12:37 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:37 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 1/8] python: improve support for modern python (CPython 3.2 and PyPy) Date: Mon, 19 Nov 2012 23:12:16 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) From: Yaakov Selkowitz This fixes automake bug#8847. * m4/python.m4 (AM_PATH_PYTHON): Add python3.3 to _AM_PYTHON_INTERPRETER_LIST. * lib/py-compile: Fix compiled filenames for PEP-3147, currently implemented in CPython 3.2 and newer. Do not create '.pyo' files for PyPy. Copyright-paperwork-exempt: yes Signed-off-by: Yaakov Selkowitz Signed-off-by: Stefano Lattarini --- lib/py-compile | 18 ++++++++++++++---- m4/python.m4 | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/py-compile b/lib/py-compile index 6916903..14d0d12 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -116,7 +116,7 @@ else fi $PYTHON -c " -import sys, os, py_compile +import sys, os, py_compile, imp files = '''$files''' @@ -129,12 +129,19 @@ for file in files.split(): continue sys.stdout.write(file) sys.stdout.flush() - py_compile.compile(filepath, filepath + 'c', path) + if hasattr(imp, 'get_tag'): + py_compile.compile(filepath, imp.cache_from_source(filepath), path) + else: + py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " -import sys, os, py_compile +import sys, os, py_compile, imp + +# pypy does not use .pyo optimization +if hasattr(sys, 'pypy_translation_info'): + sys.exit(0) files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') @@ -146,7 +153,10 @@ for file in files.split(): continue sys.stdout.write(file) sys.stdout.flush() - py_compile.compile(filepath, filepath + 'o', path) + if hasattr(imp, 'get_tag'): + py_compile.compile(filepath, imp.cache_from_source(filepath, False), path) + else: + py_compile.compile(filepath, filepath + 'o', path) sys.stdout.write('\n')" 2>/dev/null || : # Local Variables: diff --git a/m4/python.m4 b/m4/python.m4 index a247818..50213a9 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -37,7 +37,7 @@ AC_DEFUN([AM_PATH_PYTHON], dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], -[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl +[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:13:52 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:13:52 +0000 Received: from localhost ([127.0.0.1]:55700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbD-0003Nb-7p for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:51 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:37149) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZb7-0003My-Op for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:47 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so3445250eek.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=vD+3WOVI+9kU1kww3vMwjIr0RRtEZout6Mee8Rvs6SY=; b=Hdow1s30sPYOQqca9/JxQshPBuE1D39EbL9v0lE+Hw4dqVEe5+bq/Gs0m1k477eg1S gQIMG27IgeUc3yZ0yHOUGhlyVjDhZ8QLXx2tIIQuGv0XNPVgzuv4yz1xGzKbYOOM5iay tc5fqioaGyGqWlt9IOPOhXFO2DIRI2XW8Re2NLBcMR4vVEp4RprhIAWL3HG9ctf18cTL BcC2ZNdywHPJG9cXLvGlhWOoAtEZ56X1SczK7w7zraefm11XKOAv88frtyqgp0shsjwq ixfzOmpGYk04aa2YzXAu+FRW/BvCskDViQ1puI0Tjk8464ZdJ6d+9vrl4OKlzwLxLNTS tcTg== Received: by 10.14.3.195 with SMTP id 43mr12095992eeh.36.1353363159437; Mon, 19 Nov 2012 14:12:39 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:38 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 2/8] news: document fix for bug#8847 (PEP-3147, __pycache__) Date: Mon, 19 Nov 2012 23:12:17 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) * NEWS (Bugs fixed in 1.12.5): Here. Signed-off-by: Stefano Lattarini --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 6377234..4da66f8 100644 --- a/NEWS +++ b/NEWS @@ -97,6 +97,9 @@ Bugs fixed in 1.12.5: finding classic 'libname.a' style libraries when 'name.lib' and 'name.dll.lib' aren't available. + - Python byte-compilation supports the new layout mandated by PEP-3147, + with its __pycache__ directory (automake bug#8847). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 1.12.4: -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:13:59 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:13:59 +0000 Received: from localhost ([127.0.0.1]:55705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbG-0003Nu-B5 for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:59 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:54738) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZb9-0003N7-7V for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:48 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so3445259eek.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=8ScDda8+tHVlMH7f6i2z4JlN7Fy9ZxdcWOJqOoEs8gY=; b=AcljcK7Llet6pwSFq6W3xMT8y6qiRPzmyMGYhgMNCqxlLeISNid6HfQzcgX/YCrehy OrWXA1nocouDgJtwXqVAIOhfBC/Bx7lXKuMTbtZlN233MSpMqHVLFDgpFD28mupxz2nV NT0KhiCjBwTkY34hx1HecIx8sHXcshCYRd1XHXlvO5y76jFWB+LtBJavH8LUv9eIZoJT JI+QjZRb8WjGFlO7K/mD3suHufxXpxHDoksUKq08EfhQiQ/ReKC0i1DP9Qh8/rEaFWnm AxCtG6WMHbFkn35w4gmip7Y3ZiPrdBacbD7z3DcjYAogiIfGM1qpgITea6+9JpXCoIm/ YWTQ== Received: by 10.14.213.7 with SMTP id z7mr27584559eeo.39.1353363161067; Mon, 19 Nov 2012 14:12:41 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:40 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 3/8] tests: typofix in message Date: Mon, 19 Nov 2012 23:12:18 +0100 Message-Id: <2ccd405661bf7f49d14c5be54d4adacb046d521c.1353362896.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * t/python-virtualenv.sh: Here. Signed-off-by: Stefano Lattarini --- t/python-virtualenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh index 51ae78e..f1e0494 100755 --- a/t/python-virtualenv.sh +++ b/t/python-virtualenv.sh @@ -25,7 +25,7 @@ CONFIG_SITE=/dev/null; export CONFIG_SITE # Skip the test if a proper virtualenv cannot be created. virtualenv --verbose virtenv && test -f virtenv/bin/activate \ - || skip_ "coulnd't create python virtual environment" + || skip_ "couldn't create python virtual environment" # Activate the virtualenv. . ./virtenv/bin/activate -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:00 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:14:00 +0000 Received: from localhost ([127.0.0.1]:55707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbL-0003OA-Ok for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:00 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:65453) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbA-0003Mp-DT for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:49 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1542729eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=Mgd+X/DlZfSDzE9q+DnVb2EkSEE6ppO8AUj+IZcLasA=; b=jmqBBTaP0pnNoytbESkItfNW8BcaWF5SHJhs/cRTHMCajXA9+DioZUepOZaHimNvHY alhls8wPP9lpX3e+Efc7ggwxlR6xwdooQjPFNr5mR3VAQMbSoHJa9mNFki6ZkScFmCf1 ib0mjyd5dIWMcVbc4XWw8lddYb0l/Hf4EOWAHdiSu2SLkHjc076n0wpduCScZTRRIuv+ Wq1MJ3nVxPl1mwY4X2tyQbjpOz+oU92jGIPVhk43IAR/k89TNStfkMUpNdRXnDEFOmzi iNdpMIRxfqTc+luj4nhGHsUTOt+JjGLTmPvZuiExV5YdSY3ObktU4O4K66/v4DAfEbbw 6QYw== Received: by 10.14.179.1 with SMTP id g1mr28008999eem.14.1353363162558; Mon, 19 Nov 2012 14:12:42 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:41 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 4/8] tests: honour $PYTHON override Date: Mon, 19 Nov 2012 23:12:19 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * t/ax/am-test-lib.sh (require_tool): Here. * t/python-too-old.sh: And here. * t/python-vars.sh: And here. * t/python-virtualenv.sh: And here. Also add some sanity checks while at it. Signed-off-by: Stefano Lattarini --- t/ax/am-test-lib.sh | 5 +++-- t/python-too-old.sh | 3 ++- t/python-vars.sh | 2 -- t/python-virtualenv.sh | 9 ++++++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh index e69a904..85fb7c4 100644 --- a/t/ax/am-test-lib.sh +++ b/t/ax/am-test-lib.sh @@ -662,8 +662,9 @@ require_tool () ;; python) # Python doesn't support --version, it has -V - echo "$me: running python -V" - python -V || skip_all_ "python interpreter not available" + PYTHON=${PYTHON-python} + echo "$me: running $PYTHON -V" + $PYTHON -V || skip_all_ "python interpreter not available" ;; ro-dir) # Skip this test case if read-only directories aren't supported diff --git a/t/python-too-old.sh b/t/python-too-old.sh index e4185fc..b479c9e 100755 --- a/t/python-too-old.sh +++ b/t/python-too-old.sh @@ -34,6 +34,7 @@ py_too_old () grep '[Pp]ython interpreter is too old' stderr } +saved_PYTHON=$PYTHON; export saved_PYTHON PYTHON=; unset PYTHON cat > configure.ac < bin/my-python << 'END' #! /bin/sh -exec python ${1+"$@"} +exec $saved_PYTHON ${1+"$@"} END chmod a+x bin/my-python PATH=$(pwd)/bin$PATH_SEPARATOR$PATH diff --git a/t/python-vars.sh b/t/python-vars.sh index 5bac280..0c2c08b 100755 --- a/t/python-vars.sh +++ b/t/python-vars.sh @@ -23,8 +23,6 @@ required=python # In case the user's config.site defines pythondir or pyexecdir. CONFIG_SITE=/dev/null; export CONFIG_SITE -PYTHON=python - # Update the definition below if the documentation changes. # Note that the value of the 'pythondir' and 'pyexecdir' variables can # vary among different python installations, so we need more relaxed diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh index f1e0494..23a9edc 100755 --- a/t/python-virtualenv.sh +++ b/t/python-virtualenv.sh @@ -23,8 +23,10 @@ required='cc python virtualenv' # In case the user's config.site defines pythondir or pyexecdir. CONFIG_SITE=/dev/null; export CONFIG_SITE +py_version_pre=$($PYTHON -V) + # Skip the test if a proper virtualenv cannot be created. -virtualenv --verbose virtenv && test -f virtenv/bin/activate \ +virtualenv -p"$PYTHON" --verbose virtenv && test -f virtenv/bin/activate \ || skip_ "couldn't create python virtual environment" # Activate the virtualenv. @@ -34,6 +36,11 @@ if test -z "$VIRTUAL_ENV"; then framework_failure_ "can't activate python virtual environment" fi +py_version_post=$(python -V) + +# Sanity check. +test "$py_version_pre" = "$py_version_post" + cwd=$(pwd) || fatal_ "getting current working directory" py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))') py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:00 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:14:00 +0000 Received: from localhost ([127.0.0.1]:55709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbM-0003OH-7d for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:00 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:37149) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbB-0003My-Ux for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:50 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so3445250eek.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=XmUvu0zq93divDUl6LQRwCpR1luvrZfKd1Cn0vKghuA=; b=ZB9LWa9dKM7rteWDf9yMYgYYZFIDckER6M127OdlEjZXJn4/h/aTiPTUsHMW0qsNQu hbkc7RtEpReyP3A/sXsRH+w8ZBuf2Lp5tsTrSg3ZiZQ8PAeQ05Cyj98KVHizBywVauzp kcnGyC5irwsUIrCvRb49e4iz4vrEukTNIrTp0GafhB8Es1L/8MFMQocmwhsIUsdiAXhd Sx2DcCrjn3HMqd7f771zyfLTaRolA6w9Zfp7TsEfYdScKzQB6WJXBnhJVnODew81jZrl 58oh+jVXnVPlwpcsCQjSy5pME4wvDTwqbfCfboiGSkYSNWkhRVB9p/2Qmw0sEVXoSDab 07vA== Received: by 10.14.210.200 with SMTP id u48mr27147287eeo.29.1353363164031; Mon, 19 Nov 2012 14:12:44 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:43 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 5/8] tests: improve a comment Date: Mon, 19 Nov 2012 23:12:20 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * t/ax/am-test-lib.sh (require_tool): Here, about python support for '--version' option. Signed-off-by: Stefano Lattarini --- t/ax/am-test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh index 85fb7c4..103f97d 100644 --- a/t/ax/am-test-lib.sh +++ b/t/ax/am-test-lib.sh @@ -661,8 +661,8 @@ require_tool () ! cross_compiling || skip_all_ "doesn't work in cross-compile mode" ;; python) - # Python doesn't support --version, it has -V PYTHON=${PYTHON-python} + # Older python versions don't support --version, they have -V. echo "$me: running $PYTHON -V" $PYTHON -V || skip_all_ "python interpreter not available" ;; -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:01 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:14:01 +0000 Received: from localhost ([127.0.0.1]:55711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbM-0003OP-IO for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:01 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:54738) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbD-0003N7-63 for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:53 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so3445259eek.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=CQhHwc/D2D1TmRO5fi2jKDTyeCsDKPtWcxjGElcu9IA=; b=eoxnx0lBfZaLf0vrKgl9tEau9irUQaDzo2GKVqXQ9ttnV0SlMhJBf6wgSleqzGordd B1h3chww0Y0u6Ije8nTucLSRumCqSexPWcarZ0+5hIkidrSeG2zpaV0AQcxtO6f4mFfX AUD4iGlCrgQD5sgOfCnL+8yVtfb65Rber9HrFFNA0JoYmi8BI+Zzq1nzkFzwYmo5OeDY 0z0DMhdE3kSyx4i2cuQEBnhicNtMHoofEf/vRuitfIR1FHC/FwHtNdaURvMet+6GXZ7r OiVKKzojitPj1NUTbHJx/eNpQGQ/8Wt9aRYqhGFhGrUB7OXLem+1HNh80ZyrNny7sGsa WOOA== Received: by 10.14.223.135 with SMTP id v7mr27612089eep.41.1353363165345; Mon, 19 Nov 2012 14:12:45 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:44 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 6/8] python: uninstall cater to PEP-3147 Date: Mon, 19 Nov 2012 23:12:21 +0100 Message-Id: <3fea76478eb1364093804365904fdb3c1e5c93d2.1353362896.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) After recent commit commit v1.12.4-43-ge0e99ed, "python: improve support for modern python (CPython 3.2 and PyPy)", the python install rules have been made smart enough to install "*.pyc" byte-compiled files according to PEP-3147 with modern (post-3.2) pythons. However, the uninstall rules hadn't been updated accordingly, causing leftover files to remain around after "make uninstall", as well as failures in "make distcheck". * lib/am/python.am (am__pep3147_tweak): New internal macro, used in ... (uninstall-%DIR%PYTHON): ... the recipe of this target, which has been adjusted to cater to PEP-3147 Signed-off-by: Stefano Lattarini --- lib/am/python.am | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/am/python.am b/lib/am/python.am index cab6129..2f12af4 100644 --- a/lib/am/python.am +++ b/lib/am/python.am @@ -94,19 +94,37 @@ endif %?INSTALL% ## -------------- ## if %?INSTALL% + +?FIRST?am__pep3147_tweak = \ +?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|' + .PHONY uninstall-am: uninstall-%DIR%PYTHON uninstall-%DIR%PYTHON: @$(NORMAL_UNINSTALL) @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \ -?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ -?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ - test -n "$$files" || exit 0; \ +?BASE? py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ +?!BASE? $(am__nobase_strip_setup); py_files=`$(am__nobase_strip)`; \ + test -n "$$py_files" || exit 0; \ dir='$(DESTDIR)$(%NDIR%dir)'; \ ## Also remove the .pyc and .pyo byte compiled versions. - filesc=`echo "$$files" | sed 's|$$|c|'`; \ - fileso=`echo "$$files" | sed 's|$$|o|'`; \ +## This is somewhat tricky, because for newer pythons we have to take +## PEP-3147 into account. + pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \ + pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \ + py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \ + echo "$$py_files_pep3147";\ + pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \ + pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \ st=0; \ - for files in "$$files" "$$filesc" "$$fileso"; do \ + for files in \ + "$$py_files" \ + "$$pyc_files" \ + "$$pyo_files" \ +## Installation of '.py' files is not influenced by PEP-3147, so it +## is correct *not* to have $pyfiles_pep3147 here. + "$$pyc_files_pep3147" \ + "$$pyo_files_pep3147" \ + ; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:07 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:14:08 +0000 Received: from localhost ([127.0.0.1]:55717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbP-0003P9-6s for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:07 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:44102) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbE-0003Ms-U3 for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:56 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1542736eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=6rwm5TMJLMWhEGxbv7Yrn0hBuJEs8uAqHDcSjuX+Wwk=; b=mcB5kk8VQ5rqjh1IZ9BcA5p7136zPQhu98naczBgloo1K6rivIxoIsrBAnJltV/4Bw OlsIb1SnmfQms2lhgwgEGFbXq2pen4/2lQlf7E1tZuqy4/aTyOOi5ewyWRv5zkOJLy4u VCgZaEzrNvIe8lesHAyx2Y98C8+jMHpho44O77XTOMET1bk7AG0bSQuWJWY5qka027IG 35U+O04X5q+IHPiWxUSXzvUjVEdvcGeS3Y3Ql0NneUPHVEibOFpq6WU5N3z99l6eOIL3 JQLcMAG9avCHW2kdKDF80mcD43dvEo/xSR+wWA+EWnuqCPPlSUVWnEhyK+K+dTO52Qsj JUKA== Received: by 10.14.179.1 with SMTP id g1mr28009464eem.14.1353363167041; Mon, 19 Nov 2012 14:12:47 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:46 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 7/8] python tests: support PEP-3147 installation layout Date: Mon, 19 Nov 2012 23:12:22 +0100 Message-Id: X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) This fixes several spurious testsuite failures with python >= 3.2, introduced by recent commit v1.12.4-43-ge0e99ed, "python: improve support for modern python (CPython 3.2 and PyPy)". * t/ax/am-test-lib.sh (python_has_pep3147, pyc_location, py_installed): New functions. ($am_pep3147_tag): New variable. * t/py-compile-basic2.sh: Deleted, too difficult to adapt for the gain it would offer; move the still relevant parts ... * t/py-compile-basic.sh: ... here. Adapt and adjust the rest of the test as well. * t/nobase-python.sh: Adapt and adjust. * t/py-compile-basedir.sh: Likewise. * t/py-compile-destdir.sh: Likewise. * t/py-compile-option-terminate.sh: Likewise. * t/python-pr10995.sh: Likewise. * t/python-virtualenv.sh: Likewise. * t/python10.sh: Likewise. * t/python12.sh: Likewise. * t/python3.sh: Likewise. * t/list-of-tests.mk: Adjust list of tests. Signed-off-by: Stefano Lattarini --- t/ax/am-test-lib.sh | 59 +++++++++++++++++++++++++++ t/list-of-tests.mk | 1 - t/nobase-python.sh | 50 +++++++++++++---------- t/py-compile-basedir.sh | 18 +++++---- t/py-compile-basic.sh | 19 ++++++--- t/py-compile-basic2.sh | 70 -------------------------------- t/py-compile-destdir.sh | 22 +++++----- t/py-compile-option-terminate.sh | 20 +++++----- t/python-pr10995.sh | 8 ++-- t/python-virtualenv.sh | 86 ++++++++++++++++++++++------------------ t/python10.sh | 36 ++++++++--------- t/python12.sh | 14 +++---- t/python3.sh | 6 +-- 13 files changed, 213 insertions(+), 196 deletions(-) delete mode 100755 t/py-compile-basic2.sh diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh index 103f97d..5725f28 100644 --- a/t/ax/am-test-lib.sh +++ b/t/ax/am-test-lib.sh @@ -443,6 +443,65 @@ fetch_tap_driver () # use the perl implementation by default for the moment. am_tap_implementation=${am_tap_implementation-shell} +# $PYTHON and support for PEP-3147. Needed to check our python-related +# install rules. +python_has_pep3147 () +{ + if test -z "$am_pep3147_tag"; then + am_pep3147_tag=$($PYTHON -c 'import imp; print(imp.get_tag())') \ + || am_pep3147_tag=none + fi + test $am_pep3147_tag != none +} +am_pep3147_tag= + +# pyc_location [-p] [FILE] +# ------------------------ +# Determine what the actual location of the given '.pyc' or '.pyo' +# byte-compiled file should be, taking into account PEP-3147. Save +# the location in the '$am_pyc_file' variable. If the '-p' option +# is given, print the location on the standard output as well. +pyc_location () +{ + case $#,$1 in + 2,-p) am_pyc_print=yes; shift;; + 1,*) am_pyc_print=no;; + *) fatal_ "pyc_location: invalid usage";; + esac + if python_has_pep3147; then + case $1 in + */*) am_pyc_dir=${1%/*} am_pyc_base=${1##*/};; + *) am_pyc_dir=. am_pyc_base=$1;; + esac + am_pyc_ext=${am_pyc_base##*.} + am_pyc_base=${am_pyc_base%.py?} + am_pyc_file=$am_pyc_dir/__pycache__/$am_pyc_base.$am_pep3147_tag.$am_pyc_ext + else + am_pyc_file=$1 + fi + test $am_pyc_print = no || printf '%s\n' "$am_pyc_file" +} + +# py_installed [--not] FILE +# -------------------------- +# Check that the given python FILE has been installed (resp. *not* +# installed, if the '--not' option is specified). If FILE is a +# byte-compiled '.pyc' file, the new installation layout specified +# by PEP-3147 will be taken into account. +py_installed () +{ + case $#,$1 in + 1,*) am_test_py_file='test -f';; + 2,--not) am_test_py_file='test ! -e'; shift;; + *) fatal_ "pyc_installed: invalid usage";; + esac + case $1 in + *.py[co]) pyc_location "$1"; am_target_py_file=$am_pyc_file;; + *) am_target_py_file=$1;; + esac + $am_test_py_file "$am_target_py_file" +} + # Usage: require_compiler_ {cc|c++|fortran|fortran77} require_compiler_ () { diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 4d84940..8d551d1 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -882,7 +882,6 @@ t/print-libdir.sh \ t/proginst.sh \ t/programs-primary-rewritten.sh \ t/py-compile-basic.sh \ -t/py-compile-basic2.sh \ t/py-compile-basedir.sh \ t/py-compile-destdir.sh \ t/py-compile-env.sh \ diff --git a/t/nobase-python.sh b/t/nobase-python.sh index dba17f7..6480f26 100755 --- a/t/nobase-python.sh +++ b/t/nobase-python.sh @@ -28,21 +28,31 @@ cat > Makefile.am <<'END' mydir=$(prefix)/my my_PYTHON = one.py sub/base.py nobase_my_PYTHON = two.py sub/nobase.py - -test-install-data: install-data - find inst -print; : For debugging. - test -f inst/my/one.py - test -f inst/my/one.pyc - test -f inst/my/two.py - test -f inst/my/two.pyc - test -f inst/my/base.py - test -f inst/my/base.pyc - test -f inst/my/sub/nobase.py - test -f inst/my/sub/nobase.pyc - test ! -f inst/my/nobase.py - test ! -f inst/my/nobase.pyc END +test_install() +{ + $MAKE install-data + find inst -print # For debugging. + py_installed inst/my/one.py + py_installed inst/my/one.pyc + py_installed inst/my/two.py + py_installed inst/my/two.pyc + py_installed inst/my/base.py + py_installed inst/my/base.pyc + py_installed inst/my/sub/nobase.py + py_installed inst/my/sub/nobase.pyc + py_installed --not inst/my/nobase.py + py_installed --not inst/my/nobase.pyc +} + +test_uninstall() +{ + $MAKE uninstall + test -d inst/my + ! find inst/my -type f -print | grep . +} + mkdir sub for file in one.py sub/base.py two.py sub/nobase.py; do @@ -56,23 +66,19 @@ $AUTOMAKE --add-missing ./configure --prefix "$(pwd)/inst" --program-prefix=p $MAKE -$MAKE test-install-data -$MAKE uninstall - -find inst/my -type f -print | grep . && exit 1 +test_install +test_uninstall $MAKE install-strip +test_uninstall # Likewise, in a VPATH build. -$MAKE uninstall $MAKE distclean mkdir build cd build ../configure --prefix "$(pwd)/inst" --program-prefix=p -$MAKE -$MAKE test-install-data -$MAKE uninstall -find inst/my -type f -print | grep . && exit 1 +test_install +test_uninstall : diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh index f2cef30..75b45f7 100755 --- a/t/py-compile-basedir.sh +++ b/t/py-compile-basedir.sh @@ -38,13 +38,17 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do : > "$d2/$f.py" : > "$d2/sub/$f.py" ./py-compile --basedir "$d" "$f.py" "sub/$f.py" - ls -l "$d2" "$d2/sub" # For debugging. - test -f "$d2/$f.pyc" - test -f "$d2/$f.pyo" - test -f "$d2/sub/$f.pyc" - test -f "$d2/sub/$f.pyo" - rm -f "$d2/$f.pyc" "$d2/$f.pyo" "$d2/sub/$f.pyc" "$d2/sub/$f.pyo" - find . | grep '\.py[co]$' && exit 1 + find "$d2" # For debugging. + py_installed "$d2/$f.pyc" + py_installed "$d2/$f.pyo" + py_installed "$d2/sub/$f.pyc" + py_installed "$d2/sub/$f.pyo" + files=$(find "$d2" | grep '\.py[co]$') + test $(echo "$files" | wc -l) -eq 4 + case $d2 in + .|..) rm -f $files;; + *) rm -rf "$d2";; + esac done : diff --git a/t/py-compile-basic.sh b/t/py-compile-basic.sh index 73597c3..cc5fec3 100755 --- a/t/py-compile-basic.sh +++ b/t/py-compile-basic.sh @@ -46,7 +46,8 @@ class Foo: bar = baz = (1, (2,), [3, 4]); zardoz = 0; END -cat > bar.py <<'END' +mkdir sub +cat > sub/bar.py <<'END' # Import of non-existent modules, or assertion of false conditions, # shouldn't cause problems, as it should be enough for the code to # be syntactically correct. @@ -54,10 +55,16 @@ import Automake.No.Such.Module assert False END -./py-compile foo.py bar.py -test -f foo.pyc -test -f foo.pyo -test -f bar.pyc -test -f bar.pyo +# An empty file in a more deeply-nested directory should be ok as well. +mkdir -p 1/_/2/_/3/_ +: > 1/_/2/_/3/_/0.py + +./py-compile foo.py sub/bar.py 1/_/2/_/3/_/0.py +py_installed foo.pyc +py_installed foo.pyo +py_installed sub/bar.pyc +py_installed sub/bar.pyo +py_installed 1/_/2/_/3/_/0.pyc +py_installed 1/_/2/_/3/_/0.pyo : diff --git a/t/py-compile-basic2.sh b/t/py-compile-basic2.sh deleted file mode 100755 index 19fdf72..0000000 --- a/t/py-compile-basic2.sh +++ /dev/null @@ -1,70 +0,0 @@ -#! /bin/sh -# Copyright (C) 2011-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Test more basic functionalities of the 'py-compile' script, with -# dummy python sources, but more complex directory layouts. See also -# related test 'py-compile-basic.sh'. - -required=python -. ./defs || exit 1 - -ocwd=$(pwd) || fatal_ "getting current working directory" - -pyfiles=" - foo.py - ./foo1.py - ../foo2.py - ../dir/foo3.py - $ocwd/foo4.py - sub/bar.py - sub/subsub/barbar.py - __init__.py - sub/__init__.py - 1.py - .././_.py -" - -lst=' - dir/foo - dir/foo1 - foo2 - dir/foo3 - foo4 - dir/sub/bar - dir/sub/subsub/barbar - dir/__init__ - dir/sub/__init__ - dir/1 - _ -' - -mkdir dir -cd dir -cp "$am_scriptdir/py-compile" . \ - || fatal_ "failed to fetch auxiliary script py-compile" -mkdir sub sub/subsub -touch $pyfiles -./py-compile $pyfiles -cd "$ocwd" - -for x in $lst; do echo $x.pyc; echo $x.pyo; done | sort > exp -find . -name '*.py[co]' | sed 's|^\./||' | sort > got - -cat exp -cat got -diff exp got - -: diff --git a/t/py-compile-destdir.sh b/t/py-compile-destdir.sh index 4d303d5..ba666f6 100755 --- a/t/py-compile-destdir.sh +++ b/t/py-compile-destdir.sh @@ -1,4 +1,4 @@ -#! /bin/sh + #! /bin/sh # Copyright (C) 2011-2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -31,13 +31,17 @@ echo 'def foo (): return "foo"' > $destdir/foo.py echo 'def bar (): return "bar"' > $destdir/sub/bar.py ./py-compile --destdir $destdir foo.py sub/bar.py -ls -l $destdir $destdir/sub # For debugging. -ls . sub | grep '\.py[co]$' && exit 1 -test -f $destdir/foo.pyc -test -f $destdir/foo.pyo -test -f $destdir/sub/bar.pyc -test -f $destdir/sub/bar.pyo -strings $destdir/*.py[co] $destdir/sub/*.py[co] || : # For debugging. -$FGREP $destdir $destdir/*.py[co] $destdir/sub/*.py[co] && exit 1 + +find $destdir # For debugging. +st=0 +for x in c o; do + for b in foo sub/bar; do + f=$(pyc_location -p "$destdir/$b.py$x") + test -f "$f" + strings "$f" || : # For debugging. + $FGREP $destdir $f && { echo BAD: $f; st=1; } + done +done +exit $st : diff --git a/t/py-compile-option-terminate.sh b/t/py-compile-option-terminate.sh index 5c2b56f..0ad1fd8 100755 --- a/t/py-compile-option-terminate.sh +++ b/t/py-compile-option-terminate.sh @@ -26,18 +26,18 @@ cp "$am_scriptdir/py-compile" . \ : > ./-o.py : > ./--foo.py ./py-compile -- -o.py --foo.py -test -f ./-o.pyc -test -f ./-o.pyo -test -f ./--foo.pyc -test -f ./--foo.pyo +py_installed ./-o.pyc +py_installed ./-o.pyo +py_installed ./--foo.pyc +py_installed ./--foo.pyo rm -f ./-*.py[co] : > x.py ./py-compile x.py -o.py --foo.py -test -f ./x.pyc -test -f ./x.pyo -test -f ./-o.pyc -test -f ./-o.pyo -test -f ./--foo.pyc -test -f ./--foo.pyo +py_installed ./x.pyc +py_installed ./x.pyo +py_installed ./-o.pyc +py_installed ./-o.pyo +py_installed ./--foo.pyc +py_installed ./--foo.pyo : diff --git a/t/python-pr10995.sh b/t/python-pr10995.sh index c530a13..63e97c5 100755 --- a/t/python-pr10995.sh +++ b/t/python-pr10995.sh @@ -46,10 +46,10 @@ test -f py-compile ./configure --prefix="$(pwd)/inst" $MAKE install -test -f inst/py/yes.py -test -f inst/py/yes.pyc -test ! -e inst/py/no.py -test ! -e inst/py/no.pyc +test -f inst/py/yes.py +test ! -e inst/py/no.py +py_installed inst/py/yes.pyc +py_installed --not inst/py/no.pyc $MAKE disttest diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh index 23a9edc..89a99aa 100755 --- a/t/python-virtualenv.sh +++ b/t/python-virtualenv.sh @@ -26,7 +26,7 @@ CONFIG_SITE=/dev/null; export CONFIG_SITE py_version_pre=$($PYTHON -V) # Skip the test if a proper virtualenv cannot be created. -virtualenv -p"$PYTHON" --verbose virtenv && test -f virtenv/bin/activate \ +virtualenv -p"$PYTHON" --verbose virtenv && py_installed virtenv/bin/activate \ || skip_ "couldn't create python virtual environment" # Activate the virtualenv. @@ -45,12 +45,20 @@ cwd=$(pwd) || fatal_ "getting current working directory" py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))') py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages +# We need to do do this early, just to set some cache variables properly, +# since because we're going to unset $PYTHON next. +if python_has_pep3147; then + : PEP 3147 will be used in installation of ".pyc" files +fi +# We don't want our original python to be picked up by configure +# invocations. +unset PYTHON + # We need control over the package name. cat > configure.ac << END AC_INIT([am_virtenv], [1.0]) AM_INIT_AUTOMAKE AC_CONFIG_FILES([Makefile]) -AC_SUBST([MY_VIRTENV], ['$cwd/virtenv']) AC_PROG_CC AM_PROG_AR AC_PROG_RANLIB @@ -66,9 +74,7 @@ libquux_a_SOURCES = foo.c pkgpyexec_LIBRARIES = libzardoz.a libzardoz_a_SOURCES = foo.c -py_site = $(MY_VIRTENV)/lib/python$(PYTHON_VERSION)/site-packages - -.PYTHON: debug test-run test-install test-uninstall +.PYTHON: debug test-run debug: @echo PYTHON: $(PYTHON) @echo PYTHON_VERSION: $(PYTHON_VERSION) @@ -92,24 +98,6 @@ test-run: ## available. python -c 'from am_foo import foo_func; assert (foo_func () == 12345)' python -c 'from am_virtenv import old_am; assert (old_am () == "AutoMake")' -test-install: - test -f $(py_site)/am_foo.py - test -f $(py_site)/am_foo.pyc - test -f $(py_site)/am_foo.pyo - test -f $(py_site)/am_virtenv/__init__.py - test -f $(py_site)/am_virtenv/__init__.pyc - test -f $(py_site)/am_virtenv/__init__.pyo - test -f $(py_site)/libquux.a - test -f $(py_site)/am_virtenv/libzardoz.a -test-uninstall: - test ! -f $(py_site)/am_foo.py - test ! -f $(py_site)/am_foo.pyc - test ! -f $(py_site)/am_foo.pyo - test ! -f $(py_site)/am_virtenv/__init__.py - test ! -f $(py_site)/am_virtenv/__init__.pyc - test ! -f $(py_site)/am_virtenv/__init__.pyo - test ! -f $(py_site)/libquux.a - test ! -f $(py_site)/am_virtenv/libzardoz.a all-local: debug END @@ -130,6 +118,34 @@ int foo (void) } END +check_install () +{ + $MAKE install ${1+"$@"} + + test -f "$py_site"/am_foo.py + py_installed "$py_site"/am_foo.pyc + py_installed "$py_site"/am_foo.pyo + py_installed "$py_site"/am_virtenv/__init__.py + py_installed "$py_site"/am_virtenv/__init__.pyc + py_installed "$py_site"/am_virtenv/__init__.pyo + test -f "$py_site"/libquux.a + test -f "$py_site"/am_virtenv/libzardoz.a +} + +check_uninstall () +{ + $MAKE uninstall ${1+"$@"} + + test ! -e "$py_site"/am_foo.py + py_installed --not "$py_site"/am_foo.pyc + py_installed --not "$py_site"/am_foo.pyo + test ! -e "$py_site"/am_virtenv/__init__.py + py_installed --not "$py_site"/am_virtenv/__init__.pyc + py_installed --not "$py_site"/am_virtenv/__init__.pyo + test ! -e "$py_site"/libquux.a + test ! -e "$py_site"/am_virtenv/libzardoz.a +} + $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing @@ -138,31 +154,25 @@ $AUTOMAKE --add-missing mkdir build cd build ../configure --prefix="$VIRTUAL_ENV" -$MAKE install -$MAKE test-install +check_install $MAKE test-run -$MAKE uninstall -$MAKE test-uninstall +check_uninstall cd .. # Try an in-tree build. ./configure --prefix="$VIRTUAL_ENV" -$MAKE install -$MAKE test-install +check_install $MAKE test-run -$MAKE uninstall -$MAKE test-uninstall +check_uninstall $MAKE distclean # Overriding pythondir and pyexecdir with cache variables should work. ./configure am_cv_python_pythondir="$py_site" \ am_cv_python_pyexecdir="$py_site" -$MAKE install -$MAKE test-install +check_install $MAKE test-run -$MAKE uninstall -$MAKE test-uninstall +check_uninstall $MAKE distclean @@ -170,12 +180,10 @@ $MAKE distclean ./configure --prefix="$cwd/bad-prefix" pythondir=$py_site pyexecdir=$py_site export pythondir pyexecdir -$MAKE -e install +check_install -e test ! -e bad-prefix -$MAKE -e test-install $MAKE test-run -$MAKE -e uninstall -$MAKE -e test-uninstall +check_uninstall -e unset pythondir pyexecdir # Also check that the distribution is self-contained, for completeness. diff --git a/t/python10.sh b/t/python10.sh index 5465810..8814902 100755 --- a/t/python10.sh +++ b/t/python10.sh @@ -58,29 +58,29 @@ cwd=$(pwd) || fatal_ "getting current working directory" ../configure --prefix="$cwd/$inst" one=0 $MAKE install -test -f "$inst/your/two.py" -test -f "$inst/your/two.pyc" -test -f "$inst/your/two.pyo" -test ! -e "$inst/my/one.py" -test ! -e "$inst/my/one.pyc" -test ! -e "$inst/my/one.pyo" +test -f "$inst/your/two.py" +py_installed "$inst/your/two.pyc" +py_installed "$inst/your/two.pyo" +py_installed --not "$inst/my/one.py" +py_installed --not "$inst/my/one.pyc" +py_installed --not "$inst/my/one.pyo" $MAKE uninstall -test ! -e "$inst/your/two.py" -test ! -e "$inst/your/two.pyc" -test ! -e "$inst/your/two.pyo" +py_installed --not "$inst/your/two.py" +py_installed --not "$inst/your/two.pyc" +py_installed --not "$inst/your/two.pyo" ../configure --prefix=$cwd/"$inst" one=1 $MAKE install -test ! -e "$inst/your/two.py" -test ! -e "$inst/your/two.pyc" -test ! -e "$inst/your/two.pyo" -test -f "$inst/my/one.py" -test -f "$inst/my/one.pyc" -test -f "$inst/my/one.pyo" +py_installed --not "$inst/your/two.py" +py_installed --not "$inst/your/two.pyc" +py_installed --not "$inst/your/two.pyo" +test -f "$inst/my/one.py" +py_installed "$inst/my/one.pyc" +py_installed "$inst/my/one.pyo" $MAKE uninstall -test ! -e "$inst/my/one.py" -test ! -e "$inst/my/one.pyc" -test ! -e "$inst/my/one.pyo" +py_installed --not "$inst/my/one.py" +py_installed --not "$inst/my/one.pyc" +py_installed --not "$inst/my/one.pyo" $MAKE disttest diff --git a/t/python12.sh b/t/python12.sh index 898c673..12dca5d 100755 --- a/t/python12.sh +++ b/t/python12.sh @@ -36,19 +36,19 @@ $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing -instdir=$(pwd)/inst +destdir=$(pwd)/inst mkdir inst build cd build ../configure --prefix="/usr" -$MAKE install DESTDIR=$instdir +$MAKE install DESTDIR=$destdir # Perfunctory test that the files were created. -test -f "$instdir/usr/share/my/my.py" -test -f "$instdir/usr/share/my/my.pyc" -test -f "$instdir/usr/share/my/my.pyo" +test -f "$destdir/usr/share/my/my.py" +pyo=$(pyc_location -p "$destdir/usr/share/my/my.pyo") +pyc=$(pyc_location -p "$destdir/usr/share/my/my.pyc") # If DESTDIR has made it into the byte compiled files, fail the test. -$FGREP "$instdir" "$instdir/usr/share/my/my.pyo" \ - "$instdir/usr/share/my/my.pyc" && exit 1 +st=0; $FGREP "$destdir" "$pyc" "$pyo" || st=$? +test $st -eq 1 : diff --git a/t/python3.sh b/t/python3.sh index 8667cf9..934be21 100755 --- a/t/python3.sh +++ b/t/python3.sh @@ -40,8 +40,8 @@ mkdir build cd build ../configure --prefix="$(pwd)/inst" $MAKE install -test -f inst/my/one.py -test -f inst/my/one.pyc -test -f inst/my/one.pyo +py_installed inst/my/one.py +py_installed inst/my/one.pyc +py_installed inst/my/one.pyo : -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:08 2012 Received: (at 8847) by debbugs.gnu.org; 19 Nov 2012 22:14:08 +0000 Received: from localhost ([127.0.0.1]:55722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbT-0003Pi-Um for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:08 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:65453) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbG-0003Mp-4h for 8847@debbugs.gnu.org; Mon, 19 Nov 2012 17:13:57 -0500 Received: by mail-ea0-f172.google.com with SMTP id a1so1542729eaa.3 for <8847@debbugs.gnu.org>; Mon, 19 Nov 2012 14:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=u0w2ZqTlga+IeWQO+zVJiRyjqHHWszLt44iaq9/0yEE=; b=vhU3p7j0yZNlXKfn0q1RrvqpGUmGRRZ9/VEohRKpYAF9P3Vdc3Jepzh5Dv7cpbWSIu LoW5MZW113THtfJw6hvBOoHIBeDdN4u8MelBDijBtou9vx/TbOSCWyHQtz1CGuieQj9g w0T+cJ+J/7K0S1D0yo9InD16GvcCT2l7Zlz7dlaN4Z/en6w9ws9dOWdce6RQFm2CBr5r zIvfH+v1w94vcbvHPinHmr/2fnMqeHOlfKSvpFetQpJabfIhI/WOsjej2NoGgq3BkiuN CABEGFbakcCplMeXoNOqCgY38OstgDrE9SMh8R43el5dG3Oshbwq7xbLMros9o4nfvgs J31A== Received: by 10.14.178.195 with SMTP id f43mr28079669eem.44.1353363168299; Mon, 19 Nov 2012 14:12:48 -0800 (PST) Received: from localhost.localdomain (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id b44sm26667366eep.12.2012.11.19.14.12.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:12:47 -0800 (PST) From: Stefano Lattarini To: automake-patches@gnu.org Subject: [PATCH 8/8] tests: fix a spurious failure when $PYTHON is in the environment Date: Mon, 19 Nov 2012 23:12:23 +0100 Message-Id: <97776796cd9088d2ae3bf97066d32568ad6d1501.1353362896.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.0.209.gf3828dc In-Reply-To: References: <50AAADC0.7000104@gmail.com> In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 8847 Cc: yselkowitz@users.sourceforge.net, 8847@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) * t/python11.sh: This test doesn't interact well with user-overrides of $PYTHON; and, given its particular nature, neither should it be expected to honour that override. Just unset that $PYTHON variable and live happy. Signed-off-by: Stefano Lattarini --- t/python11.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/python11.sh b/t/python11.sh index e86d30e..a22826c 100755 --- a/t/python11.sh +++ b/t/python11.sh @@ -19,6 +19,9 @@ # Python is not required for this test. . ./defs || exit 1 +# We don't want to allow user overrides in this test. +PYTHON=; unset PYTHON + cat >>configure.ac <<'EOF' m4_define([_AM_PYTHON_INTERPRETER_LIST], [IShouldNotExist1 IShouldNotExist2]) AM_PATH_PYTHON -- 1.8.0.209.gf3828dc From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 17:14:13 2012 Received: (at control) by debbugs.gnu.org; 19 Nov 2012 22:14:13 +0000 Received: from localhost ([127.0.0.1]:55725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbY-0003Q0-9f for submit@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:12 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:37149) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TaZbW-0003My-I4 for control@debbugs.gnu.org; Mon, 19 Nov 2012 17:14:10 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so3445250eek.3 for ; Mon, 19 Nov 2012 14:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=70v0AzMIRcYRiY+xoXE9qqqP50vrgfJ1HUdRb1Kf4yE=; b=Qs1jWsmxi1oqGodpG/axa3oiiOyRzeOozMILa1rX+W8AfmwyzGyJXoT18Uz6yXy7aL C8Ki23j2XYqbs4BSZjOojd6OawwRN26daBzCHKiax8qLc7CbvWDJi18uraACPXfbHn/G NRzc6cUQJ9+YN2wkcRfce5ISUwd0vQVIfIQpX30v3vqhjfG1ldUumHA5z/F4S64hJtby Z/B9UEoTocWRnzrhn43kbnx1q1hg77Q1BL3/UDYvVd8EExmQBXkea6+1fKeHfRWI/g5i BmNzbh9UJsXqoclKlCm5tbHlarKL1DgZEXT463uPDPcW6n/VN5a2+PAMhoW8eOFtvv4E tkZA== Received: by 10.14.221.9 with SMTP id q9mr28148570eep.3.1353363184738; Mon, 19 Nov 2012 14:13:04 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id 42sm26691061eee.0.2012.11.19.14.13.02 (version=SSLv3 cipher=OTHER); Mon, 19 Nov 2012 14:13:04 -0800 (PST) Message-ID: <50AAAEEA.4000105@gmail.com> Date: Mon, 19 Nov 2012 23:12:58 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: 8847 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) tags 8847 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 08:24:34 2012 Received: (at 8847-done) by debbugs.gnu.org; 21 Nov 2012 13:24:34 +0000 Received: from localhost ([127.0.0.1]:58325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAI6-0007Fu-DZ for submit@debbugs.gnu.org; Wed, 21 Nov 2012 08:24:34 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:60598) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAI3-0007Fm-Ad for 8847-done@debbugs.gnu.org; Wed, 21 Nov 2012 08:24:32 -0500 Received: by mail-bk0-f44.google.com with SMTP id w11so3159701bku.3 for <8847-done@debbugs.gnu.org>; Wed, 21 Nov 2012 05:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=RT3iedNzB+iwMagNimdV18HcUHbzHPw8XYTTtmzf8sg=; b=WieQkE0jh+a5AQMkbA8/VP9wmZ1qwQdDH/bKWKfXyv2UGmuMbGDm1IieRguP7NrxrV BijAdyl05OZzicvpziMnXketXO08MOzlLETOvNhkF6D4ToclYuDKPHqnm+fkSTkOYosp KNHFmHaLAB5fsXcQNQR+bZh3KmL0uBg657A/VsHaFXMxfSB7yGQwVy1ZpnL6SgaDnVBn OWarNFvwhiMMtYdKbv7ssUraE4R1apWq5MEvbtfyp9nVIGTONmABvgITTGe25xy3hDtn lycCQJYb00BURkHtz+Uf3IzdSs61ytM944RirDvD5DO0QbMSIyDhAIQWeZO+DU7RrVYL +vfA== Received: by 10.204.147.143 with SMTP id l15mr316950bkv.28.1353504195545; Wed, 21 Nov 2012 05:23:15 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id k21sm124600bkv.1.2012.11.21.05.23.13 (version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:23:14 -0800 (PST) Message-ID: <50ACD5BF.4050606@gmail.com> Date: Wed, 21 Nov 2012 14:23:11 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: automake-patches@gnu.org Subject: Re: [PATCH 0/8] tests: support for PEP-3147, and testsuite fixes References: <50AAADC0.7000104@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8847-done Cc: yselkowitz@users.sourceforge.net, 8847-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 11/19/2012 11:12 PM, Stefano Lattarini wrote: > Original patch: > > > Yaakov Selkowitz (1): > python: improve support for modern python (CPython 3.2 and PyPy) > > Stefano Lattarini (7): > news: document fix for bug#8847 (PEP-3147, __pycache__) > tests: typofix in message > tests: honour $PYTHON override > tests: improve a comment > python: uninstall cater to PEP-3147 > python tests: support PEP-3147 installation layout > tests: fix a spurious failure when $PYTHON is in the environment > > NEWS | 3 ++ > lib/am/python.am | 30 ++++++++++--- > lib/py-compile | 18 ++++++-- > m4/python.m4 | 2 +- > t/ax/am-test-lib.sh | 66 ++++++++++++++++++++++++++-- > t/list-of-tests.mk | 1 - > t/nobase-python.sh | 50 +++++++++++---------- > t/py-compile-basedir.sh | 18 +++++--- > t/py-compile-basic.sh | 19 +++++--- > t/py-compile-basic2.sh | 70 ----------------------------- > t/py-compile-destdir.sh | 22 ++++++---- > t/py-compile-option-terminate.sh | 20 ++++----- > t/python-pr10995.sh | 8 ++-- > t/python-too-old.sh | 3 +- > t/python-vars.sh | 2 - > t/python-virtualenv.sh | 95 +++++++++++++++++++++++----------------- > t/python10.sh | 36 +++++++-------- > t/python11.sh | 3 ++ > t/python12.sh | 14 +++--- > t/python3.sh | 6 +-- > 20 files changed, 272 insertions(+), 214 deletions(-) > delete mode 100755 t/py-compile-basic2.sh > I've pushed this series to maint. Will soon merge into master as well. I'm thus closing automake bug#8847. Regards, Stefano From unknown Fri Aug 15 14:45:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 20 Dec 2012 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator