summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcell Meszaros2022-06-13 01:04:00 +0200
committerMarcell Meszaros2022-06-13 01:04:00 +0200
commitf76529d4382110685628bca331b175daa08c27f3 (patch)
tree501656bb230979598fe0b9c5400804468d5a8b5b
parentf4be58d62bf5c1a28fb774d7da32b4627b6f96e8 (diff)
downloadaur-f76529d4382110685628bca331b175daa08c27f3.tar.gz
refactor: use PyPI URL for upstream; code style changes
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD26
2 files changed, 16 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3c41291ee54b..0e1ca065a291 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,14 +2,14 @@ pkgbase = python2-requests
pkgdesc = HTTP for Humans (for Python 2)
pkgver = 2.27.1
pkgrel = 1
- url = http://python-requests.org
+ url = https://pypi.org/project/requests/2.27.1/
arch = any
license = Apache
makedepends = python2-setuptools
depends = python2
- depends = python2-urllib3
depends = python2-chardet
depends = python2-idna
+ depends = python2-urllib3
optdepends = python2-pysocks: SOCKS proxy support
source = https://github.com/psf/requests/archive/v2.27.1/python2-requests-2.27.1.tar.gz
source = certs.patch
diff --git a/PKGBUILD b/PKGBUILD
index 831592378c5e..e7ea02e8c9b0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,18 +2,19 @@
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
-pkgname=python2-requests
+pkgname='python2-requests'
+_name="${pkgname#python2-}"
pkgver=2.27.1
pkgrel=1
pkgdesc='HTTP for Humans (for Python 2)'
arch=('any')
-url='http://python-requests.org'
+url="https://pypi.org/project/${_name}/${pkgver}/"
license=('Apache')
depends=(
'python2'
- 'python2-urllib3'
'python2-chardet'
'python2-idna'
+ 'python2-urllib3'
)
makedepends=('python2-setuptools')
# checkdepends=(
@@ -24,19 +25,20 @@ makedepends=('python2-setuptools')
# 'python2-trustme'
# )
optdepends=('python2-pysocks: SOCKS proxy support')
-source=("https://github.com/psf/requests/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
- certs.patch)
+_sourcedirname="${_name}-${pkgver}"
+source=("https://github.com/psf/requests/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
+ 'certs.patch')
b2sums=('302fa6f3be95840e7c79a036d5d6bf354f9db0857542969759690c312b31e26fc4779e886b616bd624cb17a53da0342597988bd4aee88dbeb0f6a2442b8a6ced'
'b6a7c9796a8ffedebcdbf0d2f95c40b1bbfa0beb45a3c7d5b493a459c4516533992291c720cf02e291cdbbf554dd0bf25c1312f4be41e39acd586b41911ad5b0')
prepare() {
- cd requests-$pkgver
+ cd "${_sourcedirname}"
# Stay with chardet for now: https://github.com/psf/requests/issues/5871
sed -e '/certifi/d' \
-e "s/,<.*'/'/" \
-e '/charset_normalizer/d' \
- -i setup.py
- patch -p1 -i "$srcdir"/certs.patch
+ -i 'setup.py'
+ patch -p1 -i "${srcdir}/certs.patch"
# Change hashbangs to python2
sed -e 's+^\(#!/usr/bin/env python\)+\12+' \
@@ -45,7 +47,7 @@ prepare() {
}
build() {
- cd requests-$pkgver
+ cd "${_sourcedirname}"
python2 setup.py build
}
@@ -54,11 +56,11 @@ 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 requests-$pkgver
+# cd "${_sourcedirname}"
# pytest tests --deselect tests/test_requests.py::TestRequests::test_pyopenssl_redirect
# }
package() {
- cd requests-$pkgver
- python2 setup.py install --skip-build -O1 --root="$pkgdir"
+ cd "${_sourcedirname}"
+ python2 setup.py install --skip-build -O1 --root="${pkgdir}"
}