archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-build / trunk / PKGBUILD
blobc79287c6a6709bdc8af08573d5f35a8bae9cd57e
1 # Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
2 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
4 _pkgname=build
5 pkgname=python-$_pkgname
6 pkgver=0.10.0
7 pkgrel=4
8 pkgdesc='A simple, correct PEP 517 build frontend'
9 arch=('any')
10 url='https://github.com/pypa/build'
11 license=('MIT')
12 depends=('python-packaging' 'python-pyproject-hooks')
13 optdepends=('python-virtualenv: Use virtualenv for build isolation')
14 makedepends=('git' 'python-build' 'python-flit-core' 'python-installer'
15              'python-sphinx' 'python-sphinx-argparse-cli' 'python-sphinx-autodoc-typehints' 'python-sphinx-furo')
16 checkdepends=('python-pytest' 'python-pytest-mock' 'python-pytest-rerunfailures' 'python-filelock' 'python-setuptools' 'python-toml' 'python-wheel')
17 source=("git+$url#tag=$pkgver?signed")
18 validpgpkeys=('3DCE51D60930EBA47858BA4146F633CBB0EB4BF2') # Filipe Laíns (FFY00) <lains@archlinux.org>
19 sha512sums=('SKIP')
21 build() {
22   cd $_pkgname
24   python -m build --wheel --skip-dependency-check --no-isolation
26   PYTHONPATH=src sphinx-build -b dirhtml -v docs docs/build/html
29 check() {
30   cd $_pkgname
32   PYTHONPATH=src pytest
35 package() {
36   cd $_pkgname
38   python -m installer --destdir="$pkgdir" dist/*.whl
40   install -dm 755 "$pkgdir"/usr/share/doc/$pkgname
41   cp -r -a --no-preserve=ownership docs/build/html "$pkgdir"/usr/share/doc/$pkgname
42   rm -rf "$pkgdir"/usr/share/doc/$pkgname/html/.doctrees
44   # Symlink license file
45   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
46   install -d "$pkgdir"/usr/share/licenses/$pkgname
47   ln -s "$site_packages"/$_pkgname-$pkgver.dist-info/LICENSE \
48     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE