archrelease: copy trunk to community-any
[ArchLinux/community.git] / flake8 / repos / community-any / PKGBUILD
blob464b8f6043eace1f826df1c416bb4407909c7654
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Karol "Kenji Takahashi" Woźniak <kenji.sx>
3 # Contributor: spider-mario <spidermario@free.fr>
4 # Contributor: Allen Li <darkfeline at abagofapples.com>
6 pkgname=flake8
7 pkgver=6.0.0
8 pkgrel=3
9 epoch=1
10 pkgdesc="The modular source code checker: pep8, pyflakes and co"
11 arch=('any')
12 url="https://flake8.pycqa.org"
13 license=('MIT')
14 depends=('python-pyflakes' 'python-mccabe' 'python-pycodestyle' 'python-entrypoints')
15 makedepends=('python-setuptools')
16 checkdepends=('python-pytest')
17 source=("https://github.com/PyCQA/flake8/archive/$pkgver/$pkgname-$pkgver.tar.gz")
18 sha512sums=('27de4632332ee72bb5deedfcb7ea59e31a3e7fbfd6c165adf019b06cccaba51b776f4310219d8b27cf4894ed2597330fe9c0e381187353d4dc239f102eedd26a')
20 prepare() {
21   sed -i -e 's/,<[0-9=.]*//' flake8-$pkgver/setup.cfg
23   sed -i '/error/a \    ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning' flake8-$pkgver/pytest.ini
26 build() {
27   cd flake8-$pkgver
28   python setup.py build
31 check() {
32   # Hack entry points by installing it
34   cd flake8-$pkgver
35   python setup.py install --root="$PWD/tmp_install" --optimize=1
36   local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
37   PYTHONPATH="$PWD/tmp_install/usr/lib/python${python_version}/site-packages:$PYTHONPATH" pytest
40 package() {
41   cd flake8-$pkgver
42   python setup.py install --root="$pkgdir" --prefix=/usr --optimize=1
43   install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
46 # vim:set ts=2 sw=2 et: