blob: d8b5cad12442efe37467ac9da4388fc9a1f023ec (
plain)
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
|
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: acxz <akashpatel2008 at yahoo dot com>
pkgname=python-scrapelib
pkgver=2.0.5
pkgrel=2
pkgdesc='Library for scraping unreliable pages'
arch=('any')
url='https://github.com/jamesturk/scrapelib'
license=('BSD')
depends=('python>=3.7' 'python-requests')
makedepends=(
'python-poetry'
'python-build'
'python-installer'
'python-sphinx'
'python-sphinx_rtd_theme')
checkdepends=('python-pytest' 'python-mock')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('82698f7e5ee05363e2cb74d83b2e90f87a0370d1f0073ef12f2b942aba86afae')
build() {
cd "scrapelib-$pkgver"
python -m build --wheel --no-isolation
cd docs
PYTHONPATH=../ make man
}
check() {
cd "scrapelib-$pkgver"
pytest -x
}
package() {
export PYTHONHASHSEED=0
cd "scrapelib-$pkgver"
python -m installer --destdir="$pkgdir/" dist/*.whl
install -Dm644 docs/_build/man/scrapelib.1 -t "$pkgdir/usr/share/man/man1/"
install -d "$pkgdir/usr/share/licenses/$pkgname/"
local _sitedir="$(python -c 'from site import getsitepackages as g; print(g()[0])')"
ln -s "$_sitedir/scrapelib-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}
|