archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-urllib3 / trunk / PKGBUILD
blob09f01732cc2f7cc776ba94b1b135baa410d4e317
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Patrice Peterson <runiq at archlinux dot us>
3 # Contributor: Chris Brannon <cmbrannon79@gmail.com>
4 # Contributor: BorgHunter <borghunter at gmail dot com>
6 pkgbase=python-urllib3
7 pkgname=(python-urllib3 python-urllib3-doc)
8 pkgver=1.26.7
9 pkgrel=5
10 pkgdesc="HTTP library with thread-safe connection pooling and file post support"
11 arch=("any")
12 url="https://github.com/urllib3/urllib3"
13 license=("MIT")
14 makedepends=('python-setuptools' 'python-sphinx' 'python-ndg-httpsclient'
15              'python-pyasn1' 'python-pyopenssl'
16              'python-pysocks' 'python-mock'
17              'python-brotli' 'python-sphinx-furo')
18 checkdepends=('python-pytest-runner' 'python-tornado' 'python-nose' 'python-psutil' 'python-trustme'
19               'python-gcp-devrel-py-tools' 'python-flaky' 'python-dateutil')
20 source=("https://github.com/urllib3/urllib3/archive/$pkgver/$pkgbase-$pkgver.tar.gz"
21         urllib3-use-brotli-or-brotli-cffi.patch::https://github.com/urllib3/urllib3/pull/2099.patch)
22 sha512sums=('5a0f55cba31c987c416d113ddfd4ade64704f70e4ff20092ff6d7370f260dada71e149b14ea62c8967a4c0f5ad79b441325d623446e0016c133c7e9277d3c8be'
23             '08b58960410a996b039eb3f46da252703055d79228733c65fbbe8d31fedd5b3956670230602deabf02407cac5f5d425b8d65bf3b16bdecd38f2541c6c9c82934')
25 prepare() {
26   patch -d urllib3-$pkgver -p1 -i ../urllib3-use-brotli-or-brotli-cffi.patch || :
27   cp -a urllib3-$pkgver{,-py2}
30 build() {
31   cd "$srcdir"/urllib3-$pkgver
32   python setup.py build
34   cd "$srcdir"/urllib3-$pkgver/docs
35   make html
38 check() {
39   cd urllib3-$pkgver
40   # TODO: investigate test_respect_retry_after_header_sleep
41   python setup.py pytest --addopts "--deselect test/test_retry.py::TestRetry::test_respect_retry_after_header_sleep --deselect test/test_retry_deprecated.py::TestRetry::test_respect_retry_after_header_sleep"
44 package_python-urllib3() {
45   depends=('python')
46   optdepends=('python-pysocks: SOCKS support'
47               'python-brotli: Brotli support'
48               'python-pyopenssl: security support'
49               'python-idna: security support')
51   cd urllib3-$pkgver
52   python setup.py install --root="$pkgdir"
53   install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
56 package_python-urllib3-doc() {
57   pkgdesc="urllib3 Documentation"
59   cd urllib3-$pkgver/docs
60   install -d "$pkgdir"/usr/share/doc
61   cp -r _build/html "$pkgdir"/usr/share/doc/python-urllib3
62   install -Dm644 ../LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt