1
0
mirror of https://github.com/bertptrs/aur.git synced 2025-12-27 21:40:31 +01:00

Add split package and unit testing.

This commit is contained in:
2018-07-23 10:12:52 +02:00
parent 3d439ae8f7
commit 23b5b430e9
3 changed files with 44 additions and 82 deletions

View File

@@ -1,36 +1,53 @@
# Maintainer: Bert Peters <bert@bertptrs.nl>
# Maintainer: wedjat <wedjat@protonmail.com>
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
pkgname=python-pydicom
pkgname=('python-pydicom' 'python2-pydicom')
pkgver=1.1.0
pkgrel=1
pkgrel=2
pkgdesc="Pure python package for working with DICOM files"
arch=("x86_64")
url="https://pydicom.github.io/pydicom/stable/index.html"
license=('MIT' 'custom')
depends=('python' 'python-numpy')
makedepends=('python-setuptools')
optdepends=()
options=()
source=("$pkgname-$pkgver.tar.gz::https://github.com/pydicom/pydicom/archive/v$pkgver.tar.gz" "file://license.txt")
md5sums=('759799fbe1d01d1daadeca649717122b'
'dee3b5d8029934bd8195cd244b966055')
prepare()
{
cd "$srcdir/pydicom-$pkgver"
sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python|" $(find -name '*.py')
}
depends=('python')
makedepends=('python-setuptools' 'python2-setuptools')
optdepends=('python-numpy: for working with pixel data'
'python-pillow: for working with compressed image data')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/pydicom/pydicom/archive/v$pkgver.tar.gz")
md5sums=('759799fbe1d01d1daadeca649717122b')
build()
build()
{
cd "$srcdir/pydicom-$pkgver"
python setup.py build
}
package()
package_python-pydicom()
{
cd "$srcdir/pydicom-$pkgver"
python setup.py install --skip-build --root="$pkgdir"/ --optimize=1
install -D "$srcdir/pydicom-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -D "$srcdir/pydicom-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_python2-pydicom()
{
depends=('python2')
optdepends=('python2-numpy: for working with pixel data'
'python2-pillow: for working with compressed image data')
cd "$srcdir/pydicom-$pkgver"
python2 setup.py install --skip-build --root="$pkgdir"/ --optimize=1
install -D "$srcdir/pydicom-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
check()
{
cd "$srcdir/pydicom-$pkgver"
# Test suite has a known issue with Pillow 5 and up
# See: https://github.com/pydicom/pydicom/issues/663
# Don't write byte code to prevent a "$srcdir in pkg" error on rebuilds
PYTHONDONTWRITEBYTECODE=1 \
pytest --deselect=pydicom/tests/test_pillow_pixel_data.py::test_PI_RGB[JPEG_RGB_RGB]
}