upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-pdm-backend / trunk / PKGBUILD
blobcfa507d47769814573a11ef9c3df546877c8863e
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 # set to 0 to use vendored sources
4 _devendored=1
5 _name=pdm_backend
6 pkgname=python-pdm-backend
7 pkgver=2.0.7
8 pkgrel=1
9 pkgdesc="The build backend used by PDM that supports latest packaging standards"
10 arch=(any)
11 url="https://github.com/pdm-project/pdm-backend"
12 license=(MIT)
13 depends=(
14   python
16 if (( _devendored == 1 )); then
17   # NOTE: devendored from sources
18   depends+=(
19     python-packaging
20     python-pyproject-metadata
21     python-tomli-w
22     python-validate-pyproject
23   )
25 makedepends=(
26   python-build
27   python-installer
28   python-wheel
30 checkdepends=(
31   git
32   python-editables
33   python-pytest
34   python-pytest-cov
35   python-pytest-xdist
36   python-setuptools
38 optdepends=(
39   'python-setuptools: for setuptools support'
41 source=(
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')
50 prepare() {
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
54   fi
57 build() {
58   cd $_name-$pkgver
59   python -m build --wheel --skip-dependency-check --no-isolation
62 check() {
63   local pytest_options=(
64     -vv
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
68   )
69   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
71   cd $_name-$pkgver
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[@]}"
82 package() {
83   cd $_name-$pkgver
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/"