initial import
This commit is contained in:
76
python-requests/PKGBUILD
Normal file
76
python-requests/PKGBUILD
Normal file
@@ -0,0 +1,76 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgbase=python-requests
|
||||
pkgname=('python-requests' 'tauthon-requests')
|
||||
pkgver=2.23.0
|
||||
_debver=$pkgver
|
||||
_debrel=2
|
||||
pkgrel=3
|
||||
arch=('any')
|
||||
url='https://requests.readthedocs.io/'
|
||||
license=('Apache-2.0')
|
||||
makedepends=('python-setuptools' 'tauthon-setuptools' 'python-chardet' 'tauthon-chardet'
|
||||
'python-urllib3' 'tauthon-urllib3' 'python-idna' 'tauthon-idna' 'quilt')
|
||||
source=("$pkgbase-$pkgver.tar.gz::https://github.com/psf/requests/archive/v$pkgver.tar.gz"
|
||||
"https://repo.hyperbola.info:50000/sources/${pkgbase}/requests_${_debver}+dfsg-${_debrel}.debian.tar.xz"{,.sig}
|
||||
"certs.patch"
|
||||
"requests-pytest-5.patch")
|
||||
sha512sums=('a8e670d928fce3531629a6d73ee6b47882f3eba47684841bfce44376781b2b9c5c97186e1750ee582b0c11fa67c983f340f95eb2a4f19042f4cbc77ae090a69c'
|
||||
'16f0f0ed89fa60f1307f51e949e248b9a6ea9c6f0b92e1599f53dfab4e4d9af5712641c1d5bcc18d4ad453cda9d98cf14d62fa62c1a0d2af6fa0401d7a6072e8'
|
||||
'SKIP'
|
||||
'424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3'
|
||||
'08dbc23289d8d8afa3e122f63a7eb6c27e9272aa2f8a1bb29896f27f0c5d51d0b6feed57c8d93bced321a0be39d2852194ff8db7ff7af58ab09e91be0ee4e556')
|
||||
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir"/requests-$pkgver
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
patch -p1 -i ../requests-pytest-5.patch
|
||||
sed -e '/certifi/d' \
|
||||
-e "s/,<.*'/'/" \
|
||||
-i setup.py
|
||||
patch -p1 -i "$srcdir"/certs.patch
|
||||
|
||||
cd "$srcdir"
|
||||
cp -a requests-$pkgver{,-tauthon}
|
||||
find requests-$pkgver-tauthon -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1tauthon|' -i {} +
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir"/requests-$pkgver
|
||||
python setup.py build
|
||||
|
||||
cd "$srcdir"/requests-$pkgver-tauthon
|
||||
tauthon setup.py build
|
||||
}
|
||||
|
||||
package_python-requests() {
|
||||
pkgdesc="Python HTTP for Humans"
|
||||
depends=('python-urllib3' 'python-chardet' 'python-idna')
|
||||
optdepends=('python-pysocks: SOCKS proxy support')
|
||||
|
||||
cd "$srcdir"/requests-$pkgver
|
||||
python setup.py install --skip-build -O1 --root="$pkgdir"
|
||||
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
||||
}
|
||||
|
||||
package_tauthon-requests() {
|
||||
pkgdesc="Tauthon HTTP for Humans"
|
||||
depends=('tauthon-urllib3' 'tauthon-chardet' 'tauthon-idna')
|
||||
optdepends=('tauthon-ndg-httpsclient: HTTPS requests with SNI support'
|
||||
'tauthon-grequests: asynchronous requests with gevent'
|
||||
'tauthon-pysocks: SOCKS proxy support')
|
||||
|
||||
cd "$srcdir"/requests-$pkgver-tauthon
|
||||
tauthon setup.py install --skip-build -O1 --root="$pkgdir"
|
||||
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
||||
}
|
||||
14
python-requests/certs.patch
Normal file
14
python-requests/certs.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/requests/certs.py b/requests/certs.py
|
||||
index d1a378d7..4e0bffd4 100644
|
||||
--- a/requests/certs.py
|
||||
+++ b/requests/certs.py
|
||||
@@ -12,7 +12,8 @@ If you are packaging Requests, e.g., for a Linux distribution or a managed
|
||||
environment, you can change the definition of where() to return a separately
|
||||
packaged CA bundle.
|
||||
"""
|
||||
-from certifi import where
|
||||
+def where():
|
||||
+ return "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(where())
|
||||
33
python-requests/requests-pytest-5.patch
Normal file
33
python-requests/requests-pytest-5.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 29f1ce38d8b2e4c8e5e9d67fd84b8f75d507932a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Thu, 2 Jan 2020 16:52:36 +0100
|
||||
Subject: [PATCH] Fix test_conflicting_post_params to work on pytest 5
|
||||
|
||||
The non-contextmanager form of pytest.raises was removed in pytest 5.
|
||||
http://doc.pytest.org/en/latest/deprecations.html#raises-warns-with-a-string-as-the-second-argument
|
||||
|
||||
It was used here to support Python < 2.7, but that is no longer needed.
|
||||
https://github.com/psf/requests/pull/1503#issuecomment-22333666
|
||||
|
||||
Fixes https://github.com/psf/requests/issues/5304
|
||||
---
|
||||
tests/test_requests.py | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_requests.py b/tests/test_requests.py
|
||||
index 7d4a4eb510..e730f7648b 100644
|
||||
--- a/tests/test_requests.py
|
||||
+++ b/tests/test_requests.py
|
||||
@@ -774,8 +774,10 @@ def __len__(self):
|
||||
def test_conflicting_post_params(self, httpbin):
|
||||
url = httpbin('post')
|
||||
with open('Pipfile') as f:
|
||||
- pytest.raises(ValueError, "requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f})")
|
||||
- pytest.raises(ValueError, "requests.post(url, data=u('[{\"some\": \"data\"}]'), files={'some': f})")
|
||||
+ with pytest.raises(ValueError):
|
||||
+ requests.post(url, data='[{"some": "data"}]', files={'some': f})
|
||||
+ with pytest.raises(ValueError):
|
||||
+ requests.post(url, data=u('[{"some": "data"}]'), files={'some': f})
|
||||
|
||||
def test_request_ok_set(self, httpbin):
|
||||
r = requests.get(httpbin('status', '404'))
|
||||
Reference in New Issue
Block a user