Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Jeremy Cline
f5172ae63e Update to v1.24.2 2019-04-17 17:00:59 -04:00
Jeremy Cline
d79390d490
Bring back the ssl_match_hostname source and hackery
Python 3 has ssl_match_hostname as a file, but Python 2 symlinks the
directory and upgrading is troublesome. Rather than dealing with an
upgrade scriptlet, just bring back the old rm -rf stuff and wait for
Python 2 to die.
2018-11-13 14:24:43 -05:00
Jeremy Cline
2d9f3272e5
Update to v1.24.1
This addresses rhbz #1649155
2018-11-13 13:37:36 -05:00
Lukas Slebodnik
b7dcb3a9f3
Do not lowercase hostnames with custom-protocol (rhbz 1574684)
upstream: https://github.com/urllib3/urllib3/issues/1267
2018-05-04 09:54:52 -04:00
Jeremy Cline
d6a8e52d24
Drop the dependency on cryptography and idna
Both these dependencies were only used by the PyOpenSSL injection
module, which we don't need on Fedora as we ship sufficiently new
versions of Python.
2018-04-18 12:26:42 -04:00
Jeremy Cline
573e987c72
Drop PyOpenSSL requirement (rhbz 1567862)
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
2018-04-16 11:24:39 -04:00
4 changed files with 49 additions and 62 deletions

4
.gitignore vendored
View file

@ -19,3 +19,7 @@
/urllib3-1.20.tar.gz
/urllib3-1.21.1.tar.gz
/urllib3-1.22.tar.gz
/urllib3-1.23.tar.gz
/urllib3-1.24.tar.gz
/urllib3-1.24.1.tar.gz
/urllib3-1.24.2.tar.gz

View file

@ -1,32 +0,0 @@
From 4bff1e93d2dd4663d422d7e290473d9189cec5db Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Sun, 31 Dec 2017 15:11:16 +0100
Subject: [PATCH] Move RECENT_DATE to 2017-06-30
The test suite expects the current date to be no more than two years in the future
of RECENT_DATE, which just serves as a reference point.
Also clarify the comment about how to update RECENT_DATE
Fixes #1303
diff --git a/urllib3/connection.py b/urllib3/connection.py
index 06bcbde1a..a03b573f0 100644
--- a/urllib3/connection.py
+++ b/urllib3/connection.py
@@ -56,10 +56,11 @@ class ConnectionError(Exception):
'https': 443,
}
-# When updating RECENT_DATE, move it to
-# within two years of the current date, and no
-# earlier than 6 months ago.
-RECENT_DATE = datetime.date(2016, 1, 1)
+# When updating RECENT_DATE, move it to within two years of the current date,
+# and not less than 6 months ago.
+# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or
+# after 2016-01-01 (today - 2 years) AND before 2017-07-01 (today - 6 months)
+RECENT_DATE = datetime.date(2017, 6, 30)
class DummyConnection(object):

View file

