db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / python-requests / trunk / PKGBUILD
blobb480a38f2e0113bb7f62cb75d189c342f947ec6f
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
4 pkgname=python-requests
5 pkgver=2.28.2
6 pkgrel=4
7 pkgdesc="Python HTTP for Humans"
8 arch=('any')
9 url="https://requests.readthedocs.io/"
10 license=('Apache')
11 depends=('python-urllib3' 'python-chardet' 'python-idna')
12 makedepends=(
13   python-build
14   python-installer
15   python-wheel
16   python-setuptools
17   python-chardet
18   python-urllib3
19   python-idna
21 checkdepends=('python-pytest-httpbin' 'python-pytest-mock' 'python-pysocks' 'python-trustme')
22 optdepends=('python-pysocks: SOCKS proxy support')
23 source=("https://github.com/psf/requests/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
24         certs.patch)
25 sha512sums=('88c5a92ea51cd18e7edd49a6259d7b56bc0c17f86067f796b5f668ed35202b8bc1395e4811ee2089350e08893dcd304c9801dbf087abfaff1d14859e31bce8ac'
26             '424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3')
28 prepare() {
29   cd requests-$pkgver
30   # Stay with chardet for now: https://github.com/psf/requests/issues/5871
31   sed -e '/certifi/d' \
32       -e "s/,<.*'/'/" \
33       -e '/charset_normalizer/d' \
34       -i setup.py
35   patch -p1 -i "$srcdir"/certs.patch
38 build() {
39   cd requests-$pkgver
40   python -m build --wheel --no-isolation
43 check() {
44   # Seems to be a problem about pytest-httpbin:
45   # pytest-httpbin server hit an exception serving request: [SSL: HTTP_REQUEST] http request (_ssl.c:1129)
46   # pytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1129)
48   cd requests-$pkgver
49   pytest tests --deselect tests/test_requests.py::TestRequests::test_pyopenssl_redirect
52 package() {
53   cd requests-$pkgver
54   python -m installer --destdir="$pkgdir" dist/*.whl
57 # vim: ts=2 sw=2 et: