[arch-commits] Commit in python-astor/repos (3 files)

Evangelos Foutras foutrelis at archlinux.org
Mon Jul 2 10:17:55 UTC 2018


    Date: Monday, July 2, 2018 @ 10:17:55
  Author: foutrelis
Revision: 349475

archrelease: copy trunk to community-staging-any

Added:
  python-astor/repos/community-staging-any/
  python-astor/repos/community-staging-any/PKGBUILD
    (from rev 349474, python-astor/trunk/PKGBUILD)
  python-astor/repos/community-staging-any/do-not-use-async-as-a-keyword-argument.patch
    (from rev 349474, python-astor/trunk/do-not-use-async-as-a-keyword-argument.patch)

----------------------------------------------+
 PKGBUILD                                     |   56 +++++++++++
 do-not-use-async-as-a-keyword-argument.patch |  123 +++++++++++++++++++++++++
 2 files changed, 179 insertions(+)

Copied: python-astor/repos/community-staging-any/PKGBUILD (from rev 349474, python-astor/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2018-07-02 10:17:55 UTC (rev 349475)
@@ -0,0 +1,56 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-astor
+pkgname=('python-astor' 'python2-astor')
+pkgver=0.6.2
+pkgrel=2
+pkgdesc="Read/rewrite/write Python ASTs"
+arch=('any')
+license=('BSD')
+url="http://astor.rtfd.org/"
+makedepends=('python-setuptools' 'python2-setuptools')
+checkdepends=('python-nose' 'python2-nose' 'python2-unittest2')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz"
+        do-not-use-async-as-a-keyword-argument.patch)
+sha512sums=('ccda3f0432522be1f8ada5589e56a7cb6da83a29fb8d9e0f4167fd492d7d6f55c0f4ed18af81d60340147894978b6ee8efb24edb68b92cdd78d053d5d53c6d66'
+            'ebe7126a25694b3b7df65fa5311632cec973802dd38a6d7a57c415f4b3925a1177c4d3f702e1d49b4c203296ff2fd09b4992a36c26084bb1939cd4593d903a20')
+
+prepare() {
+  # https://github.com/berkerpeksag/astor/issues/86
+  patch -d astor-$pkgver -Np1 < do-not-use-async-as-a-keyword-argument.patch
+  cp -a astor-$pkgver{,-py2}
+}
+
+build() {
+  cd "$srcdir"/astor-$pkgver
+  python setup.py build
+
+  cd "$srcdir"/astor-$pkgver-py2
+  python2 setup.py build
+}
+
+check() {
+  # https://github.com/berkerpeksag/astor/issues/89
+  cd "$srcdir"/astor-$pkgver
+  nosetests3 || warning "Tests failed"
+
+  cd "$srcdir"/astor-$pkgver-py2
+  nosetests2
+}
+
+package_python-astor() {
+  depends=('python')
+
+  cd astor-$pkgver
+  python setup.py install --root="$pkgdir" --optimize=1
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+package_python2-astor() {
+  depends=('python2')
+
+  cd astor-$pkgver-py2
+  python2 setup.py install --root="$pkgdir" --optimize=1
+  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}

Copied: python-astor/repos/community-staging-any/do-not-use-async-as-a-keyword-argument.patch (from rev 349474, python-astor/trunk/do-not-use-async-as-a-keyword-argument.patch)
===================================================================
--- community-staging-any/do-not-use-async-as-a-keyword-argument.patch	                        (rev 0)
+++ community-staging-any/do-not-use-async-as-a-keyword-argument.patch	2018-07-02 10:17:55 UTC (rev 349475)
@@ -0,0 +1,123 @@
+From fe1ef7f9d746847c157197e4cb2ab6505fe19faf Mon Sep 17 00:00:00 2001
+From: Berker Peksag <berker.peksag at gmail.com>
+Date: Fri, 23 Mar 2018 16:50:21 +0300
+Subject: [PATCH] Don't use 'async' as a keyword argument (#94)
+
+Fixes #86
+---
+ .travis.yml        |  2 ++
+ astor/code_gen.py  | 18 +++++++++---------
+ docs/changelog.rst | 21 +++++++++++++++++++++
+ 3 files changed, 32 insertions(+), 9 deletions(-)
+
+diff --git a/.travis.yml b/.travis.yml
+index 64bedd8..df42c87 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -9,9 +9,11 @@ python:
+   - 3.6
+   - pypy
+   - pypy3.3-5.2-alpha1
++  - 3.7-dev
+ matrix:
+   allow_failures:
+   - python: 2.6
++  - python: 3.7-dev
+ cache: pip
+ install:
+   - pip install tox-travis
+diff --git a/astor/code_gen.py b/astor/code_gen.py
+index 7c27f70..47d6acc 100644
+--- a/astor/code_gen.py
++++ b/astor/code_gen.py
+@@ -308,8 +308,8 @@ def visit_Expr(self, node):
+         self.statement(node)
+         self.generic_visit(node)
+ 
+-    def visit_FunctionDef(self, node, async=False):
+-        prefix = 'async ' if async else ''
++    def visit_FunctionDef(self, node, is_async=False):
++        prefix = 'async ' if is_async else ''
+         self.decorators(node, 1 if self.indentation else 2)
+         self.statement(node, '%sdef %s' % (prefix, node.name), '(')
+         self.visit_arguments(node.args)
+@@ -322,7 +322,7 @@ def visit_FunctionDef(self, node, async=False):
+ 
+     # introduced in Python 3.5
+     def visit_AsyncFunctionDef(self, node):
+-        self.visit_FunctionDef(node, async=True)
++        self.visit_FunctionDef(node, is_async=True)
+ 
+     def visit_ClassDef(self, node):
+         have_args = []
+@@ -364,24 +364,24 @@ def visit_If(self, node):
+                 self.else_body(else_)
+                 break
+ 
+-    def visit_For(self, node, async=False):
++    def visit_For(self, node, is_async=False):
+         set_precedence(node, node.target)
+-        prefix = 'async ' if async else ''
++        prefix = 'async ' if is_async else ''
+         self.statement(node, '%sfor ' % prefix,
+                        node.target, ' in ', node.iter, ':')
+         self.body_or_else(node)
+ 
+     # introduced in Python 3.5
+     def visit_AsyncFor(self, node):
+-        self.visit_For(node, async=True)
++        self.visit_For(node, is_async=True)
+ 
+     def visit_While(self, node):
+         set_precedence(node, node.test)
+         self.statement(node, 'while ', node.test, ':')
+         self.body_or_else(node)
+ 
+-    def visit_With(self, node, async=False):
+-        prefix = 'async ' if async else ''
++    def visit_With(self, node, is_async=False):
++        prefix = 'async ' if is_async else ''
+         self.statement(node, '%swith ' % prefix)
+         if hasattr(node, "context_expr"):  # Python < 3.3
+             self.visit_withitem(node)
+@@ -392,7 +392,7 @@ def visit_With(self, node, async=False):
+ 
+     # new for Python 3.5
+     def visit_AsyncWith(self, node):
+-        self.visit_With(node, async=True)
++        self.visit_With(node, is_async=True)
+ 
+     # new for Python 3.3
+     def visit_withitem(self, node):
+diff --git a/docs/changelog.rst b/docs/changelog.rst
+index 54bc9b7..fcfc2b8 100644
+--- a/docs/changelog.rst
++++ b/docs/changelog.rst
+@@ -2,6 +2,27 @@
+ Release Notes
+ =============
+ 
++0.7.0 - 2018-03-24
++------------------
++
++New features
++~~~~~~~~~~~~
++
++* Added initial support for Python 3.7.0.
++
++  Note that if you have a subclass of ``astor.code_gen.SourceGenerator``, you
++  may need to rename the keyword argument ``async`` of the following methods
++  to ``is_async``:
++
++  - ``visit_FunctionDef(..., is_async=False)``
++  - ``visit_For(..., is_async=False)``
++  - ``visit_With(..., is_async=False)``
++
++  (Reported and fixed by Berker Peksag in `Issue 86`_.)
++
++.. _`Issue 86`: https://github.com/berkerpeksag/astor/issues/86
++
++
+ 0.6.2 - 2017-11-11
+ ------------------
+ 



More information about the arch-commits mailing list