Date: Thursday, April 12, 2018 @ 05:51:14
  Author: felixonmars
Revision: 315912

archrelease: copy trunk to community-testing-any

Added:
  python-subunit/repos/community-testing-any/
  python-subunit/repos/community-testing-any/PKGBUILD
    (from rev 315911, python-subunit/trunk/PKGBUILD)

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

Copied: python-subunit/repos/community-testing-any/PKGBUILD (from rev 315911, 
python-subunit/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD                              (rev 0)
+++ community-testing-any/PKGBUILD      2018-04-12 05:51:14 UTC (rev 315912)
@@ -0,0 +1,57 @@
+# $Id$
+# Maintainer: Felix Yan <felixonm...@archlinux.org>
+
+pkgbase=python-subunit
+pkgname=('python-subunit' 'python2-subunit')
+pkgver=1.3.0
+pkgrel=1
+pkgdesc="Python implementation of subunit test streaming protocol"
+arch=('any')
+license=('Apache')
+url="http://launchpad.net/subunit";
+makedepends=('python-setuptools' 'python2-setuptools' 'python-extras' 
'python2-extras'
+             'python-testtools' 'python2-testtools')
+checkdepends=('python-fixtures' 'python2-fixtures' 'python-hypothesis' 
'python2-hypothesis'
+              'python-testscenarios' 'python2-testscenarios')
+source=("https://pypi.io/packages/source/p/python-subunit/python-subunit-$pkgver.tar.gz";)
+sha512sums=('387c9ce8ed679d8998d33c7a295412e4f9de46b8dccdfab92eb82d8c4290958760b6c9bd99d50abd0836e4556c1b0c0132fc01e16801a3113844ab1bf28cf962')
+
+prepare() {
+  sed -i 's|import unittest2 as unittest|import unittest|' 
python-subunit-$pkgver/python/subunit/tests/test_test_protocol.py
+
+  cp -a python-subunit-$pkgver{,-py2}
+}
+
+build() {
+  cd "$srcdir/python-subunit-$pkgver"
+  python setup.py build
+
+  cd "$srcdir/python-subunit-$pkgver-py2"
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir/python-subunit-$pkgver"
+  PYTHONPATH="$PWD/build/lib:$PYTHONPATH" python -m testtools.run 
subunit.test_suite || warning "Tests failed"
+
+  cd "$srcdir/python-subunit-$pkgver-py2"
+  PYTHONPATH="$PWD/build/lib:$PYTHONPATH" python2 -m testtools.run 
subunit.test_suite || warning "Tests failed"
+}
+
+package_python-subunit() {
+  depends=('python-extras' 'python-testtools')
+
+  cd python-subunit-$pkgver
+  python setup.py install --root="${pkgdir}" --optimize=1
+}
+
+package_python2-subunit() {
+  depends=('python2-extras' 'python2-testtools')
+
+  cd python-subunit-$pkgver-py2
+  python2 setup.py install --root="${pkgdir}" --optimize=1
+
+  for name in subunit-1to2 subunit-2to1 subunit-filter subunit-ls 
subunit-notify subunit-output subunit-stats subunit-tags subunit2csv 
subunit2gtk subunit2junitxml subunit2pyunit tap2subunit subunit2disk; do
+    mv "$pkgdir"/usr/bin/$name{,-python2}
+  done
+}

Reply via email to