From 93683a8963ff36995b30c644cf2c6a3dcda0c6ba Mon Sep 17 00:00:00 2001 From: IdrisKalp Date: Tue, 10 Dec 2019 19:32:25 +0300 Subject: [PATCH] python-requests move to core --- .../python/python-requests/actions.py | 14 +++ .../python/python-requests/files/certs.patch | 14 +++ ...dont-import-OrderedDict-from-urllib3.patch | 28 ++++++ ...certs.py-to-use-the-system-CA-bundle.patch | 49 ++++++++++ .../language/python/python-requests/pspec.xml | 95 +++++++++++++++++++ 5 files changed, 200 insertions(+) create mode 100755 programming/language/python/python-requests/actions.py create mode 100644 programming/language/python/python-requests/files/certs.patch create mode 100755 programming/language/python/python-requests/files/dont-import-OrderedDict-from-urllib3.patch create mode 100755 programming/language/python/python-requests/files/patch-requests-certs.py-to-use-the-system-CA-bundle.patch create mode 100755 programming/language/python/python-requests/pspec.xml diff --git a/programming/language/python/python-requests/actions.py b/programming/language/python/python-requests/actions.py new file mode 100755 index 00000000..5daac7d9 --- /dev/null +++ b/programming/language/python/python-requests/actions.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pythonmodules +from pisi.actionsapi import pisitools + +def build(): + pythonmodules.compile() + +def install(): + pythonmodules.install() diff --git a/programming/language/python/python-requests/files/certs.patch b/programming/language/python/python-requests/files/certs.patch new file mode 100644 index 00000000..47a32f38 --- /dev/null +++ b/programming/language/python/python-requests/files/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()) diff --git a/programming/language/python/python-requests/files/dont-import-OrderedDict-from-urllib3.patch b/programming/language/python/python-requests/files/dont-import-OrderedDict-from-urllib3.patch new file mode 100755 index 00000000..d42d2e35 --- /dev/null +++ b/programming/language/python/python-requests/files/dont-import-OrderedDict-from-urllib3.patch @@ -0,0 +1,28 @@ +From 152550287d6538e5cc7649bcf685a5a0b35058dd Mon Sep 17 00:00:00 2001 +From: Jeremy Cline +Date: Tue, 12 Jun 2018 14:06:00 -0400 +Subject: [PATCH] Don't import OrderedDict from urllib3 + +We unbundle urllib3, just use collections (py2.7+) + +Signed-off-by: Jeremy Cline +--- + requests/compat.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/requests/compat.py b/requests/compat.py +index 6b9c6fac..6ba6e460 100644 +--- a/requests/compat.py ++++ b/requests/compat.py +@@ -45,7 +45,7 @@ if is_py2: + from StringIO import StringIO + from collections import Callable, Mapping, MutableMapping + +- from urllib3.packages.ordered_dict import OrderedDict ++ from collections import OrderedDict # py2.7+ + + builtin_str = str + bytes = str +-- +2.17.1 + diff --git a/programming/language/python/python-requests/files/patch-requests-certs.py-to-use-the-system-CA-bundle.patch b/programming/language/python/python-requests/files/patch-requests-certs.py-to-use-the-system-CA-bundle.patch new file mode 100755 index 00000000..21626f87 --- /dev/null +++ b/programming/language/python/python-requests/files/patch-requests-certs.py-to-use-the-system-CA-bundle.patch @@ -0,0 +1,49 @@ +rom fd9ab446d8479360d2c1c8252508d97d58ed3e0e Mon Sep 17 00:00:00 2001 +From: Jeremy Cline +Date: Mon, 19 Jun 2017 16:09:02 -0400 +Subject: [PATCH] Patch requests/certs.py to use the system CA bundle + +Signed-off-by: Jeremy Cline +--- + requests/certs.py | 11 ++++++++++- + setup.py | 1 - + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/requests/certs.py b/requests/certs.py +index d1a378d..7b103ba 100644 +--- a/requests/certs.py ++++ b/requests/certs.py +@@ -11,8 +11,17 @@ only one — the one from the certifi package. + 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. ++ ++This Fedora-patched package returns "/etc/ssl/certs/ca-certificates.crt" provided ++by the ca-certificates RPM package. + """ +-from certifi import where ++try: ++ from certifi import where ++except ImportError: ++ def where(): ++ """Return the absolute path to the system CA bundle.""" ++ return '/etc/ssl/certs/ca-certificates.crt' ++ + + if __name__ == '__main__': + print(where()) +diff --git a/setup.py b/setup.py +index 93a8507..2db9569 100755 +--- a/setup.py ++++ b/setup.py +@@ -45,7 +45,6 @@ requires = [ + 'chardet>=3.0.2,<3.1.0', + 'idna>=2.5,<2.8', + 'urllib3>=1.21.1,<1.24', +- 'certifi>=2017.4.17' + + ] + test_requirements = ['pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock', 'pytest-xdist', 'PySocks>=1.5.6, !=1.5.7', 'pytest>=2.8.0'] +-- +2.9.4 + diff --git a/programming/language/python/python-requests/pspec.xml b/programming/language/python/python-requests/pspec.xml new file mode 100755 index 00000000..2337684d --- /dev/null +++ b/programming/language/python/python-requests/pspec.xml @@ -0,0 +1,95 @@ + + + + + python-requests + http://www.python-requests.org/ + + Ergün Salman + ergunsalman@hotmail.com + + Requests is an Apache2 Licensed HTTP library, written in Python, for human beings. + Python’s standard urllib2 module provides most of the HTTP capabilities you need + MIT + https://files.pythonhosted.org/packages/01/62/ddcf76d1d19885e8579acb1b1df26a852b03472c0e46d2b959a714c90608/requests-2.22.0.tar.gz + + python-devel + python-setuptools + + + + + certs.patch + + + + + python-requests + + + /usr/lib + /usr/share/doc + + + + + + 2019-10-03 + 2.22.0 + Version bump + idris Kalp + idriskalp@gmail.com + + + 2018-09-21 + 2.19.1 + Rebuild certifi. + Pisi Linux Community + admin@pisilinux.org + + + 2018-08-15 + 2.19.1 + Version Bump. + Pisi Linux Community + admin@pisilinux.org + + + 2017-09-04 + 2.13.0 + remove unneeded runtime dep. + Ertuğrul Erata + ertugrulerata@gmail.com + + + 2017-01-25 + 2.13.0 + Version Bump + Pisi Linux Community + admin@pisilinux.org + + + 2016-06-09 + 2.9.1 + Release Bump + Pisi Linux Community + admin@pisilinux.org + + + 2016-06-06 + 2.9.1 + Rebuild + Ayhan Yalçınsoy + ayhanyalcinsoy@pisilinux.org + + + 2016-05-08 + 2.9.1 + First release + Ayhan Yalçınsoy + ayhanyalcinsoy@pisilinux.org + + +