desktop/python-isort/PKGBUILD

55 lines
1.5 KiB
Bash

# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Yaron de Leeuw <me@jarondl.net>
pkgbase=python-isort
pkgname=('python3-isort' 'python2-isort')
pkgver=4.3.4
pkgrel=1
pkgdesc="A Python utility / library to sort Python imports."
arch=('any')
url="https://github.com/timothycrosley/isort"
license=('MIT')
makedepends=('python3-setuptools' 'python2-setuptools' 'python2-futures')
checkdepends=('python3-pytest' 'python2-pytest' 'python3-mock' 'python2-mock')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/timothycrosley/isort/archive/$pkgver.tar.gz")
sha512sums=('cc9254c288e479a05cc20c29c9be6fa368a46e85f8eb0a22238ee3e57004a75999d35d2a736ad0a4ddc7d7c7efcc30fb97bfd16fcd0adb44d3b937dd935588b7')
prepare() {
cp -a isort-$pkgver{,-py2}
}
build() {
cd "$srcdir"/isort-$pkgver
python3 setup.py build
cd "$srcdir"/isort-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/isort-$pkgver
python3 setup.py test
cd "$srcdir"/isort-$pkgver-py2
python2 setup.py test
}
package_python3-isort() {
depends=('python3-setuptools')
cd isort-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-isort() {
depends=('python2-setuptools' 'python2-futures')
cd isort-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv "$pkgdir"/usr/bin/isort{,2}
}