1 # Maintainer: Filipe LaĆns (FFY00) <lains@archlinux.org>
2 # Contributor: Andrea Scarpino <andrea@archlinux.org>
3 # Contributor: examon <examon.mail[at]gmail[dot]com>
4 # Contributor: Sebastian Wiesner <lunaryorn googlemail com>
5 # Contributor: Dwight Schauer <dschauer@ti.com>
8 pkgname=python-$_pkgname
12 url='https://github.com/pyudev/pyudev'
14 pkgdesc='Python bindings to libudev'
15 depends=('python-six' 'systemd')
16 makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel' 'python-sphinx')
17 checkdepends=('python-pytest' 'python-docutils' 'python-hypothesis' 'python-pip')
18 optdepends=('python-pyqt5: PyQt integration'
19 'pyside2: PySide integration'
20 'python-wxpython: WX integration')
21 source=("$_pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
22 sha512sums=('68d64113a465588411e494a010e1b19f68ed0f8fabff154d6f3066a22ff38fcd52ee73b9a00be15f5e51ea38152cd97f2ff3fda406981431a6d5a6fa0484e874')
27 # Remove failing tests (we can't test udev inside makepkg)
28 rm tests/test_{util,discover,device,monitor,enumerate,observer}.py
30 # Fix documentation build
31 sed -i "s|os.path.join(doc_directory, os.pardir)|os.path.join(doc_directory, os.pardir, 'src')|
32 s|b'autodoc-process-docstring'|'autodoc-process-docstring'|" doc/conf.py
40 # Generate documentation
41 sphinx-apidoc -f -e -o doc src/pyudev
42 sphinx-build -a -b html doc doc/html
48 PYTHONPATH=src python -m pytest
54 python -m installer -d "$pkgdir" dist/*.whl
56 # Install documentation
57 install -dm 755 "$pkgdir"/usr/share/doc/$pkgname
58 cp -r -a --no-preserve=ownership doc/html "$pkgdir"/usr/share/doc/$pkgname
59 rm -rf "$pkgdir"/usr/share/doc/$pkgname/html/.doctrees