Your message dated Thu, 16 Oct 2014 06:35:39 +0000
with message-id <[email protected]>
and subject line Bug#734366: fixed in ply 3.4-4
has caused the Debian Bug report #734366,
regarding ply: Test suite enablement/python >= 3.3 fixes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
734366: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734366
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ply
Version: 3.4-3
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu trusty ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  * Enable test suite as part of package build:
    - d/rules: Execute lex and yacc tests for all python versions.
    - d/p/000*.patch: Cherry picked fixes from upstream VCS to resolve
      compatibility issues with Python >= 3.3.

Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 
'trusty'), (100, 'trusty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12.0-7-generic (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- debian/patches/0001-Fixed-yacc-tests-to-account-for-dict-hash-key-random.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/0001-Fixed-yacc-tests-to-account-for-dict-hash-key-random.patch	2014-01-06 12:11:42 +0000
@@ -0,0 +1,98 @@
+From 02030ad24d923f16f401744a608573365b2e5542 Mon Sep 17 00:00:00 2001
+From: David Beazley <[email protected]>
+Date: Tue, 21 May 2013 20:14:04 -0500
+Subject: [PATCH 1/3] Fixed yacc tests to account for dict hash key
+ randomization
+
+---
+ test/testlex.py    |  3 +--
+ test/testyacc.py   | 24 +++++++++++++++++++++---
+ test/yacc_prec1.py |  4 ++--
+ 3 files changed, 24 insertions(+), 7 deletions(-)
+
+diff --git a/test/testlex.py b/test/testlex.py
+index 1f7dd1b..e436781 100755
+--- a/test/testlex.py
++++ b/test/testlex.py
+@@ -34,7 +34,7 @@ def pymodule_out_exists(filename):
+ def pymodule_out_remove(filename):
+     os.remove(make_pymodule_path(filename))
+ 
+-def check_expected(result,expected):
++def check_expected(result, expected):
+     if sys.version_info[0] >= 3:
+         if isinstance(result,str):
+             result = result.encode('ascii')
+@@ -43,7 +43,6 @@ def check_expected(result,expected):
+     resultlines = result.splitlines()
+     expectedlines = expected.splitlines()
+ 
+-
+     if len(resultlines) != len(expectedlines):
+         return False
+ 
+diff --git a/test/testyacc.py b/test/testyacc.py
+index 2b06b44..4462201 100644
+--- a/test/testyacc.py
++++ b/test/testyacc.py
+@@ -34,7 +34,7 @@ def pymodule_out_exists(filename):
+ def pymodule_out_remove(filename):
+     os.remove(make_pymodule_path(filename))
+ 
+-
++# Old implementation (not safe for Python 3.3)
+ def check_expected(result,expected):
+     resultlines = []
+     for line in result.splitlines():
+@@ -52,6 +52,26 @@ def check_expected(result,expected):
+             return False
+     return True
+ 
++# Check the output to see if it contains all of a set of expected output lines.
++# This alternate implementation looks weird, but is needed to properly handle
++# some variations in error message order that occurs due to dict hash table
++# randomization that was introduced in Python 3.3
++def check_expected(result, expected):
++    resultlines = set()
++    for line in result.splitlines():
++        if line.startswith("WARNING: "):
++            line = line[9:]
++        elif line.startswith("ERROR: "):
++            line = line[7:]
++        resultlines.add(line)
++
++    # Selectively remove expected lines from the output
++    for eline in expected.splitlines():
++        resultlines = set(line for line in resultlines if not line.endswith(eline))
++
++    # Return True if no result lines remain
++    return not bool(resultlines)
++
+ def run_import(module):
+     code = "import "+module
+     exec(code)
+@@ -342,6 +362,4 @@ class YaccErrorWarningTests(unittest.TestCase):
+                                     "Precedence rule 'left' defined for unknown symbol '/'\n"
+                                     ))
+ 
+-
+-            
+ unittest.main()
+diff --git a/test/yacc_prec1.py b/test/yacc_prec1.py
+index 2ca6afc..99fcd90 100644
+--- a/test/yacc_prec1.py
++++ b/test/yacc_prec1.py
+@@ -12,8 +12,8 @@ from calclex import tokens
+ 
+ # Parsing rules
+ precedence = (
+-    ('left','+','-'),
+-    ('left','*','/'),
++    ('left', '+', '-'),
++    ('left', '*', '/'),
+     ('right','UMINUS'),
+     )
+ 
+-- 
+1.8.5.2
+

