[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Tuesday, November 10, 2020 @ 04:01:42 Author: felixonmars Revision: 748376 upgpkg: python-astor 0.8.1-2: Python 3.9 rebuild Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Modified: PKGBUILD === --- PKGBUILD2020-11-10 04:01:41 UTC (rev 748375) +++ PKGBUILD2020-11-10 04:01:42 UTC (rev 748376) @@ -2,7 +2,7 @@ pkgname=python-astor pkgver=0.8.1 -pkgrel=1 +pkgrel=2 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD')
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Thursday, January 9, 2020 @ 00:23:17 Author: felixonmars Revision: 550937 upgpkg: python-astor 0.8.1-1 Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |8 1 file changed, 4 insertions(+), 4 deletions(-) Modified: PKGBUILD === --- PKGBUILD2020-01-09 00:22:57 UTC (rev 550936) +++ PKGBUILD2020-01-09 00:23:17 UTC (rev 550937) @@ -1,8 +1,8 @@ # Maintainer: Felix Yan pkgname=python-astor -pkgver=0.8 -pkgrel=3 +pkgver=0.8.1 +pkgrel=1 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD') @@ -9,9 +9,9 @@ url="https://astor.rtfd.org/; depends=('python') makedepends=('python-setuptools') -checkdepends=('python-nose') +checkdepends=('python-nose' 'python-tests') source=("$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz;) -sha512sums=('ca787234f9a9caae37633be289d6e980e7b44507d74306ad7a30f017442d6cf423748ef35465b7b5d12bdb84ce4594af801de39882f4c11c732dba4dc65ab667') +sha512sums=('8917898e284fb5e5855a05f8e3f1c8925c4128d2a87f67f0334914d4d3c54b53c4f0cadd04d632a7bcaf3438db7edf2d989b07a9576637c0dce6c16e85c60f83') build() { cd astor-$pkgver
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Thursday, October 31, 2019 @ 18:03:21 Author: felixonmars Revision: 521514 Python 3.8 rebuild Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Modified: PKGBUILD === --- PKGBUILD2019-10-31 18:02:39 UTC (rev 521513) +++ PKGBUILD2019-10-31 18:03:21 UTC (rev 521514) @@ -2,7 +2,7 @@ pkgname=python-astor pkgver=0.8 -pkgrel=2 +pkgrel=3 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD')
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Friday, October 25, 2019 @ 16:33:48 Author: foutrelis Revision: 519467 Python 3.8 rebuild Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Modified: PKGBUILD === --- PKGBUILD2019-10-25 16:33:47 UTC (rev 519466) +++ PKGBUILD2019-10-25 16:33:48 UTC (rev 519467) @@ -2,7 +2,7 @@ pkgname=python-astor pkgver=0.8 -pkgrel=1 +pkgrel=2 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD')
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Monday, June 17, 2019 @ 20:50:10 Author: arojas Revision: 482033 https Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Modified: PKGBUILD === --- PKGBUILD2019-06-17 20:49:36 UTC (rev 482032) +++ PKGBUILD2019-06-17 20:50:10 UTC (rev 482033) @@ -6,7 +6,7 @@ pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD') -url="http://astor.rtfd.org/; +url="https://astor.rtfd.org/; depends=('python') makedepends=('python-setuptools') checkdepends=('python-nose')
[arch-commits] Commit in python-astor/trunk (PKGBUILD string-newline.patch)
Date: Friday, May 31, 2019 @ 08:11:47 Author: felixonmars Revision: 475864 upgpkg: python-astor 0.8-1 Modified: python-astor/trunk/PKGBUILD Deleted: python-astor/trunk/string-newline.patch --+ PKGBUILD | 16 -- string-newline.patch | 56 - 2 files changed, 5 insertions(+), 67 deletions(-) Modified: PKGBUILD === --- PKGBUILD2019-05-31 07:35:39 UTC (rev 475863) +++ PKGBUILD2019-05-31 08:11:47 UTC (rev 475864) @@ -1,8 +1,8 @@ # Maintainer: Felix Yan pkgname=python-astor -pkgver=0.7.1 -pkgrel=2 +pkgver=0.8 +pkgrel=1 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD') @@ -10,15 +10,9 @@ depends=('python') makedepends=('python-setuptools') checkdepends=('python-nose') -source=("$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz; -string-newline.patch) -sha512sums=('02764e5751e4c4b0ffa83da262b87e0a6bf027461529a99d3ca01a415db0896754f2b3f278e8a28f9bce4972ee7a75eec4eec5ac47d1064e6d6656a007b38a64' - 'ad977606c1b0374dccece65a9743e875e250e86d923c987eee7babb09f1209a874a7b447f253e1666364da32e309579d261ac70cf32b3d909c9fe78501b19cb8') +source=("$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz;) +sha512sums=('ca787234f9a9caae37633be289d6e980e7b44507d74306ad7a30f017442d6cf423748ef35465b7b5d12bdb84ce4594af801de39882f4c11c732dba4dc65ab667') -prepare() { - patch -d astor-$pkgver -p1 -i ../string-newline.patch -} - build() { cd astor-$pkgver python setup.py build @@ -26,7 +20,7 @@ check() { cd astor-$pkgver - nosetests3 || warning "https://github.com/berkerpeksag/astor/issues/124; + nosetests3 || warning "https://github.com/berkerpeksag/astor/issues/146; } package() { Deleted: string-newline.patch === --- string-newline.patch2019-05-31 07:35:39 UTC (rev 475863) +++ string-newline.patch2019-05-31 08:11:47 UTC (rev 475864) @@ -1,56 +0,0 @@ -commit 33f0e57bc84f0cd5cdf994127d81c99f2a23f659 -Author: Felix Yan -Date: Wed Feb 20 01:56:35 2019 +0800 - -Fix string parsing with newline - -When looping over a joined str, if a node is ast.Str and the value is -just a newline "\n", the write() function adds an additional indentation -after it, which fails to represent the original string. By calling -self.result.append() here directly the issue is resolved. - -The added test could show the issue. With code_gen unmodifed, it fails -with the following error: - -``` -AssertionError: "if 1:\nx = f'{host}\\n\\t{port}\\n'" != "if -1:\nx = f'{host}\\n\\t{port}\\n'" - if 1: - - x = f'{host}\n\t{port}\n'? - - + x = f'{host}\n\t{port}\n' -``` - -Which is exactly the problem. - -This fixes parsing issues with many of Python 3.7's stdlib. - -diff --git a/astor/code_gen.py b/astor/code_gen.py -index 157d2cc..453d108 100644 a/astor/code_gen.py -+++ b/astor/code_gen.py -@@ -566,7 +566,7 @@ class SourceGenerator(ExplicitNodeVisitor): - def recurse(node): - for value in node.values: - if isinstance(value, ast.Str): --self.write(value.s) -+self.result.append(value.s) - elif isinstance(value, ast.FormattedValue): - with self.delimit('{}'): - self.visit(value.value) -diff --git a/tests/test_code_gen.py b/tests/test_code_gen.py -index 3a8be7b..0db4279 100644 a/tests/test_code_gen.py -+++ b/tests/test_code_gen.py -@@ -516,6 +516,11 @@ class CodegenTestCase(unittest.TestCase, Comparisons): - x = f"""{host}\n\t{port}\n""" - ''' - self.assertSrcRoundtripsGtVer(source, (3, 6)) -+source = ''' -+if 1: -+x = f'{host}\\n\\t{port}\\n' -+''' -+self.assertSrcRoundtripsGtVer(source, (3, 6)) - - def test_docstring_function(self): - source = '''
[arch-commits] Commit in python-astor/trunk (PKGBUILD string-newline.patch)
Date: Tuesday, February 19, 2019 @ 19:38:05 Author: felixonmars Revision: 434582 upgpkg: python-astor 0.7.1-2 remove python2 sibling Added: python-astor/trunk/string-newline.patch Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD | 43 - string-newline.patch | 56 + 2 files changed, 70 insertions(+), 29 deletions(-) Modified: PKGBUILD === --- PKGBUILD2019-02-19 19:33:48 UTC (rev 434581) +++ PKGBUILD2019-02-19 19:38:05 UTC (rev 434582) @@ -1,51 +1,36 @@ # Maintainer: Felix Yan -pkgbase=python-astor -pkgname=('python-astor' 'python2-astor') +pkgname=python-astor pkgver=0.7.1 -pkgrel=1 +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;) -sha512sums=('02764e5751e4c4b0ffa83da262b87e0a6bf027461529a99d3ca01a415db0896754f2b3f278e8a28f9bce4972ee7a75eec4eec5ac47d1064e6d6656a007b38a64') +depends=('python') +makedepends=('python-setuptools') +checkdepends=('python-nose') +source=("$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz; +string-newline.patch) +sha512sums=('02764e5751e4c4b0ffa83da262b87e0a6bf027461529a99d3ca01a415db0896754f2b3f278e8a28f9bce4972ee7a75eec4eec5ac47d1064e6d6656a007b38a64' + 'ad977606c1b0374dccece65a9743e875e250e86d923c987eee7babb09f1209a874a7b447f253e1666364da32e309579d261ac70cf32b3d909c9fe78501b19cb8') prepare() { - cp -a astor-$pkgver{,-py2} + patch -d astor-$pkgver -p1 -i ../string-newline.patch } build() { - cd "$srcdir"/astor-$pkgver + cd 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 + cd astor-$pkgver + nosetests3 || warning "https://github.com/berkerpeksag/astor/issues/124; } -package_python-astor() { - depends=('python') - +package() { 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 -} Added: string-newline.patch === --- string-newline.patch(rev 0) +++ string-newline.patch2019-02-19 19:38:05 UTC (rev 434582) @@ -0,0 +1,56 @@ +commit 33f0e57bc84f0cd5cdf994127d81c99f2a23f659 +Author: Felix Yan +Date: Wed Feb 20 01:56:35 2019 +0800 + +Fix string parsing with newline + +When looping over a joined str, if a node is ast.Str and the value is +just a newline "\n", the write() function adds an additional indentation +after it, which fails to represent the original string. By calling +self.result.append() here directly the issue is resolved. + +The added test could show the issue. With code_gen unmodifed, it fails +with the following error: + +``` +AssertionError: "if 1:\nx = f'{host}\\n\\t{port}\\n'" != "if +1:\nx = f'{host}\\n\\t{port}\\n'" + if 1: + - x = f'{host}\n\t{port}\n'? + + + x = f'{host}\n\t{port}\n' +``` + +Which is exactly the problem. + +This fixes parsing issues with many of Python 3.7's stdlib. + +diff --git a/astor/code_gen.py b/astor/code_gen.py +index 157d2cc..453d108 100644 +--- a/astor/code_gen.py b/astor/code_gen.py +@@ -566,7 +566,7 @@ class SourceGenerator(ExplicitNodeVisitor): + def recurse(node): + for value in node.values: + if isinstance(value, ast.Str): +-self.write(value.s) ++self.result.append(value.s) + elif isinstance(value, ast.FormattedValue): + with self.delimit('{}'): + self.visit(value.value) +diff --git a/tests/test_code_gen.py b/tests/test_code_gen.py +index 3a8be7b..0db4279 100644 +--- a/tests/test_code_gen.py b/tests/test_code_gen.py +@@ -516,6 +516,11 @@ class CodegenTestCase(unittest.TestCase, Comparisons): + x = f"""{host}\n\t{port}\n""" + ''' + self.assertSrcRoundtripsGtVer(source, (3, 6)) ++source = ''' ++if 1: ++x = f'{host}\\n\\t{port}\\n' ++''' ++
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Friday, November 17, 2017 @ 03:03:21 Author: felixonmars Revision: 267059 upgpkg: python-astor 0.6.2-1 Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Modified: PKGBUILD === --- PKGBUILD2017-11-17 01:27:03 UTC (rev 267058) +++ PKGBUILD2017-11-17 03:03:21 UTC (rev 267059) @@ -3,7 +3,7 @@ pkgbase=python-astor pkgname=('python-astor' 'python2-astor') -pkgver=0.6 +pkgver=0.6.2 pkgrel=1 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') @@ -10,9 +10,9 @@ license=('BSD') url="http://astor.rtfd.org/; makedepends=('python-setuptools' 'python2-setuptools') -checkdepends=('python-nose' 'python2-nose') +checkdepends=('python-nose' 'python2-nose' 'python2-unittest2') source=("$pkgbase-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz;) -sha512sums=('6a0da12603db8e9242031b1382275f2dd470aca60a1f7573c95178bc2c72e53ad765585247d395a793e8d48fbb9d1bf8e3c422a3961cc3b655c8fc8242a2b370') +sha512sums=('ccda3f0432522be1f8ada5589e56a7cb6da83a29fb8d9e0f4167fd492d7d6f55c0f4ed18af81d60340147894978b6ee8efb24edb68b92cdd78d053d5d53c6d66') prepare() { cp -a astor-$pkgver{,-py2}
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Friday, November 17, 2017 @ 00:12:13 Author: felixonmars Revision: 267055 upgpkg: python-astor 0.6-1 Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) Modified: PKGBUILD === --- PKGBUILD2017-11-16 23:57:17 UTC (rev 267054) +++ PKGBUILD2017-11-17 00:12:13 UTC (rev 267055) @@ -3,35 +3,35 @@ pkgbase=python-astor pkgname=('python-astor' 'python2-astor') -pkgver=0.5 -pkgrel=2 +pkgver=0.6 +pkgrel=1 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD') url="http://astor.rtfd.org/; -makedepends=('python-setuptools' 'python2-setuptools' 'git') +makedepends=('python-setuptools' 'python2-setuptools') checkdepends=('python-nose' 'python2-nose') -source=("git+https://github.com/berkerpeksag/astor.git#tag=$pkgver;) -sha512sums=('SKIP') +source=("$pkgbase-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz;) +sha512sums=('6a0da12603db8e9242031b1382275f2dd470aca60a1f7573c95178bc2c72e53ad765585247d395a793e8d48fbb9d1bf8e3c422a3961cc3b655c8fc8242a2b370') prepare() { - cp -a astor{,-py2} + cp -a astor-$pkgver{,-py2} } build() { - cd "$srcdir/astor" + cd "$srcdir"/astor-$pkgver python setup.py build - cd "$srcdir/astor-py2" + cd "$srcdir"/astor-$pkgver-py2 python2 setup.py build } check() { - # https://github.com/berkerpeksag/astor/issues/48 - cd "$srcdir/astor" + # https://github.com/berkerpeksag/astor/issues/89 + cd "$srcdir"/astor-$pkgver nosetests3 || warning "Tests failed" - cd "$srcdir/astor-py2" + cd "$srcdir"/astor-$pkgver-py2 nosetests2 } @@ -38,15 +38,15 @@ package_python-astor() { depends=('python') - cd astor - python setup.py install --root="${pkgdir}" --optimize=1 - install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + 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-py2 - python2 setup.py install --root="${pkgdir}" --optimize=1 - install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + cd astor-$pkgver-py2 + python2 setup.py install --root="$pkgdir" --optimize=1 + install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE }
[arch-commits] Commit in python-astor/trunk (PKGBUILD)
Date: Sunday, December 25, 2016 @ 17:58:48 Author: bpiotrowski Revision: 202192 Python 3.6 rebuild Modified: python-astor/trunk/PKGBUILD --+ PKGBUILD |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Modified: PKGBUILD === --- PKGBUILD2016-12-25 17:58:25 UTC (rev 202191) +++ PKGBUILD2016-12-25 17:58:48 UTC (rev 202192) @@ -4,7 +4,7 @@ pkgbase=python-astor pkgname=('python-astor' 'python2-astor') pkgver=0.5 -pkgrel=1 +pkgrel=2 pkgdesc="Read/rewrite/write Python ASTs" arch=('any') license=('BSD')