1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 # set to 0 to use vendored sources
6 pkgname=python-pdm-backend
9 pkgdesc="The build backend used by PDM that supports latest packaging standards"
11 url="https://github.com/pdm-project/pdm-backend"
16 if (( _devendored == 1 )); then
17 # NOTE: devendored from sources
20 python-pyproject-metadata
22 python-validate-pyproject
39 'python-setuptools: for setuptools support'
42 https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz
43 $pkgname-2.0.7-devendor.patch
45 sha256sums=('684ed5d35fed34cabc99871037b426ff6b1956225cd40b50648eb108d1441945'
46 'de1e95cdfab8dd24ed7c20ba9e7ed9647421645eb11bff75a185c77dfef75190')
47 b2sums=('2d53948891b04915c8cdd2dcd36f4387f19e11847fc955bb8d79c7a6d330e156403ea77c0a8ceac667f955b749dd3ad3be84a14ded0af1a625417c6353e13d38'
48 'fb045b6f061fed51046cda246ed6603969627c0d13a0c6a5dbc0a8b2d4c07d54ec3fd64b7c8ff9c97373dbda6b20a25172036ba248ac3ae0b95fc5fcae036486')
51 if (( _devendored == 1 )); then
52 patch -Np1 -d $_name-$pkgver -i ../$pkgname-2.0.7-devendor.patch
53 rm -frv $_name-$pkgver/src/pdm/backend/_vendor
59 python -m build --wheel --skip-dependency-check --no-isolation
63 local pytest_options=(
65 # https://github.com/pdm-project/pdm-backend/issues/164
66 --deselect tests/test_api.py::test_build_with_cextension
67 --deselect tests/test_api.py::test_build_with_cextension_in_src
69 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
72 # install to temporary location, as importlib is used
73 python -m installer --destdir=test_dir dist/*.whl
74 export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
76 # set default git config for test
77 git config --global user.email "you@example.com"
78 git config --global user.name "Your Name"
79 pytest "${pytest_options[@]}"
84 python -m installer --destdir="$pkgdir" dist/*.whl
85 install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
86 install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"