summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcell Meszaros2022-07-11 18:43:09 +0200
committerMarcell Meszaros2022-07-11 18:54:49 +0200
commit8ba060b16c43162a0049c1397408c35fccfc7926 (patch)
tree5bd74222c7cf91bba77f42c1a305c2f3ad0a7fd5
parent1841f2319850d0b1e0cedad83bf84f2cdb50af8b (diff)
downloadaur-8ba060b16c43162a0049c1397408c35fccfc7926.tar.gz
0.3.0-1: update and enable testing
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD49
2 files changed, 45 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0561d9b89e67..692c0b7029a3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,21 @@
pkgbase = python-pymantic
pkgdesc = Semantic Web and RDF library for Python
- pkgver = 0.2.5
- pkgrel = 2
- url = https://pypi.org/project/pymantic/0.2.5
+ pkgver = 0.3.0
+ pkgrel = 1
+ url = https://pypi.org/project/pymantic/0.3.0
arch = any
license = BSD
+ checkdepends = python-betamax
+ checkdepends = python-nose
makedepends = python-setuptools
depends = python
depends = python-requests
+ depends = python-lark-parser
depends = python-lxml
+ depends = python-pyld
depends = python-pytz
depends = python-rdflib
- depends = python-lark-parser
- depends = python-pyld
- source = https://files.pythonhosted.org/packages/source/p/pymantic/pymantic-0.2.5.tar.gz
- source = pymantic-0.2.5-LICENSE::https://github.com/norcalrdf/pymantic/raw/0.2.5/LICENSE
- sha256sums = 119361a60d811aea6f57faf05f9aebc787e37244e3c8e9c922e9621b2a425dcf
- sha256sums = c5a804cb694b36e4604f1edaf496ad7aaa93690d27666a6a7887354ec3a1a884
+ source = norcalrdf-pymantic-43125e3.tar.gz::https://api.github.com/repos/norcalrdf/pymantic/tarball/43125e320076ca86074a41c0f02bce943a760c80
+ b2sums = ead17a726aa661035c72f4e738a3c338fcf2058803ef0eefbe7d1aad7793e94b8a445dc5eab3961a1e4edefccbaade526476e7946c4b985eeb26559f6346b044
pkgname = python-pymantic
diff --git a/PKGBUILD b/PKGBUILD
index b4a4a99e7a7f..ff837c02f143 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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/"
}