aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Maxwell <keith.maxwell@gmail.com>2019-04-15 14:24:45 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2019-04-16 09:58:30 +0000
commit28d116bf3a5615e2eb977fa8f679cac1ea06f953 (patch)
treee92bbc872df5a8dd7e5a7cbfe14d9eb3a46f566f
parentc070dfed024f133b42a8146a7ff310c589b167d3 (diff)
downloadaports-28d116bf3a5615e2eb977fa8f679cac1ea06f953.tar.bz2
aports-28d116bf3a5615e2eb977fa8f679cac1ea06f953.tar.xz
community/py-pycodestyle: enable check and adopt
- add check() to use test suite - setuptools is a runtime dependency as the files in bin use: `from pkg_resources import load_entry_point` - pure python package so doesn't depend upon -dev header files - avoid string indexing to comply with POSIX - don't use '--quiet' to more closely match draft policy [1] - install scripts with version suffix so they don't clash [1] https://wiki.alpinelinux.org/wiki/Python_package_policies
-rw-r--r--community/py-pycodestyle/APKBUILD29
1 files changed, 18 insertions, 11 deletions
diff --git a/community/py-pycodestyle/APKBUILD b/community/py-pycodestyle/APKBUILD
index 15d5abd29b..889a017c3b 100644
--- a/community/py-pycodestyle/APKBUILD
+++ b/community/py-pycodestyle/APKBUILD
@@ -1,28 +1,33 @@
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
-# Maintainer:
+# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py-pycodestyle
pkgver=2.5.0
-pkgrel=0
+pkgrel=1
pkgdesc="Check your Python code against some of the style conventions in PEP 8"
url="https://pypi.python.org/pypi/pycodestyle/"
arch="noarch"
license="MIT"
-depends=""
-makedepends="python2-dev python3-dev py-setuptools"
-options="!check" #no testsuite
+depends="py-setuptools"
+makedepends="python3 python2"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$pkgname-$pkgver.tar.gz::https://github.com/PyCQA/pycodestyle/archive/$pkgver.tar.gz"
-builddir="$srcdir"/pycodestyle-$pkgver
+builddir="$srcdir/pycodestyle-$pkgver"
build() {
cd "$builddir"
- python2 setup.py --quiet build
- python3 setup.py --quiet build
+ python2 setup.py build
+ python3 setup.py build
}
-package() {
+check() {
cd "$builddir"
+ python2 setup.py test
+ python3 setup.py test
+}
+
+package() {
mkdir -p "$pkgdir"/usr/bin
+ ln -s pycodestyle-3 "$pkgdir"/usr/bin/pycodestyle
}
_py2() {
@@ -37,13 +42,15 @@ _py3() {
_py() {
local python="$1"
- local pyver="${1:6:1}"
+ local pyver="${1#python}"
pkgdesc="$pkgdesc (for $python)"
depends="$depends $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
cd "$builddir"
- $python setup.py --quiet install --prefix=/usr --root="$subpkgdir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+ cd "$subpkgdir/usr/bin"
+ mv pycodestyle "pycodestyle-$pyver"
}
sha512sums="b40d2b4fd6673f4115cb0fa056056ef39f4705ba8826bb2a4b91c98e542132951471e1226d697daeb6fac9a5520df5f8dde0931462e540ee2eb8b5f275eb2288 py-pycodestyle-2.5.0.tar.gz"