mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
83 lines
2.9 KiB
Bash
83 lines
2.9 KiB
Bash
# Contributor: Angel Velasquez <angvp@archlinux.org>
|
|
# Contributor: Felix Yan <felixonmars@archlinux.org>
|
|
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
|
|
# Contributor: Alexander Fehr <pizzapunk gmail com>
|
|
|
|
pkgbase=pylint
|
|
pkgname=('python3-pylint' 'python2-pylint')
|
|
pkgver=1.8.2
|
|
pkgrel=2
|
|
pkgdesc="Analyzes Python code looking for bugs and signs of poor quality"
|
|
arch=('any')
|
|
url="http://pylint.org"
|
|
license=('GPL')
|
|
makedepends=('python3-astroid' 'python2-astroid'
|
|
'python3-setuptools' 'python2-setuptools'
|
|
'python3-six' 'python2-six'
|
|
'python3-isort' 'python2-isort'
|
|
'python3-mccabe' 'python2-mccabe'
|
|
'python2-backports.functools_lru_cache'
|
|
'python2-configparser'
|
|
'python2-singledispatch')
|
|
checkdepends=('python3-pytest-runner' 'python2-pytest-runner' 'mpdecimal')
|
|
optdepends=('tk: Pylint GUI'
|
|
'graphviz: To have other output formats than dot or vcg')
|
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/PyCQA/pylint/archive/pylint-$pkgver.tar.gz")
|
|
sha512sums=('ac0e7d53b5482435b0579b475684bb725358f21ae3a09d15fdf01bb51dd06f9204c4be3b17de69d4e11d1fed38820f0046625030928ca5699f2828c8f2a44716')
|
|
|
|
prepare() {
|
|
sed -i 's/pytest<3.3/pytest/' pylint-pylint-$pkgver/setup.py
|
|
|
|
cp -a pylint-pylint-$pkgver{,-py2}
|
|
|
|
cd "$srcdir"/pylint-pylint-$pkgver/pylint
|
|
sed -e "s|/usr/bin/env python|/usr/bin/env python3|" -e "s|/usr/bin/python$|/usr/bin/python3|" -i epylint.py __main__.py test/input/noext test/data/ascript
|
|
|
|
cd "$srcdir"/pylint-pylint-$pkgver-py2/pylint
|
|
sed -e "s|/usr/bin/env python|/usr/bin/env python2|" -e "s|/usr/bin/python$|/usr/bin/python2|" -i epylint.py __main__.py test/input/noext test/data/ascript
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir"/pylint-pylint-$pkgver
|
|
python3 setup.py build
|
|
|
|
cd "$srcdir"/pylint-pylint-$pkgver-py2
|
|
python2 setup.py build
|
|
}
|
|
|
|
check() {
|
|
cd "$srcdir"/pylint-pylint-$pkgver
|
|
python3 setup.py pytest
|
|
|
|
cd "$srcdir"/pylint-pylint-$pkgver-py2
|
|
python2 setup.py pytest
|
|
}
|
|
|
|
package_python3-pylint() {
|
|
depends=('python3-astroid' 'python3-setuptools' 'python3-mccabe' 'python3-isort')
|
|
|
|
cd pylint-pylint-$pkgver
|
|
|
|
python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build --optimize=1
|
|
|
|
install -d "$pkgdir"/usr/share/man/man1
|
|
install -m644 man/* "$pkgdir"/usr/share/man/man1
|
|
}
|
|
|
|
package_python2-pylint() {
|
|
depends=('python2-astroid' 'python2-setuptools' 'python2-mccabe' 'python2-isort'
|
|
'python2-backports.functools_lru_cache' 'python2-configparser' 'python2-singledispatch')
|
|
|
|
cd pylint-pylint-$pkgver-py2
|
|
|
|
python2 setup.py install --prefix=/usr --root="$pkgdir" --skip-build --optimize=1
|
|
|
|
install -d "$pkgdir"/usr/share/man/man1
|
|
install -m644 man/* "$pkgdir"/usr/share/man/man1
|
|
|
|
for _exe in epylint pylint pyreverse symilar; do
|
|
mv "$pkgdir"/usr/bin/${_exe}{,2}
|
|
mv "$pkgdir"/usr/share/man/man1/${_exe}{,2}.1
|
|
done
|
|
}
|