=== added file 'debian/patches/0002-More-test-fixes.patch'
--- debian/patches/0002-More-test-fixes.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/0002-More-test-fixes.patch	2014-01-06 12:11:42 +0000
@@ -0,0 +1,55 @@
+From 55ff3fb3608d6112b315c85acd5b4348aaa32e12 Mon Sep 17 00:00:00 2001
+From: David Beazley <[email protected]>
+Date: Tue, 21 May 2013 21:26:59 -0500
+Subject: [PATCH 2/3] More test fixes
+
+---
+ ply/yacc.py      | 8 ++++++--
+ test/testyacc.py | 5 +++++
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/ply/yacc.py b/ply/yacc.py
+index e9f5c65..a29c645 100644
+--- a/ply/yacc.py
++++ b/ply/yacc.py
+@@ -195,8 +195,12 @@ class YaccProduction:
+         self.lexer = None
+         self.parser= None
+     def __getitem__(self,n):
+-        if n >= 0: return self.slice[n].value
+-        else: return self.stack[n].value
++        if isinstance(n, slice):
++            return [s.value for s in self.slice[n]]
++        elif n >= 0: 
++            return self.slice[n].value
++        else: 
++            return self.stack[n].value
+ 
+     def __setitem__(self,n,v):
+         self.slice[n].value = v
+diff --git a/test/testyacc.py b/test/testyacc.py
+index 4462201..86c991a 100644
+--- a/test/testyacc.py
++++ b/test/testyacc.py
+@@ -9,6 +9,7 @@ except ImportError:
+ import sys
+ import os
+ import warnings
++import re
+ 
+ sys.path.insert(0,"..")
+ sys.tracebacklimit = 0
+@@ -57,6 +58,10 @@ def check_expected(result,expected):
+ # some variations in error message order that occurs due to dict hash table
+ # randomization that was introduced in Python 3.3
+ def check_expected(result, expected):
++    # Normalize 'state n' text to account for randomization effects in Python 3.3
++    expected = re.sub(r' state \d+', 'state <n>', expected)
++    result = re.sub(r' state \d+', 'state <n>', result)
++
+     resultlines = set()
+     for line in result.splitlines():
+         if line.startswith("WARNING: "):
+-- 
+1.8.5.2
+

=== added file 'debian/patches/0003-Fixed-lexer-line-tracking.patch'
--- debian/patches/0003-Fixed-lexer-line-tracking.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/0003-Fixed-lexer-line-tracking.patch	2014-01-06 12:11:42 +0000
@@ -0,0 +1,25 @@
+From 0c0b575b529d4fe6dc0be179e701a302f27bc127 Mon Sep 17 00:00:00 2001
+From: David Beazley <[email protected]>
+Date: Thu, 26 Apr 2012 10:15:09 -0500
+Subject: [PATCH 3/3] Fixed lexer line tracking.
+
+---
+ test/calclex.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/calclex.py b/test/calclex.py
+index 67d245f..302f0b0 100644
+--- a/test/calclex.py
++++ b/test/calclex.py
+@@ -36,7 +36,7 @@ t_ignore = " \t"
+ 
+ def t_newline(t):
+     r'\n+'
+-    t.lineno += t.value.count("\n")
++    t.lexer.lineno += t.value.count("\n")
+     
+ def t_error(t):
+     print("Illegal character '%s'" % t.value[0])
+-- 
+1.8.5.2
+

=== modified file 'debian/patches/series'
--- debian/patches/series	2011-06-12 20:27:05 +0000
+++ debian/patches/series	2014-01-06 12:11:52 +0000
@@ -1,2 +1,5 @@
 01_fix-lex-tabversion.patch
 02_relax-lex-tabversion-check.patch
+0001-Fixed-yacc-tests-to-account-for-dict-hash-key-random.patch
+0002-More-test-fixes.patch
+0003-Fixed-lexer-line-tracking.patch

=== modified file 'debian/rules'
--- debian/rules	2011-07-04 17:37:14 +0000
+++ debian/rules	2014-01-06 11:28:08 +0000
@@ -10,6 +10,15 @@
 DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed \
 	--install-layout=deb
 
+PYVERSIONS := $(shell pyversions -s)
+PY3VERSIONS := $(shell py3versions -s)
+
+build:
+	for pyver in $(PYVERSIONS) $(PY3VERSIONS); do \
+		echo "Testing with $$pyver"; \
+		(cd test && $$pyver testlex.py && $$pyver testyacc.py && ./cleanup.sh;)\
+	done
+
 binary-install/python-ply::
 	pod2man debian/dh_python-ply > dh_python-ply.1
 	dh_installman -p python-ply dh_python-ply.1


--- End Message ---
--- Begin Message ---
Source: ply
Source-Version: 3.4-4

