summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-py/PKGBUILD
blob: 9a2b0837390065b6cd9e829577dc729f09f5fc3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Sebastian Wiesner <lunaryorn googlemail com>
# Contributor: Igor Ramos Tiburcio <irtigor@yahoo.com.br>
# Contributor: Wieland Hoffmann <themineo+aur@gmail.com>
# Contributor: Hervé Cauwelier <herve ¤ oursours.net>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-py
pkgname=('python-py' 'python2-py')
pkgver=1.5.3
pkgrel=1
pkgdesc="library with cross-python path, ini-parsing, io, code, log facilities"
arch=('any')
license=('MIT')
url="http://py.readthedocs.io/"
makedepends=('python-setuptools' 'python2-setuptools')
checkdepends=('python-pytest-runner' 'python2-pytest-runner')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/py/archive/$pkgver.tar.gz")
sha512sums=('60a9fc99a61f8a31a91b4217972dd957ea1d651c8818a91e84a957e907abd4f5feff7715ef64f2902d9f0444f8210a93938fc78787992dca484a2a1311523874')

prepare() {
  cp -a py-$pkgver{,-py2}

  export LC_CTYPE=en_US.UTF-8
}

build() {
  cd "$srcdir"/py-$pkgver
  python setup.py build

  cd "$srcdir"/py-$pkgver-py2
  python2 setup.py build
}

check() {
  # Known failure: https://github.com/pytest-dev/py/issues/104

  cd "$srcdir"/py-$pkgver
  python setup.py pytest || warning "Tests failed"

  cd "$srcdir"/py-$pkgver-py2
  python2 setup.py pytest || warning "Tests failed"
}

package_python-py() {
  depends=('python')

  cd py-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_python2-py() {
  depends=('python2')

  cd py-$pkgver-py2
  python2 setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}