summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcell Meszaros2022-07-01 08:19:29 +0200
committerMarcell Meszaros2022-07-01 08:20:37 +0200
commit91912b6620199bce7826406fb804a0536706c47b (patch)
treeffb92a511ab7431e39ffc854a9bb640d8b10bf36
parent46a19a5c3e7364a37d8bcb229c69752f3c5e1928 (diff)
downloadaur-91912b6620199bce7826406fb804a0536706c47b.tar.gz
2.27.1-3: remove unnecessary depends; be more verbose in prepare()
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD60
2 files changed, 37 insertions, 37 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a13a25bfb474..16c55d66f884 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,19 @@
pkgbase = python2-requests
pkgdesc = HTTP for Humans (legacy Python 2 version)
pkgver = 2.27.1
- pkgrel = 2
+ pkgrel = 3
url = https://pypi.org/project/requests/2.27.1/
arch = any
license = Apache
makedepends = python2-setuptools
depends = python2
- depends = python2-certifi
- depends = python2-chardet
- depends = python2-idna
- depends = python2-urllib3
- optdepends = python2-ndg-httpsclient: HTTPS requests with SNI support
optdepends = python2-pysocks: SOCKS proxy support
- source = https://github.com/psf/requests/archive/v2.27.1/python2-requests-2.27.1.tar.gz
+ source = https://github.com/psf/requests/releases/download/v2.27.1/requests-2.27.1.tar.gz
source = certs.patch
- b2sums = 302fa6f3be95840e7c79a036d5d6bf354f9db0857542969759690c312b31e26fc4779e886b616bd624cb17a53da0342597988bd4aee88dbeb0f6a2442b8a6ced
+ b2sums = a7fed53998fa61b3d03abd254a0cee76450c5b60d76f80aa6b91f32dca1dae5d2c51987b3d3f2138d72c50790e35c36cb03eb5974554ac4eb1a902eff79b5bdd
b2sums = b6a7c9796a8ffedebcdbf0d2f95c40b1bbfa0beb45a3c7d5b493a459c4516533992291c720cf02e291cdbbf554dd0bf25c1312f4be41e39acd586b41911ad5b0
pkgname = python2-requests
+ depends = python2-chardet
+ depends = python2-idna
+ depends = python2-urllib3
diff --git a/PKGBUILD b/PKGBUILD
index fe31f4460612..e82f3682e617 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,54 +5,51 @@
pkgname='python2-requests'
_name="${pkgname#python2-}"
pkgver=2.27.1
-pkgrel=2
+pkgrel=3
pkgdesc='HTTP for Humans (legacy Python 2 version)'
arch=('any')
url="https://pypi.org/project/${_name}/${pkgver}/"
license=('Apache')
-depends=(
- 'python2'
- 'python2-certifi'
- 'python2-chardet'
- 'python2-idna'
- 'python2-urllib3'
-)
+depends=('python2')
makedepends=('python2-setuptools')
# checkdepends=(
# 'python2-pytest'
-# 'python2-pytest-httpbin'
# 'python2-pytest-mock'
+# 'python2-pytest-httpbin'
+# 'python2-pytest-xdist'
# 'python2-pysocks'
# 'python2-trustme'
# )
-optdepends=(
- 'python2-ndg-httpsclient: HTTPS requests with SNI support'
- 'python2-pysocks: SOCKS proxy support'
-)
-_sourcedirname="${_name}-${pkgver}"
-source=("https://github.com/psf/${_name}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
+optdepends=('python2-pysocks: SOCKS proxy support')
+_tarname="${_name}-${pkgver}"
+source=("https://github.com/psf/${_name}/releases/download/v${pkgver}/${_tarname}.tar.gz"
'certs.patch')
-b2sums=('302fa6f3be95840e7c79a036d5d6bf354f9db0857542969759690c312b31e26fc4779e886b616bd624cb17a53da0342597988bd4aee88dbeb0f6a2442b8a6ced'
+b2sums=('a7fed53998fa61b3d03abd254a0cee76450c5b60d76f80aa6b91f32dca1dae5d2c51987b3d3f2138d72c50790e35c36cb03eb5974554ac4eb1a902eff79b5bdd'
'b6a7c9796a8ffedebcdbf0d2f95c40b1bbfa0beb45a3c7d5b493a459c4516533992291c720cf02e291cdbbf554dd0bf25c1312f4be41e39acd586b41911ad5b0')
prepare() {
- cd "${_sourcedirname}"
- # Stay with chardet for now: https://github.com/psf/requests/issues/5871
- sed -e '/certifi/d' \
- -e "s/,<.*'/'/" \
+ cd "${_tarname}"
+
+ echo 'Patching setup.py:'
+ echo '- removing unnecessary upper version constraints'
+ echo "- removing certifi and charset_normalizer requirements"
+ sed -e "s/,<.*'/'/" \
+ -e '/certifi/d' \
-e '/charset_normalizer/d' \
-i 'setup.py'
- patch -p1 -i "${srcdir}/certs.patch"
- # Change hashbangs to python2
- sed -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
- -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' \
- -e 's|#![ ]*/bin/env python$|#!/usr/bin/env python2|' \
+ echo "Patching certs.py: use Arch's default ca-certificates.crt"
+ patch --verbose -p1 -i "${srcdir}/certs.patch"
+
+ echo 'Changing hashbangs in *.py files to refer to python2'
+ sed -e '1s|#![ ]*/usr/bin/python.*|#!/usr/bin/python2|' \
+ -e '1s|#![ ]*/usr/bin/env python.*|#!/usr/bin/env python2|' \
+ -e '1s|#![ ]*/bin/env python.*|#!/usr/bin/env python2|' \
-i $(find . -name '*.py')
}
build() {
- cd "${_sourcedirname}"
+ cd "${_tarname}"
python2 setup.py build
}
@@ -61,11 +58,16 @@ build() {
# # pytest-httpbin server hit an exception serving request: [SSL: HTTP_REQUEST] http request (_ssl.c:1129)
# # pytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1129)
#
-# cd "${_sourcedirname}"
+# cd "${_tarname}"
# pytest tests --deselect tests/test_requests.py::TestRequests::test_pyopenssl_redirect
# }
package() {
- cd "${_sourcedirname}"
- python2 setup.py install --skip-build -O1 --root="${pkgdir}"
+ depends=(
+ 'python2-chardet'
+ 'python2-idna'
+ 'python2-urllib3'
+ )
+ cd "${_tarname}"
+ python2 setup.py install --skip-build --optimize=1 --root="${pkgdir}"
}