[arch-commits] Commit in python-hacking/repos (community-any community-any/PKGBUILD)

Felix Yan felixonmars at archlinux.org
Thu Jan 19 07:38:25 UTC 2017


    Date: Thursday, January 19, 2017 @ 07:38:24
  Author: felixonmars
Revision: 207984

archrelease: copy trunk to community-any

Added:
  python-hacking/repos/community-any/
  python-hacking/repos/community-any/PKGBUILD
    (from rev 207983, python-hacking/trunk/PKGBUILD)

----------+
 PKGBUILD |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

Copied: python-hacking/repos/community-any/PKGBUILD (from rev 207983, python-hacking/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD	                        (rev 0)
+++ community-any/PKGBUILD	2017-01-19 07:38:24 UTC (rev 207984)
@@ -0,0 +1,53 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgbase=python-hacking
+pkgname=('python-hacking' 'python2-hacking')
+pkgver=0.13.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'
+             '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')
+
+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}
+}
+
+build() {
+  cd "$srcdir"/hacking
+  python setup.py build
+
+  cd "$srcdir"/hacking-py2
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir"/hacking
+  python setup.py testr || warning "Tests failed"
+
+  cd "$srcdir"/hacking-py2
+  PYTHON=python2 python2 setup.py testr || warning "Tests failed"
+}
+
+package_python-hacking() {
+  depends=('python-six' 'python-pbr' 'flake8' 'python-mccabe')
+
+  cd hacking
+  python setup.py install --root "$pkgdir" --optimize=1
+}
+
+package_python2-hacking() {
+  depends=('python2-six' 'python2-pbr' 'python2-flake8' 'python2-mccabe')
+
+  cd hacking-py2
+  python2 setup.py install --root "$pkgdir" --optimize=1
+}



More information about the arch-commits mailing list