archrelease: copy trunk to testing-x86_64
[arch-packages.git] / python-requests / repos / extra-any / PKGBUILD
bloba8f155e2a2d667c20026090f60fe833a9da7374f
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
4 pkgname=python-requests
5 pkgver=2.28.1
6 pkgrel=1
7 pkgdesc="Python HTTP for Humans"
8 arch=('any')
9 url="http://python-requests.org"
10 license=('Apache')
11 depends=('python-urllib3' 'python-chardet' 'python-idna')
12 makedepends=('python-setuptools' 'python-chardet' 'python-urllib3' 'python-idna')
13 checkdepends=('python-pytest-httpbin' 'python-pytest-mock' 'python-pysocks' 'python-trustme')
14 optdepends=('python-pysocks: SOCKS proxy support')
15 source=("https://github.com/psf/requests/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
16         certs.patch)
17 sha512sums=('caed2d08340c79af9448eefaa1df796f9112a7c8da30b218d5f342326a9629d95928c0978b9600e4bd7f56a297ef41afb088af390738be431b91b8c7429e741b'
18             '424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3')
20 prepare() {
21   cd requests-$pkgver
22   # Stay with chardet for now: https://github.com/psf/requests/issues/5871
23   sed -e '/certifi/d' \
24       -e "s/,<.*'/'/" \
25       -e '/charset_normalizer/d' \
26       -i setup.py
27   patch -p1 -i "$srcdir"/certs.patch
30 build() {
31   cd requests-$pkgver
32   python setup.py build
35 check() {
36   # Seems to be a problem about pytest-httpbin:
37   # pytest-httpbin server hit an exception serving request: [SSL: HTTP_REQUEST] http request (_ssl.c:1129)
38   # pytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1129)
40   cd requests-$pkgver
41   pytest tests --deselect tests/test_requests.py::TestRequests::test_pyopenssl_redirect
44 package() {
45   cd requests-$pkgver
46   python setup.py install --skip-build -O1 --root="$pkgdir"