Skip to content

Commit

Permalink
py-requests: fix runtime incompatibility with urllib3 1.25
Browse files Browse the repository at this point in the history
  • Loading branch information
stromnov committed Apr 24, 2019
1 parent 00766a1 commit 714a95b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/py-requests/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PortGroup python 1.0

name py-requests
version 2.21.0
revision 0
revision 1
categories-append devel
platforms darwin
license Apache-2
Expand Down Expand Up @@ -42,5 +42,9 @@ if {${name} ne ${subport}} {
port:py${python.version}-urllib3 \
port:py${python.version}-certifi

# py-urllib3 1.25 breaks py-requests: https://trac.macports.org/ticket/58382
patchfiles-append patch-requests___init__.py.diff \
patch-setup.py.diff

livecheck.type none
}
11 changes: 11 additions & 0 deletions python/py-requests/files/patch-requests___init__.py.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- requests/__init__.py.orig 2019-04-24 18:12:42.000000000 +0300
+++ requests/__init__.py 2019-04-24 18:12:58.000000000 +0300
@@ -60,7 +60,7 @@
# urllib3 >= 1.21.1, <= 1.24
assert major == 1
assert minor >= 21
- assert minor <= 24
+ assert minor <= 25

# Check chardet for compatibility.
major, minor, patch = chardet_version.split('.')[:3]
11 changes: 11 additions & 0 deletions python/py-requests/files/patch-setup.py.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- setup.py.orig 2019-04-24 18:12:00.000000000 +0300
+++ setup.py 2019-04-24 18:13:13.000000000 +0300
@@ -44,7 +44,7 @@
requires = [
'chardet>=3.0.2,<3.1.0',
'idna>=2.5,<2.9',
- 'urllib3>=1.21.1,<1.25',
+ 'urllib3>=1.21.1,<=1.25',
'certifi>=2017.4.17'

]

0 comments on commit 714a95b

Please sign in to comment.