4.10.3-2: add gtktreeviewmodel fixes
[arch-packages.git] / python-urllib3 / trunk / PKGBUILD
blob53d1bb52568e7473afd7155366845dea28e67e46
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 _name=urllib3
7 pkgbase=python-urllib3
8 pkgname=(python-urllib3 python-urllib3-doc)
9 pkgver=1.26.15
10 pkgrel=1
11 pkgdesc="HTTP library with thread-safe connection pooling and file post support"
12 arch=("any")
13 url="https://github.com/urllib3/urllib3"
14 license=("MIT")
15 makedepends=(
16   'python-build'
17   'python-installer'
18   'python-setuptools'
19   'python-sphinx'
20   'python-sphinx-furo'
21   'python-wheel'
23 checkdepends=(
24   'python-brotli'
25   'python-certifi'
26   'python-cryptography'
27   'python-dateutil'
28   'python-flaky'
29   'python-gcp-devrel-py-tools'
30   'python-idna'
31   'python-pyopenssl'
32   'python-pysocks'
33   'python-pytest'
34   'python-pytest-freezegun'
35   'python-pytest-timeout'
36   'python-tornado'
37   'python-trustme'
39 source=("https://github.com/urllib3/urllib3/archive/$pkgver/$pkgbase-$pkgver.tar.gz")
40 sha512sums=('edd52a05049a047b1bb913de1cc211a6f7b70802e9ddcb639a973fb910bf218210577a5375077b6569ef382c07668ad6057adb67a31475125c2e5517c603131d')
42 prepare() {
43   # remove python-mock requirement
44   find $_name-$pkgver -type f -iname "*.py" -exec sed 's/import mock/from unittest import mock/; s/from mock/from unittest.mock/' -i {} +
47 build() {
48   cd $_name-$pkgver
49   python -m build --wheel --no-isolation
51   cd docs
52   PYTHONPATH="../build/lib" make html
55 check() {
56   local pytest_options=(
57     -vv
58     # TODO: report upstream
59     --deselect test/test_ssltransport.py::SingleTLSLayerTestCase::test_ssl_object_attributes
60     --deselect test/contrib/test_pyopenssl.py::TestSSL::test_ssl_read_timeout
61     --deselect test/with_dummyserver/test_socketlevel.py::TestSSL::test_ssl_read_timeout
62   )
63   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
65   cd $_name-$pkgver
66   # install to temporary location, as importlib is used
67   python -m installer --destdir=test_dir dist/*.whl
68   export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
69   pytest "${pytest_options[@]}"
72 package_python-urllib3() {
73   depends=('python')
74   optdepends=(
75     'python-brotli: Brotli support'
76     'python-certifi: security support'
77     'python-cryptography: security support'
78     'python-idna: security support'
79     'python-pyopenssl: security support'
80     'python-pysocks: SOCKS support'
81   )
83   cd $_name-$pkgver
84   python -m installer --destdir="$pkgdir" dist/*.whl
85   install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
88 package_python-urllib3-doc() {
89   pkgdesc="urllib3 Documentation"
91   cd $_name-$pkgver/docs
92   install -d "$pkgdir"/usr/share/doc
93   cp -r _build/html "$pkgdir"/usr/share/doc/python-urllib3
94   install -Dm644 ../LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/