summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Aznarán Laos2021-08-12 19:23:45 -0500
committerCarlos Aznarán Laos2021-08-12 19:23:45 -0500
commita81c57010f941e4ff48be242e82ac0f4968b7727 (patch)
treed4fae541c134cc8463ca99568e55a73293a43898
parent93d19ebc0dfa61f338edbe666e67b6a1b351e82c (diff)
downloadaur-a81c57010f941e4ff48be242e82ac0f4968b7727.tar.gz
Add check() function
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD11
2 files changed, 12 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4da2c2830f9c..5665c73e5bda 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,10 +1,12 @@
pkgbase = python-pytest-flakes
pkgdesc = pytest plugin to check source code with pyflakes
pkgver = 4.0.3
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/asmeurer/pytest-flakes
arch = any
license = MIT
+ checkdepends = python-coverage
+ checkdepends = python-pytest-pep8
makedepends = python-setuptools
depends = python-pytest
depends = python-pyflakes
diff --git a/PKGBUILD b/PKGBUILD
index 3d0bf7f32f3e..a7bad991e30d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,14 @@
_base=pytest-flakes
pkgname=python-${_base}
pkgver=4.0.3
-pkgrel=1
+pkgrel=2
pkgdesc="pytest plugin to check source code with pyflakes"
arch=('any')
url="https://github.com/asmeurer/${_base}"
license=(MIT)
depends=(python-pytest python-pyflakes)
makedepends=(python-setuptools)
-# checkdepends=(python-coverage) #python-pytest-pep8
+checkdepends=(python-coverage python-pytest-pep8)
source=(https://pypi.org/packages/source/${_base::1}/${_base}/${_base}-${pkgver}.tar.gz)
sha512sums=('ca63d68063cf48789d86dee3707b3ea7c5076fc1f636e17f408ad6f444303fb3a701af8d1e464d49af745e350272bffe8596853a52c01baa0bdb0b6b0c0bb303')
@@ -21,6 +21,13 @@ build() {
python setup.py build
}
+check() {
+ cd "${_base}-${pkgver}"
+ local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ python setup.py install --root="${PWD}/tmp_install" --optimize=1 --skip-build
+ PYTHONPATH="$PWD/tmp_install/$site_packages" py.test
+}
+
package() {
cd "${_base}-${pkgver}"
export PYTHONHASHSEED=0