summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Dejanovic2019-05-24 13:49:54 +0200
committerIgor Dejanovic2019-05-24 13:49:54 +0200
commit46066847814700beb318ec640da0e9bcdded0274 (patch)
tree97d6fb0f373400ab771a235b44e308875850509d
parent81cc429acd12940bfba32c1acfa185aa61e050e2 (diff)
downloadaur-46066847814700beb318ec640da0e9bcdded0274.tar.gz
Adding tests run and license
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD40
2 files changed, 43 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 195626861dd0..5246ae9963a3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,17 @@
pkgbase = python-textx
pkgdesc = Python library for building Domain-Specific Languages and parsers
pkgver = 2.0.1
- pkgrel = 1
+ pkgrel = 2
url = http://textx.github.io/textX/
arch = any
license = MIT
+ checkdepends = python-pytest-runner
+ checkdepends = python-jinja
+ makedepends = python-setuptools
depends = python
depends = python-arpeggio
- source = https://github.com/textX/textX/archive/v2.0.1.tar.gz
+ depends = python-click
+ source = python-textx-2.0.1.tar.gz::https://github.com/textX/textX/archive/v2.0.1.tar.gz
md5sums = cc4fe6d5db278477b15afd5d349c1cda
pkgname = python-textx
diff --git a/PKGBUILD b/PKGBUILD
index 6b165cf0e153..9cd556684c01 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,18 +1,52 @@
+# Maintainer: Igor R. Dejanović <igor dot dejanovic at gmail.com>
+
pkgname=python-textx
_srcname=textX
pkgver=2.0.1
-pkgrel=1
+pkgrel=2
pkgdesc="Python library for building Domain-Specific Languages and parsers"
arch=('any')
url="http://textx.github.io/textX/"
license=('MIT')
-depends=('python' 'python-arpeggio')
-source=(https://github.com/textX/$_srcname/archive/v$pkgver.tar.gz)
+depends=('python' 'python-arpeggio' 'python-click')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest-runner' 'python-jinja')
+source=($pkgname-$pkgver.tar.gz::https://github.com/textX/$_srcname/archive/v$pkgver.tar.gz)
md5sums=('cc4fe6d5db278477b15afd5d349c1cda')
+build() {
+ cd $_srcname-$pkgver
+ python setup.py build
+}
+
+check() {
+
+ cd $_srcname-$pkgver
+
+ # Install all tests projects
+ pip install --user -e . || exit 1
+ pip install --user -e tests/functional/subcommands/example_project || exit 1
+ pip install --user -e tests/functional/registration/projects/types_dsl || exit 1
+ pip install --user -e tests/functional/registration/projects/data_dsl || exit 1
+ pip install --user -e tests/functional/registration/projects/flow_dsl || exit 1
+ pip install --user -e tests/functional/registration/projects/flow_codegen || exit 1
+
+ # Run all tests
+ python setup.py pytest --addopts tests/functional
+
+ # Uninstall all test projects
+ pip uninstall -y textX || exit 1
+ pip uninstall -y textX-subcommand-test || exit 1
+ pip uninstall -y types_dsl || exit 1
+ pip uninstall -y data_dsl || exit 1
+ pip uninstall -y flow_dsl || exit 1
+ pip uninstall -y flow_codegen || exit 1
+}
+
package() {
cd "$srcdir/$_srcname-$pkgver"
python setup.py install --root="$pkgdir/" --optimize=1
+ install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
# vim:set ts=2 sw=2 et: