diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 49 |
1 files changed, 36 insertions, 13 deletions
@@ -3,35 +3,58 @@ pkgname='python-pymantic' _module="${pkgname#python-}" -pkgver=0.2.5 -pkgrel=2 +_repo_commit='43125e320076ca86074a41c0f02bce943a760c80' # untagged 0.3.0 release version +pkgver=0.3.0 +pkgrel=1 pkgdesc='Semantic Web and RDF library for Python' arch=('any') url="https://pypi.org/project/${_module}/${pkgver}" +_repo_owner='norcalrdf' # Need GitHub tarball for tests; PyPI source lacks some test files +_repo_url_api="https://api.github.com/repos/${_repo_owner}/${_module}" license=('BSD') depends=( 'python' 'python-requests' + 'python-lark-parser' 'python-lxml' + 'python-pyld' 'python-pytz' 'python-rdflib' - 'python-lark-parser' - 'python-pyld' ) makedepends=('python-setuptools') -_sourcename="${_module}-${pkgver}" -source=("https://files.pythonhosted.org/packages/source/${_module::1}/${_module}/${_sourcename}.tar.gz" - "${_sourcename}-LICENSE::https://github.com/norcalrdf/${_module}/raw/${pkgver}/LICENSE") -sha256sums=('119361a60d811aea6f57faf05f9aebc787e37244e3c8e9c922e9621b2a425dcf' - 'c5a804cb694b36e4604f1edaf496ad7aaa93690d27666a6a7887354ec3a1a884') +checkdepends=( + 'python-betamax' + 'python-nose' +) +_tarname="${_repo_owner}-${_module}-${_repo_commit::7}" +source=("${_tarname}.tar.gz::${_repo_url_api}/tarball/${_repo_commit}") +b2sums=('ead17a726aa661035c72f4e738a3c338fcf2058803ef0eefbe7d1aad7793e94b8a445dc5eab3961a1e4edefccbaade526476e7946c4b985eeb26559f6346b044') build() { - cd "${_sourcename}" + cd "${_tarname}" python setup.py build --executable='/usr/bin/env python' } +check() { + cd "${_tarname}" + ( + export PYTHONPATH="${PWD}/build/lib:${PYTHONPATH}" + nosetests \ + --detailed-errors \ + --no-byte-compile \ + --verbose \ + --with-id + ) +} + package() { - cd "${_sourcename}" - python setup.py install --root="${pkgdir}" --optimize=1 --skip-build - install --verbose -Dm 644 "../${_sourcename}-LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + cd "${_tarname}" + python setup.py install --force --root="${pkgdir}" --prefix='/usr' --optimize=1 --skip-build + + install --verbose -Dm 644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}" + install --verbose -Dm 644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}" + + echo "Removing tests from package..." + local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + rm -rfv "${pkgdir}${_site_packages}/${_module}/tests/" } |