This repository has been archived by the owner on May 20, 2023. It is now read-only.
/
PKGBUILD
56 lines (50 loc) · 2.1 KB
/
PKGBUILD
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
54
55
56
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>
pkgname=python-pytest
pkgver=7.2.0
pkgrel=1
pkgdesc="Simple powerful testing with Python"
arch=('any')
license=('MIT')
url="https://pytest.org/"
depends=('python-attrs' 'python-iniconfig' 'python-packaging' 'python-pluggy'
'python-py' 'python-tomli')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-argcomplete' 'python-hypothesis' 'python-mock'
'python-nose' 'python-requests' 'python-xmlschema'
# Unlisted, but actually used. Check again after a while:
'lsof' 'python-asynctest' 'python-decorator' 'python-docutils'
'python-jinja' 'python-numpy' 'python-pexpect' 'python-pygments'
'python-pytest-xdist' 'python-twisted')
source=("https://files.pythonhosted.org/packages/source/p/pytest/pytest-$pkgver.tar.gz")
sha256sums=('c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59')
b2sums=('051c1c28aae1b2ff97af0b6e58046d8d3ee9b72909d4c8360f7ca3b9f2ed46f24a6db2d6138d1a629ec650bf7b0a14d89b44d0779340c31b60abb8608defd30b')
# Remove dep on setuptools_scm
prepare() {
cd pytest-$pkgver
sed -i "/^\[metadata\]/a version = $pkgver
/setuptools-scm/d" setup.cfg
sed -i '/setuptools-scm\|wheel/d
/\[tool.setuptools_scm\]/,/^$/d' pyproject.toml
}
build() {
cd pytest-$pkgver
python -m build --wheel --skip-dependency-check --no-isolation
}
check() {
cd pytest-$pkgver
python -m venv --system-site-packages test-env
test-env/bin/python -m installer dist/*.whl
# https://github.com/pytest-dev/pytest/issues/10042
test-env/bin/python -m pytest -o xfail_strict=False
}
package() {
cd pytest-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
# Symlink license file
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
install -d "$pkgdir"/usr/share/licenses/$pkgname
ln -s "$site_packages"/pytest-$pkgver.dist-info/LICENSE \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}