We believe that the bug you reported is fixed in the latest version of
ply, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Arnaud Fontaine <[email protected]> (supplier of updated ply package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 16 Oct 2014 14:33:15 +0900
Source: ply
Binary: python-ply python3-ply python-ply-doc
Architecture: source all
Version: 3.4-4
Distribution: unstable
Urgency: medium
Maintainer: Arnaud Fontaine <[email protected]>
Changed-By: Arnaud Fontaine <[email protected]>
Description:
 python-ply - Lex and Yacc implementation for Python2
 python-ply-doc - Lex and Yacc implementation for Python (documentation)
 python3-ply - Lex and Yacc implementation for Python3
Closes: 714099 729398 734366
Changes:
 ply (3.4-4) unstable; urgency=medium
 .
   [ Jakub Wilk ]
   * Use canonical URIs for Vcs-* fields.
 .
   [ Arnaud Fontaine ]
   * Remove Gustavo Franco from Uploaders as he is retiring. Closes: #729398.
   * Enable tests during package build. Thanks to James Page. Closes: #734366.
     + d/rules: Execute lex and yacc tests for all python versions.
     + d/p/*.patch: Cherry picked fixes from upstream VCS to resolve
       compatibility issues with Python >= 3.3.
   * d/control: bump Standards-Version to 3.9.6. No changes needed.
   * Add dh_python3-ply to generate proper package Depends for Python3.
     Closes: #714099.
   * d/patches/*: remove meaningless (at least with quilt) numbering prefix.
Checksums-Sha1:
 5eddd5d4edd05d70dd73babadc6a7a463f8abf08 2135 ply_3.4-4.dsc
 2d21e5ad527230a513a5115d3a357d7edfe1ac29 8396 ply_3.4-4.debian.tar.xz
 296c669d8454f80759c400f24835602e1aa7d7d6 62890 python-ply_3.4-4_all.deb
 bf8078ccd92bfc512b5f947758a8e6c5aff584b0 60536 python3-ply_3.4-4_all.deb
 00105e7cda41894c2b5986d9a73cbb076da8a142 79642 python-ply-doc_3.4-4_all.deb
Checksums-Sha256:
 02120cc8a612f71ea68a5dafcf48faaaeec9b21835ad638e96ffbf87de804e09 2135 
ply_3.4-4.dsc
 2fcb0aa8f26a09bf5112fcc4612639e4f787d87ab0996ae54fcd17b3d106a64e 8396 
ply_3.4-4.debian.tar.xz
 437ad1eb5646f960a15bf7c9eddebb28c4b34a85d1a768df27a2c0b0d45379e9 62890 
python-ply_3.4-4_all.deb
 651f769c7530f0a8bf870ce02ff5e15bb3f713f7022167854c1a63865a549408 60536 
python3-ply_3.4-4_all.deb
 9ef36482bdb3bdbf056653b436018387949ee77306ef97a61565be6b0964a231 79642 
python-ply-doc_3.4-4_all.deb
Files:
 4883fdcd801234b011aed32471eaae64 2135 python optional ply_3.4-4.dsc
 f30b4311cea3618a39957f2801cde077 8396 python optional ply_3.4-4.debian.tar.xz
 a9c5af2571e468f58beec6b629199a35 62890 python optional python-ply_3.4-4_all.deb
 c553e57ace86858af861d4b30687686c 60536 python optional 
python3-ply_3.4-4_all.deb
 8e632d2fce01b8de82e4dd0e8bc92b8f 79642 doc optional 
python-ply-doc_3.4-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJUP2OiAAoJEDZ6q2L9ANPZEBEP/jAAdTLlQnz4EBgjOGESgmph
gr2DDy/03KkrVhSKoDwkTAxN8VLExcksfMuEkm/4rPLcBfQEzc0Q1ozo32sIDWag
deEXBdxjkbFoFwX2kaSNzK0IeiEx4WaQlkNMmHzjs6jvo9ErgoX2vNc+1fIh1kGb
ngzcwOaHu+ZzLDCTPn3Td0H52DKW4kuvB5WuKv45niChGvD7gHdC/q7xgdLce1f6
5DX6VNWiTwZZ7PB6vrYYkoMZoevo0ZbqdFBDaD6KmSEWRM9t6laz5d+lgGqkKFU1
6Zf5muOncLDzTs7y7PL822mETyVUXzrPsxU938zBRL1DRHaJUN0kTyaTV9gEkc2H
pxqXPVKZN78NE6FZmrerqYTqoBLN/jXvOwbivlR1FIqLLlTQ9jxtZxe7JOrGU44E
zbk+nlvMdavT/EyOzO9Gs9A5sDn2W6kRPFBB0fWSD5wSW3+J1gJpmPQ/Wxd6jKgW
ijj97zo54zHxFZ/r+JscQP7qVyOe2ilkZYjHOmhYmCBLhQCnhd5heoe/X5PpjxmJ
5rIR7nV6v4ZrcGHyrfDL/7+tR6pTqCaulF2J9+VFrDumSVOL2Rm1y8SRsgv6F2ua
yC6FQPJ+fj9JkWwqp+aaAppH1gHo4YAutCruWrPsZZ+KoCKUijW+wg0jgJREKC/J
x2/ycS10n+ZJ2uo/IVlQ
=n6xs
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to