summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce7054b4e117fc199099ee8eb8ab70ac6074495b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Bao Trinh <qubidt at gmail dot com>

pkgname=python-graylint
_pkgname="${pkgname#python-}"
pkgver=1.1.1
pkgrel=1
pkgdesc='Filter linter messages from various Python linters to only those which were caused by recent changes to the code base being linted'
arch=(any)
url="https://github.com/akaihola/graylint"
license=("BSD-3-Clause")
depends=(
	'python'
	'python-darkgraylib'
)
makedepends=(
	'git'
	'python-build'
	'python-installer'
	'python-wheel'
	'python-setuptools'
)
checkdepends=(
	'python-pytest'
	'mypy'
	'python-pytest-kwparametrize'
)
optdepends=('python-pygments: syntax highlighting')
source=("${pkgname}::git+${url}.git#tag=v${pkgver}")
sha512sums=('b6d4e6fba44ea957976e591480f3340c21f129112b0403279aaf4c7a17bda36dc92ec50e4b8bb9877a997afb1a63e302f19aeba7e4c0a2374c97bba13386015a')

prepare() {
	cd "${pkgname}"
	# tests mistakenly included because tests dir contains __init__.py file
	echo "prune src/graylint/tests" >> MANIFEST.in
}

build() {
	cd "${pkgname}"
	python -m build --no-isolation
}

check() {
	cd "${pkgname}"
	PYTHONPATH=src \
	pytest -v "src/${_pkgname}"
}

package() {
	cd "${pkgname}"
	python -m installer -d "${pkgdir}" dist/*-"${pkgver}"-*.whl
	install -Dm644 "LICENSE.rst" -t "${pkgdir}/usr/share/licenses/${pkgname}"
	install -Dm644 "README.rst" -t "${pkgdir}/usr/share/doc/${pkgname}"
}