[arch-commits] Commit in python-hacking/trunk (PKGBUILD)
Felix Yan
felixonmars at archlinux.org
Wed Sep 13 07:51:00 UTC 2017
Date: Wednesday, September 13, 2017 @ 07:50:59
Author: felixonmars
Revision: 257315
upgpkg: python-hacking 1.0.0-1
Modified:
python-hacking/trunk/PKGBUILD
----------+
PKGBUILD | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2017-09-13 07:43:04 UTC (rev 257314)
+++ PKGBUILD 2017-09-13 07:50:59 UTC (rev 257315)
@@ -3,38 +3,45 @@
pkgbase=python-hacking
pkgname=('python-hacking' 'python2-hacking')
-pkgver=0.13.0
+pkgver=1.0.0
pkgrel=1
arch=('any')
pkgdesc='OpenStack Hacking Guideline Enforcement'
url='http://docs.openstack.org/developer/hacking'
license=('Apache')
-makedepends=('git' 'python-setuptools' 'python2-setuptools' 'python-pbr' 'python2-pbr'
+makedepends=('python-setuptools' 'python2-setuptools' 'python-pbr' 'python2-pbr'
'flake8' 'python2-flake8' 'python-mccabe' 'python2-mccabe')
checkdepends=('python-oslotest' 'python2-oslotest')
-source=("git+https://git.openstack.org/openstack-dev/hacking#tag=$pkgver")
-sha512sums=('SKIP')
+source=("$pkgbase-$pkgver.tar.gz::https://github.com/openstack-dev/hacking/archive/$pkgver.tar.gz")
+sha512sums=('664f0a9bfc5c4d9154d8e4b61e41e788a6e1138ed37b10a63409852b1bf633632767e6eddbfeb497b3158590630c56a5d7dcf5d27a31ca98d79f2e9c4df7d19b')
prepare() {
- sed -e 's/flake8<2.6.0,/flake8/' -e 's/==/>=/' -i hacking/requirements.txt
- sed -e 's/pep8/pycodestyle/' -i hacking/{requirements.txt,hacking/tests/*.py,hacking/core.py}
- sed -e 's/from flake8 import engine/from flake8.api import legacy as engine/' -i hacking/hacking/tests/*.py
- cp -a hacking{,-py2}
+ sed -e 's/flake8<2.6.0,/flake8/' -e 's/==/>=/' -i hacking-$pkgver/requirements.txt
+ sed -e 's/pep8/pycodestyle/' -i hacking-$pkgver/{requirements.txt,hacking/tests/*.py,hacking/core.py}
+ sed -e 's/from flake8 import engine/from flake8.api import legacy as engine/' -i hacking-$pkgver/hacking/tests/*.py
+ sed -e '/pycodestyle.BaseReport/i \ self.options.benchmark_keys = pycodestyle.BENCHMARK_KEYS' -i hacking-$pkgver/hacking/tests/*.py
+ sed -e '/pycodestyle.BaseReport/i \ self.options.ignore_code = pycodestyle.StyleGuide.ignore_code' -i hacking-$pkgver/hacking/tests/*.py
+ sed -e '/pycodestyle.BaseReport/i \ self.options.physical_checks = []' -i hacking-$pkgver/hacking/tests/*.py
+ sed -e '/pycodestyle.BaseReport/i \ self.options.logical_checks = []' -i hacking-$pkgver/hacking/tests/*.py
+ sed -e '/pycodestyle.BaseReport/i \ self.options.ast_checks = []' -i hacking-$pkgver/hacking/tests/*.py
+ cp -a hacking-$pkgver{,-py2}
+
+ export PBR_VERSION=$pkgver
}
build() {
- cd "$srcdir"/hacking
+ cd "$srcdir"/hacking-$pkgver
python setup.py build
- cd "$srcdir"/hacking-py2
+ cd "$srcdir"/hacking-$pkgver-py2
python2 setup.py build
}
check() {
- cd "$srcdir"/hacking
+ cd "$srcdir"/hacking-$pkgver
python setup.py testr || warning "Tests failed"
- cd "$srcdir"/hacking-py2
+ cd "$srcdir"/hacking-$pkgver-py2
PYTHON=python2 python2 setup.py testr || warning "Tests failed"
}
@@ -41,7 +48,7 @@
package_python-hacking() {
depends=('python-six' 'python-pbr' 'flake8' 'python-mccabe')
- cd hacking
+ cd hacking-$pkgver
python setup.py install --root "$pkgdir" --optimize=1
}
@@ -48,6 +55,6 @@
package_python2-hacking() {
depends=('python2-six' 'python2-pbr' 'python2-flake8' 'python2-mccabe')
- cd hacking-py2
+ cd hacking-$pkgver-py2
python2 setup.py install --root "$pkgdir" --optimize=1
}
More information about the arch-commits
mailing list