Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 6D03D781A7A for <~alpine/aports@lists.alpinelinux.org>; Mon, 21 Sep 2020 22:39:44 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpwn.com; s=key1; t=1600727983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ztdcAW1u0qkZUbwQroT6JRyZrNWEy9ud25aeQHhJuzc=; b=EVPGk+DhYTdk66SL8IvzHwmNWDLc8iVMj1R96Va+NJSdXW4tFdzKqXafEH2f/NSWObMpyK r9lEuY8L7VoDurytUjFAeo9pijpNtH8xo7Qa+aVq9m9em33ZzOzbh3OQKijCVPvY+YRa9b wanyApBGTpj6wlgC7pJ/DBvNvv9fmMGraanJ+ql8J46JVawtDgmTCbzoOe6fbQP+/e1St6 8Gjili44U4mFPLiJCdH391AVmW/KwiyJ6hDD7KKzjaMVd1QSwC1zuR076fjCR+Qqn7YG1f YDkpo6j67drqUmHg6ug0xK8G5nSMed3n1R/16ZU9gTm9AEidR7U80FhF1SJDkA== From: Drew DeVault To: ~alpine/aports@lists.alpinelinux.org Cc: Drew DeVault Subject: [PATCH] py3-requests: drop py3-certffi dependency Date: Mon, 21 Sep 2020 16:39:32 -0600 Message-Id: <20200921223932.6692-1-sir@cmpwn.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.00 --- main/py3-requests/APKBUILD | 15 +++++++++++---- main/py3-requests/certs.patch | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 main/py3-requests/certs.patch diff --git a/main/py3-requests/APKBUILD b/main/py3-requests/APKBUILD index 88ee28c160..364f4d774d 100644 --- a/main/py3-requests/APKBUILD +++ b/main/py3-requests/APKBUILD @@ -3,16 +3,22 @@ pkgname=py3-requests _pkgname=requests pkgver=2.24.0 -pkgrel=0 +pkgrel=1 pkgdesc="A HTTP request library for Python3" url="http://www.python-requests.org/" arch="noarch" license="Apache-2.0" # Requirements for tests are not available in main options="!check" -depends="python3 py3-chardet py3-idna py3-certifi py3-urllib3" +depends="python3 py3-chardet py3-idna py3-urllib3" makedepends="py3-setuptools" -source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +# certs.patch forces requests to use the system certificate store by default, +# and eliminates the certffi dependency. Thanks to Eli Schwartz of Arch Linux +# for the recommendation. +source=" + https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz + certs.patch +" builddir="$srcdir/$_pkgname-$pkgver" replaces="py-requests" # Backwards compatibility @@ -26,4 +32,5 @@ package() { python3 setup.py install --prefix=/usr --root="$pkgdir" } -sha512sums="46ca8ab70eb39be8398c242404b9b3ffb6baddd5c78eaad125b55c719154eb8c7b6a737a8dc587b0cb51b3b9a074abaa8b2ff347a64d38f4f90cdba4db16a119 requests-2.24.0.tar.gz" +sha512sums="46ca8ab70eb39be8398c242404b9b3ffb6baddd5c78eaad125b55c719154eb8c7b6a737a8dc587b0cb51b3b9a074abaa8b2ff347a64d38f4f90cdba4db16a119 requests-2.24.0.tar.gz +424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3 certs.patch" diff --git a/main/py3-requests/certs.patch b/main/py3-requests/certs.patch new file mode 100644 index 0000000000..47a32f3802 --- /dev/null +++ b/main/py3-requests/certs.patch @@ -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()) -- 2.28.0