diff options
author | Keith Maxwell <keith.maxwell@gmail.com> | 2019-04-15 14:25:09 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-04-16 09:58:31 +0000 |
commit | b1dc2f45563c1305ad66e06f155eba1111760515 (patch) | |
tree | f46113cfdb79648b3afb800f08bfcc3f897ce3f3 /community/py-flake8 | |
parent | eabbcd757ce3cb0601dcc67b0fc9d4de24a72821 (diff) | |
download | aports-b1dc2f45563c1305ad66e06f155eba1111760515.tar.bz2 aports-b1dc2f45563c1305ad66e06f155eba1111760515.tar.xz |
community/py-flake8: move from main
Diffstat (limited to 'community/py-flake8')
-rw-r--r-- | community/py-flake8/APKBUILD | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/community/py-flake8/APKBUILD b/community/py-flake8/APKBUILD new file mode 100644 index 0000000000..1c19d6a6cb --- /dev/null +++ b/community/py-flake8/APKBUILD @@ -0,0 +1,65 @@ +# Contributor: Peter Bui <pnutzh4x0r@gmail.com> +# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch> +pkgname=py-flake8 +_pkgname=${pkgname#py-} +pkgver=3.6.0 +pkgrel=0 +pkgdesc="A modular source code checker" +url="https://gitlab.com/pycqa/flake8" +arch="noarch" +license="MIT" +depends="py-mccabe py-pep8 py-pyflakes" +makedepends="python2-dev python3-dev py-setuptools" +checkdepends="pytest py-pbr py-atomicwrites py-attrs py-pluggy py-six py-mock" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" +source="https://pypi.io/packages/source/f/$_pkgname/$_pkgname-$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" + +build() { + cd "$builddir" + python2 setup.py build + python3 setup.py build +} + +check() { + cd "$builddir" + python2 setup.py test + python3 setup.py test +} + +package() { + cd "$builddir" + + mkdir -p "$pkgdir"/usr/bin + ln -s flake8-3 "$pkgdir"/usr/bin/flake8 +} + +_py2() { + replaces=flake8 + provides="flake8=$pkgver-r$pkgrel" + depends="${depends//py-/py2-}" + _py python2 +} + +_py3() { + depends="${depends//py-/py3-}" + _py python3 +} + +_py() { + local python="$1" + local pyver="${1:6:1}" + pkgdesc="$pkgdesc (for $python)" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" + + # Add version suffix to executable files. + local path; for path in "$subpkgdir"/usr/bin/*; do + mv "$path" "$path-$pyver" + done +} + +sha512sums="f4377bc7806074a88f88b3652c3061583e576ee515b2b741cee9c6dc18f84f34a7807c93fda9dca3d8b006e379dcee60bb3ae20e6a2e62fd216a82a2b36f2eb5 flake8-3.6.0.tar.gz" |