@ -1,17 +1,15 @@
%global srcname urllib3
Name: python-%{srcname}
Version: 1.22
Release: 6%{?dist}
Version: 1.24.2
Release: 1%{?dist}
Summary: Python HTTP library with thread-safe connection pooling and file post
License: MIT
URL: https://github.com/shazow/urllib3
URL: https://github.com/urllib3/urllib3
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
# Used with Python 3.5+
# Unbundle ssl_match_hostname since we depend on it
Source1: ssl_match_hostname_py3.py
# https://github.com/shazow/urllib3/commit/4bff1e93d2dd4663d422d7e290473d9189cec5db
Patch0: python-urllib3-recent-date.patch
BuildArch: noarch
%description
@ -28,14 +26,12 @@ Requires: python2-six
Requires: python2-backports-ssl_match_hostname
# Secure extra requirements
Requires: python2-pyOpenSSL
Requires: python2-cryptography
Requires: python2-idna
Requires: python2-ipaddress
Requires: python2-pysocks
BuildRequires: python2-devel
# For unittests
BuildRequires: python2-backports-ssl_match_hostname
BuildRequires: python2-nose
BuildRequires: python2-nose-exclude
BuildRequires: python2-coverage
@ -66,18 +62,13 @@ BuildRequires: python3-tornado
Requires: ca-certificates
Requires: python3-six
Requires: python3-pysocks
Requires: python3-pyOpenSSL
Requires: python3-cryptography
Requires: python3-idna
Requires: python3-pysocks
%description -n python3-%{srcname}
Python3 HTTP module with connection pooling and file POST abilities.
%prep
%setup -q -n %{srcname}-%{version}
%patch0 -p1 -b .recent-date
%autosetup -p1 -n %{srcname}-%{version}
# Drop the dummyserver tests in koji. They fail there in real builds, but not
# in scratch builds (weird).
rm -rf test/with_dummyserver/
@ -87,6 +78,10 @@ rm -rf test/appengine/
# to do with Fedora in particular. They don't fail in upstream build infrastructure
rm -rf test/contrib/
# Tests for Python built without SSL, but Fedora builds with SSL. These tests
# fail when combined with the unbundling of backports-ssl_match_hostname
rm -f test/test_no_ssl.py
%build
%py2_build
%py3_build
@ -101,11 +96,11 @@ rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py*
rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname/
mkdir -p %{buildroot}/%{python2_sitelib}/urllib3/packages/
ln -s ../../six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
ln -s ../../six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
ln -s ../../six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo
ln -s ../../backports/ssl_match_hostname %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname
ln -s %{python2_sitelib}/six.py %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py
ln -s %{python2_sitelib}/six.pyc %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyc
ln -s %{python2_sitelib}/six.pyo %{buildroot}/%{python2_sitelib}/urllib3/packages/six.pyo
ln -s %{python2_sitelib}/backports/ssl_match_hostname \
%{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname
# Unbundle the Python 3 build
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py*
@ -113,18 +108,19 @@ rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six*
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
ln -s ../../six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
ln -s ../../../__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
ln -s ../../../__pycache__/six.cpython-%{python3_version_nodots}.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
# urllib3 requires Python 3.5 to use the standard library's match_hostname,
# which we ship in Fedora 26, so we can safely replace the bundled version with
# this stub which imports the necessary objects.
cp %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \
%{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \
%{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
%check
py.test
py.test-3
pushd test
PYTHONPATH=%{buildroot}%{python2_sitelib}:%{python2_sitelib} %{__python2} -m pytest -v
PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pytest -v
popd
%files -n python2-%{srcname}
@ -142,6 +138,25 @@ py.test-3
%changelog
* Wed Apr 17 2019 Jeremy Cline <jcline@redhat.com> - 1.24.2-1
- Update to v1.24.2
* Tue Nov 13 2018 Jeremy Cline <jeremy@jcline.org> - 1.24.1-2
- Adjust unbundling of ssl_match_hostname
* Mon Oct 29 2018 Jeremy Cline <jeremy@jcline.org> - 1.24.1-1
- Update to v1.24.1
* Thu May 03 2018 Lukas Slebodnik <lslebodn@fedoraproject.org> - 1.22-9
- Do not lowercase hostnames with custom-protocol (rhbz 1567862)
- upstream: https://github.com/urllib3/urllib3/issues/1267
* Wed Apr 18 2018 Jeremy Cline <jeremy@jcline.org> - 1.22-8
- Drop the dependency on idna and cryptography (rhbz 1567862)
* Mon Apr 16 2018 Jeremy Cline <jeremy@jcline.org> - 1.22-7
- Drop the dependency on PyOpenSSL, it's not needed (rhbz 1567862)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (urllib3-1.22.tar.gz) = 1b45a4a64e71847a4fc62b9263235d5b05b62076698fa324454efeb7ad065abd702cc9eadb2d396d9270b07e91e9bad94c52a4b9b115aadccb27f81955e6feab
SHA512 (urllib3-1.24.2.tar.gz) = 08e8d896f57eb9af5511d07002859f87f2a7bddbd5e66468908188dfe13d2e3985a8cdd2da12d06d0b337945ca8314c1f026d4e82badf23a09bf686fa121e863