[arch-commits] Commit in python-ply/repos (4 files)

Felix Yan fyan at archlinux.org
Sat Sep 19 10:33:28 UTC 2015


    Date: Saturday, September 19, 2015 @ 12:33:28
  Author: fyan
Revision: 246599

archrelease: copy trunk to staging-any

Added:
  python-ply/repos/staging-any/
  python-ply/repos/staging-any/LICENSE
    (from rev 246598, python-ply/trunk/LICENSE)
  python-ply/repos/staging-any/PKGBUILD
    (from rev 246598, python-ply/trunk/PKGBUILD)
  python-ply/repos/staging-any/python-3.5.patch
    (from rev 246598, python-ply/trunk/python-3.5.patch)

------------------+
 LICENSE          |   28 ++++++
 PKGBUILD         |   58 ++++++++++++++
 python-3.5.patch |  216 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 302 insertions(+)

Copied: python-ply/repos/staging-any/LICENSE (from rev 246598, python-ply/trunk/LICENSE)
===================================================================
--- staging-any/LICENSE	                        (rev 0)
+++ staging-any/LICENSE	2015-09-19 10:33:28 UTC (rev 246599)
@@ -0,0 +1,28 @@
+Copyright (C) 2001-2015,
+David M. Beazley (Dabeaz LLC)
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.  
+* Redistributions in binary form must reproduce the above copyright notice, 
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.  
+* Neither the name of the David Beazley or Dabeaz LLC may be used to
+  endorse or promote products derived from this software without
+  specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copied: python-ply/repos/staging-any/PKGBUILD (from rev 246598, python-ply/trunk/PKGBUILD)
===================================================================
--- staging-any/PKGBUILD	                        (rev 0)
+++ staging-any/PKGBUILD	2015-09-19 10:33:28 UTC (rev 246599)
@@ -0,0 +1,58 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Alexander Rødseth <rodseth at gmail.com>
+# Contributor: Marcin "avalan" Falkiewicz <avalatron at gmail.com>
+# Contributor: C Anthony Risinger <anthony at xtfx.me>
+
+pkgbase=python-ply
+pkgname=(python-ply python2-ply)
+pkgver=3.7
+pkgrel=2
+pkgdesc='Implementation of lex and yacc parsing tools'
+arch=('any')
+url='http://www.dabeaz.com/ply/'
+license=('BSD')
+makedepends=('python-setuptools' 'python2-setuptools')
+source=("${url}ply-$pkgver.tar.gz"
+        LICENSE
+        python-3.5.patch)
+sha256sums=('f85fb7b44c1c9a04873e6d76fa2c2eef43f2cfd81468aa714a9c63af7ae0af80'
+            '87c20dd0a774f4d4ff837b4f1555f7eb1ed1b8dc1e3223cd105e5c1e282d62bf'
+            'b7969d290e659d9756a2b0ad3b19481a4b32e1ec79590db1c7ab64bcc6519029')
+
+prepare() {
+  # https://github.com/dabeaz/ply/pull/78
+  (cd ply-$pkgver; patch -p1 -i ../python-3.5.patch)
+
+  cp -a ply-$pkgver{,-py2}
+}
+
+check() {
+  cd "ply-$pkgver/test"
+  python testlex.py
+  python testyacc.py
+
+  cd "$srcdir/ply-$pkgver-py2/test"
+  python2 testlex.py
+  python2 testyacc.py
+}
+
+package_python-ply() {
+  depends=('python')
+
+  cd "ply-$pkgver"
+  python setup.py install --root="$pkgdir"
+
+  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_python2-ply() {
+  depends=('python2')
+
+  cd "ply-$pkgver-py2"
+  python2 setup.py install --root="$pkgdir"
+
+  install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: python-ply/repos/staging-any/python-3.5.patch (from rev 246598, python-ply/trunk/python-3.5.patch)
===================================================================
--- staging-any/python-3.5.patch	                        (rev 0)
+++ staging-any/python-3.5.patch	2015-09-19 10:33:28 UTC (rev 246599)
@@ -0,0 +1,216 @@
+From 1186219ceece79c1faa55a8dce31cfb235ccfb13 Mon Sep 17 00:00:00 2001
+From: Barry Warsaw <barry at python.org>
+Date: Mon, 14 Sep 2015 15:38:42 -0400
+Subject: [PATCH] Fixes for Python 3.5 compatibility.
+
+---
+ test/testlex.py | 77 +++++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 47 insertions(+), 30 deletions(-)
+
+diff --git a/test/testlex.py b/test/testlex.py
+index fd5002e..3880f6f 100755
+--- a/test/testlex.py
++++ b/test/testlex.py
+@@ -16,14 +16,22 @@
+ 
+ import ply.lex
+ 
+-def make_pymodule_path(filename):
++try:
++    from importlib.util import cache_from_source
++except ImportError:
++    # Python 2.7, but we don't care.
++    cache_from_source = None
++
++
++def make_pymodule_path(filename, optimization=None):
+     path = os.path.dirname(filename)
+     file = os.path.basename(filename)
+     mod, ext = os.path.splitext(file)
+ 
+-    if sys.hexversion >= 0x3040000:
+-        import importlib.util
+-        fullpath = importlib.util.cache_from_source(filename, ext=='.pyc')
++    if sys.hexversion >= 0x3050000:
++        fullpath = cache_from_source(filename, optimization=optimization)
++    elif sys.hexversion >= 0x3040000:
++        fullpath = cache_from_source(filename, ext=='.pyc')
+     elif sys.hexversion >= 0x3020000:
+         import imp
+         modname = mod+"."+imp.get_tag()+ext
+@@ -32,11 +40,12 @@ def make_pymodule_path(filename):
+         fullpath = filename
+     return fullpath
+ 
+-def pymodule_out_exists(filename):
+-    return os.path.exists(make_pymodule_path(filename))
++def pymodule_out_exists(filename, optimization=None):
++    return os.path.exists(make_pymodule_path(filename,
++                                             optimization=optimization))
+ 
+-def pymodule_out_remove(filename):
+-    os.remove(make_pymodule_path(filename))
++def pymodule_out_remove(filename, optimization=None):
++    os.remove(make_pymodule_path(filename, optimization=optimization))
+ 
+ def implementation():
+     if platform.system().startswith("Java"):
+@@ -156,8 +165,12 @@ def test_lex_ignore2(self):
+     def test_lex_re1(self):
+         self.assertRaises(SyntaxError,run_import,"lex_re1")
+         result = sys.stderr.getvalue()
++        if sys.hexversion < 0x3050000:
++            msg = "Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis\n"
++        else:
++            msg = "Invalid regular expression for rule 't_NUMBER'. missing ), unterminated subpattern at position 0"
+         self.assert_(check_expected(result,
+-                                    "Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis\n",
++                                    msg,
+                                     contains=True))
+ 
+     def test_lex_re2(self):
+@@ -173,10 +186,15 @@ def test_lex_re3(self):
+ #                                    "Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n"
+ #                                    "Make sure '#' in rule 't_POUND' is escaped with '\\#'\n"))
+ 
++        if sys.hexversion < 0x3050000:
++            msg = ("Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n"
++                   "Make sure '#' in rule 't_POUND' is escaped with '\\#'\n")
++        else:
++            msg = ("Invalid regular expression for rule 't_POUND'. missing ), unterminated subpattern at position 0\n"
++                   "ERROR: Make sure '#' in rule 't_POUND' is escaped with '\#'")
+         self.assert_(check_expected(result,
+-                                    "Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n"
+-                                    "Make sure '#' in rule 't_POUND' is escaped with '\\#'\n",
+-                                    contains=True))
++                                    msg,
++                                    contains=True), result)
+ 
+     def test_lex_rule1(self):
+         self.assertRaises(SyntaxError,run_import,"lex_rule1")
+@@ -365,7 +383,6 @@ def test_lex_optimize(self):
+                                     "(NUMBER,4,1,2)\n"))
+         self.assert_(os.path.exists("lextab.py"))
+ 
+-
+         p = subprocess.Popen([sys.executable,'-O','lex_optimize.py'],
+                              stdout=subprocess.PIPE)
+         result = p.stdout.read()
+@@ -375,8 +392,8 @@ def test_lex_optimize(self):
+                                     "(PLUS,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("lextab.pyo"))
+-            pymodule_out_remove("lextab.pyo")
++            self.assert_(pymodule_out_exists("lextab.pyo", 1))
++            pymodule_out_remove("lextab.pyo", 1)
+ 
+         p = subprocess.Popen([sys.executable,'-OO','lex_optimize.py'],
+                              stdout=subprocess.PIPE)
+@@ -387,7 +404,7 @@ def test_lex_optimize(self):
+                                     "(NUMBER,4,1,2)\n"))
+ 
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("lextab.pyo"))
++            self.assert_(pymodule_out_exists("lextab.pyo", 2))
+         try:
+             os.remove("lextab.py")
+         except OSError:
+@@ -397,7 +414,7 @@ def test_lex_optimize(self):
+         except OSError:
+             pass
+         try:
+-            pymodule_out_remove("lextab.pyo")
++            pymodule_out_remove("lextab.pyo", 2)
+         except OSError:
+             pass
+ 
+@@ -430,8 +447,8 @@ def test_lex_optimize2(self):
+                                     "(PLUS,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("opt2tab.pyo"))
+-            pymodule_out_remove("opt2tab.pyo")
++            self.assert_(pymodule_out_exists("opt2tab.pyo", 1))
++            pymodule_out_remove("opt2tab.pyo", 1)
+         p = subprocess.Popen([sys.executable,'-OO','lex_optimize2.py'],
+                              stdout=subprocess.PIPE)
+         result = p.stdout.read()
+@@ -440,7 +457,7 @@ def test_lex_optimize2(self):
+                                     "(PLUS,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("opt2tab.pyo"))
++            self.assert_(pymodule_out_exists("opt2tab.pyo", 2))
+         try:
+             os.remove("opt2tab.py")
+         except OSError:
+@@ -450,7 +467,7 @@ def test_lex_optimize2(self):
+         except OSError:
+             pass
+         try:
+-            pymodule_out_remove("opt2tab.pyo")
++            pymodule_out_remove("opt2tab.pyo", 2)
+         except OSError:
+             pass
+ 
+@@ -480,8 +497,8 @@ def test_lex_optimize3(self):
+                                     "(PLUS,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo"))
+-            pymodule_out_remove("lexdir/sub/calctab.pyo")
++            self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo", 1))
++            pymodule_out_remove("lexdir/sub/calctab.pyo", 1)
+ 
+         p = subprocess.Popen([sys.executable,'-OO','lex_optimize3.py'],
+                              stdout=subprocess.PIPE)
+@@ -491,7 +508,7 @@ def test_lex_optimize3(self):
+                                     "(PLUS,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo"))
++            self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo", 2))
+         try:
+             shutil.rmtree("lexdir")
+         except OSError:
+@@ -526,8 +543,8 @@ def test_lex_opt_alias(self):
+                                     "(+,'+',1,1)\n"
+                                     "(NUMBER,4,1,2)\n"))
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("aliastab.pyo"))
+-            pymodule_out_remove("aliastab.pyo")
++            self.assert_(pymodule_out_exists("aliastab.pyo", 1))
++            pymodule_out_remove("aliastab.pyo", 1)
+ 
+         p = subprocess.Popen([sys.executable,'-OO','lex_opt_alias.py'],
+                              stdout=subprocess.PIPE)
+@@ -538,7 +555,7 @@ def test_lex_opt_alias(self):
+                                     "(NUMBER,4,1,2)\n"))
+ 
+         if test_pyo:
+-            self.assert_(pymodule_out_exists("aliastab.pyo"))
++            self.assert_(pymodule_out_exists("aliastab.pyo", 2))
+         try:
+             os.remove("aliastab.py")
+         except OSError:
+@@ -548,7 +565,7 @@ def test_lex_opt_alias(self):
+         except OSError:
+             pass
+         try:
+-            pymodule_out_remove("aliastab.pyo")
++            pymodule_out_remove("aliastab.pyo", 2)
+         except OSError:
+             pass
+ 
+@@ -593,8 +610,8 @@ def test_lex_many_tokens(self):
+                                         "(TOK999,'TOK999:',1,47)\n"
+                                         ))
+ 
+-            self.assert_(pymodule_out_exists("manytab.pyo"))
+-            pymodule_out_remove("manytab.pyo")
++            self.assert_(pymodule_out_exists("manytab.pyo", 1))
++            pymodule_out_remove("manytab.pyo", 1)
+         try:
+             os.remove("manytab.py")
+         except OSError:



More information about the arch-commits mailing list