Commit fba00027 authored by Bart Ribbers's avatar Bart Ribbers
Browse files

community/py3-adapt-parser: upgrade to 0.4.0 and enable tests

parent d813d9c3
From d50d4fbaf5495eb3003cd342491cdd050e6d3c38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85ke=20Forslund?= <ake.forslund@gmail.com>
Date: Sat, 10 Apr 2021 09:38:23 +0200
Subject: [PATCH] Add run_tests.sh to easily do linting and tests
---
README.md | 10 +++-------
run_tests.sh | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 7 deletions(-)
create mode 100755 run_tests.sh
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755
index 0000000..11a99b6
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,40 @@
+#! /bin/bash
+
+ADAPT_DIR=$(dirname $0)
+
+do_lint () {
+ flake8 "${ADAPT_DIR}/adapt" --select=E9,F63,F7,F82 --show-source && \
+ flake8 "${ADAPT_DIR}/test" --select=E9,F63,F7,F82 --show-source
+}
+
+do_test () {
+ pytest "${ADAPT_DIR}/test/"*
+}
+
+show_help () {
+ echo "Tests for adapt."
+ echo "If no arguments are given, both test and linting is performed."
+ echo "Otherwise the argument will determine which part is performed."
+ echo ""
+ echo " Usage: $0 [test/lint]"
+ echo ""
+ echo "Arguments:"
+ echo " test: Only run the tests."
+ echo " lint: Only perform codestyle and static analysis."
+}
+
+if [[ $# == 0 ]]; then
+ do_lint || exit $? # Exit on failure
+ do_test || exit $? # Exit on failure
+elif [[ $# == 1 ]]; then
+ if [[ $1 == "lint" ]]; then
+ do_lint
+ elif [[ $1 == "test" ]]; then
+ do_test
+ else
+ show_help
+ fi
+else
+ show_help
+fi
+
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-adapt-parser
pkgver=0.3.7
pkgrel=1
pkgver=0.4.0
pkgrel=0
pkgdesc="A text-to-intent parsing framework"
url="https://github.com/MycroftAI/adapt"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-pyee"
depends="
py3-pyee
python3
"
makedepends="py3-setuptools"
source="https://pypi.python.org/packages/source/a/adapt-parser/adapt-parser-$pkgver.tar.gz
checkdepends="
bash
py3-pytest
"
#source="https://pypi.python.org/packages/source/a/adapt-parser/adapt-parser-$pkgver.tar.gz
source="$pkgname-$pkgver.tar.gz::https://github.com/MycroftAI/adapt/archive/release/v$pkgver/adapt-release/v$pkgver.tar.gz
relax-dep-requirements.patch
0001-add_run_tests.sh.patch
"
options="!check" # No tests
builddir="$srcdir/adapt-parser-$pkgver"
builddir="$srcdir/adapt-release-v$pkgver"
build() {
python3 setup.py build
}
check() {
./run_tests.sh test
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="da98a812706f335170c7f1c0b0dfe6e8aca09ca884b043bfc960ef35d56cda8ed51cf97c98de11fa7ce1bc0ba43006fe6d7feb8ebe52d0fe6375dab51582e79e adapt-parser-0.3.7.tar.gz
67e5af731c4fa4f42875806443517d8511cea162b82bf8f5ae5eaf1d30746bdfecea0f17f4d987b88ac800ca8aba192751fcf10d9728a802322b65b2e0f628c3 relax-dep-requirements.patch"
sha512sums="
8a8ff3076719dafc0832b9f41cae26c3c3f069e34505d30ce795f59e1bb14693ce0c5f383c2a84e2208e9330d4e235fae52d0fd643f3a47477264429c5d5d6dd py3-adapt-parser-0.4.0.tar.gz
67e5af731c4fa4f42875806443517d8511cea162b82bf8f5ae5eaf1d30746bdfecea0f17f4d987b88ac800ca8aba192751fcf10d9728a802322b65b2e0f628c3 relax-dep-requirements.patch
e5392d5f50cff597ac0c6032477122f7fbd21205b775ad0fda3279220cdf829540ff2eb476a1956da3299b13c153c57bde3d29f12055583d2d76370dc684420e 0001-add_run_tests.sh.patch
"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment