diff --git a/.gitignore b/.gitignore index 6ef00ec..f329e66 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/httplib2-0.10.3.tar.gz +SOURCES/httplib2-0.21.0.tar.gz diff --git a/.python-httplib2.metadata b/.python-httplib2.metadata index b28ce63..5fcc930 100644 --- a/.python-httplib2.metadata +++ b/.python-httplib2.metadata @@ -1 +1 @@ -79fef92f4a5c121adcb7be0cd7c43f4d8328a299 SOURCES/httplib2-0.10.3.tar.gz +319562ae0a80be4c4615d8a31200ae61b577eb89 SOURCES/httplib2-0.21.0.tar.gz diff --git a/SOURCES/python-httplib2-0.9-proxy-http.patch b/SOURCES/python-httplib2-0.9-proxy-http.patch deleted file mode 100644 index 0d55002..0000000 --- a/SOURCES/python-httplib2-0.9-proxy-http.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Nur httplib2-0.9.orig/python2/httplib2/__init__.py httplib2-0.9/python2/httplib2/__init__.py ---- httplib2-0.9.orig/python2/httplib2/__init__.py 2015-04-03 12:56:04.834370332 -0600 -+++ httplib2-0.9/python2/httplib2/__init__.py 2015-04-03 12:58:16.441925454 -0600 -@@ -838,7 +838,11 @@ - else: - port = dict(https=443, http=80)[method] - -- proxy_type = 3 # socks.PROXY_TYPE_HTTP -+ if method == 'http': -+ proxy_type = 4 # socks.PROXY_TYPE_HTTP_NO_TUNNEL -+ else: -+ proxy_type = 3 # socks.PROXY_TYPE_HTTP -+ - return ProxyInfo( - proxy_type = proxy_type, - proxy_host = host, diff --git a/SOURCES/python-httplib2.certfile.patch b/SOURCES/python-httplib2.certfile.patch index e351169..3d6ab21 100644 --- a/SOURCES/python-httplib2.certfile.patch +++ b/SOURCES/python-httplib2.certfile.patch @@ -1,31 +1,79 @@ -diff -Nur httplib2-0.9.orig/python2/httplib2/__init__.py httplib2-0.9/python2/httplib2/__init__.py ---- httplib2-0.9.orig/python2/httplib2/__init__.py 2014-04-14 06:52:57.000000000 -0600 -+++ httplib2-0.9/python2/httplib2/__init__.py 2014-05-23 21:17:02.082118837 -0600 -@@ -191,8 +191,10 @@ - CA_CERTS = ca_certs_locater.get() - except ImportError: - # Default CA certificates file bundled with httplib2. -- CA_CERTS = os.path.join( -- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt") -+# CA_CERTS = os.path.join( -+# os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt") -+# Use Fedora system-wide shared certificate store for security, consistency. -+ CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt" - - # Which headers are hop-by-hop headers by default - HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade'] ---- httplib2-0.9/python3/httplib2/__init__.py 2014-04-14 05:52:57.000000000 -0700 -+++ httplib2-0.9/python3/httplib2/__init__.py.new 2015-01-12 17:22:19.815505848 -0800 -@@ -124,8 +124,10 @@ - HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade'] - - # Default CA certificates file bundled with httplib2. --CA_CERTS = os.path.join( -- os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt") -+#CA_CERTS = os.path.join( -+# os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt") -+# Use Fedora system-wide shared certificate store for security, consistency. -+CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt" - - def _get_end2end_headers(response): - hopbyhop = list(HOP_BY_HOP) +diff --git a/python2/httplib2/certs.py b/python2/httplib2/certs.py +index 59d1ffc..a2e7513 100644 +--- a/python2/httplib2/certs.py ++++ b/python2/httplib2/certs.py +@@ -23,6 +23,7 @@ BUILTIN_CA_CERTS = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "cacerts.txt" + ) + ++FEDORA_CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt" + + def where(): + env = os.environ.get("HTTPLIB2_CA_CERTS") +@@ -35,7 +36,7 @@ def where(): + return custom_ca_locater_where() + if certifi_available: + return certifi_where() +- return BUILTIN_CA_CERTS ++ return FEDORA_CA_CERTS + + + if __name__ == "__main__": +diff --git a/python3/httplib2/certs.py b/python3/httplib2/certs.py +index 59d1ffc..2708393 100644 +--- a/python3/httplib2/certs.py ++++ b/python3/httplib2/certs.py +@@ -23,6 +23,8 @@ BUILTIN_CA_CERTS = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "cacerts.txt" + ) + ++FEDORA_CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt" ++ + + def where(): + env = os.environ.get("HTTPLIB2_CA_CERTS") +@@ -35,7 +37,7 @@ def where(): + return custom_ca_locater_where() + if certifi_available: + return certifi_where() +- return BUILTIN_CA_CERTS ++ return FEDORA_CA_CERTS + + + if __name__ == "__main__": +diff --git a/tests/test_cacerts_from_env.py b/tests/test_cacerts_from_env.py +index cb2bd9f..0fed4d5 100644 +--- a/tests/test_cacerts_from_env.py ++++ b/tests/test_cacerts_from_env.py +@@ -7,6 +7,7 @@ import httplib2 + + + CA_CERTS_BUILTIN = os.path.join(os.path.dirname(httplib2.__file__), "cacerts.txt") ++FEDORA_CA_CERTS = "/etc/pki/tls/certs/ca-bundle.crt" + CERTIFI_CERTS_FILE = "unittest_certifi_file" + CUSTOM_CA_CERTS = "unittest_custom_ca_certs" + +@@ -32,7 +33,7 @@ def ca_certs_tmpfile(clean_env): + @mock.patch("httplib2.certs.certifi_available", False) + @mock.patch("httplib2.certs.custom_ca_locater_available", False) + def test_certs_file_from_builtin(clean_env): +- assert httplib2.certs.where() == CA_CERTS_BUILTIN ++ assert httplib2.certs.where() == FEDORA_CA_CERTS + + + @mock.patch("httplib2.certs.certifi_available", False) +@@ -44,7 +45,7 @@ def test_certs_file_from_environment(ca_certs_tmpfile): + with pytest.raises(RuntimeError): + httplib2.certs.where() + os.environ.pop("HTTPLIB2_CA_CERTS") +- assert httplib2.certs.where() == CA_CERTS_BUILTIN ++ assert httplib2.certs.where() == FEDORA_CA_CERTS + + + @mock.patch("httplib2.certs.certifi_where", mock.MagicMock(return_value=CERTIFI_CERTS_FILE)) +@@ -69,4 +70,4 @@ def test_with_certifi_removed_from_modules(ca_certs_tmpfile): + os.environ["HTTPLIB2_CA_CERTS"] = ca_certs_tmpfile + assert httplib2.certs.where() == ca_certs_tmpfile + os.environ.pop("HTTPLIB2_CA_CERTS") +- assert httplib2.certs.where() == CA_CERTS_BUILTIN ++ assert httplib2.certs.where() == FEDORA_CA_CERTS diff --git a/SOURCES/python-httplib2.getCertHost.patch b/SOURCES/python-httplib2.getCertHost.patch deleted file mode 100644 index f9c53de..0000000 --- a/SOURCES/python-httplib2.getCertHost.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ./python2/httplib2/__init__.py.getCertHost ./python2/httplib2/__init__.py ---- ./python2/httplib2/__init__.py.getCertHost 2012-05-03 17:16:33.834155219 +1000 -+++ ./python2/httplib2/__init__.py 2012-06-21 18:19:33.804660257 +1000 -@@ -942,11 +942,12 @@ class HTTPSConnectionWithTimeout(httplib - list: A list of valid host globs. - """ - if 'subjectAltName' in cert: -- return [x[1] for x in cert['subjectAltName'] -- if x[0].lower() == 'dns'] -- else: -- return [x[0][1] for x in cert['subject'] -- if x[0][0].lower() == 'commonname'] -+ # Patch from richardfearn@gmail.com -+ return [x[1] for x in cert['subjectAltName'] -+ if x[0].lower() == "dns"] -+ -+ return [x[0][1] for x in cert['subject'] -+ if x[0][0].lower() == 'commonname'] - - def _ValidateCertificateHostname(self, cert, hostname): - """Validates that a given hostname is valid for an SSL certificate. diff --git a/SOURCES/python-httplib2.rfc2459.patch b/SOURCES/python-httplib2.rfc2459.patch deleted file mode 100644 index 523129e..0000000 --- a/SOURCES/python-httplib2.rfc2459.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up ./python2/httplib2/__init__.py.orig ./python2/httplib2/__init__.py ---- ./python2/httplib2/__init__.py.orig 2012-07-27 18:35:59.215300471 +1000 -+++ ./python2/httplib2/__init__.py 2012-07-27 18:36:30.697287505 +1000 -@@ -943,8 +943,13 @@ class HTTPSConnectionWithTimeout(httplib - """ - if 'subjectAltName' in cert: - # Patch from richardfearn@gmail.com -- return [x[1] for x in cert['subjectAltName'] -+ # RFC 2459 states that subjectAltName may contain: -+ # either DNS, email, IP or URI -+ # email, URI, -+ hosts=[x[1] for x in cert['subjectAltName'] - if x[0].lower() == "dns"] -+ if hosts: -+ return hosts - - return [x[0][1] for x in cert['subject'] - if x[0][0].lower() == 'commonname'] - diff --git a/SPECS/python-httplib2.spec b/SPECS/python-httplib2.spec index 0e62b36..b4e20b5 100644 --- a/SPECS/python-httplib2.spec +++ b/SPECS/python-httplib2.spec @@ -1,123 +1,262 @@ -%if 0%{?fedora} >= 13 -%global with_python3 1 -%else -%if 0%{?rhel} >= 7 -%global with_python3 1 -%endif -%endif - -%if 0%{?rhel} > 7 -# Disable python2 build by default -%bcond_with python2 -%else -%bcond_without python2 -%endif - -Name: python-httplib2 -Version: 0.10.3 -Release: 4%{?dist} -Summary: A comprehensive HTTP client library -Group: System Environment/Libraries +%global srcname httplib2 + +Name: python-%{srcname} +Version: 0.21.0 +Release: 9%{?dist} +Summary: Comprehensive HTTP client library License: MIT URL: https://pypi.python.org/pypi/httplib2 -Source0: https://pypi.python.org/packages/source/h/httplib2/httplib2-%{version}.tar.gz -# See also the 'locater plugin' system httplib2 now allows, and -# https://github.com/dreamhost/httplib2-ca_certs_locater -# It's kind of problematic, though: https://github.com/jcgregorio/httplib2/issues/293 -Patch1: %{name}.certfile.patch -Patch2: %{name}.getCertHost.patch -Patch3: %{name}.rfc2459.patch +Source: https://github.com/httplib2/httplib2/archive/v%{version}/%{srcname}-%{version}.tar.gz # -# Fix proxy with plain http -# https://bugzilla.redhat.com/show_bug.cgi?id=857514 -# https://github.com/jcgregorio/httplib2/issues/228 -# -Patch4: python-httplib2-0.9-proxy-http.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%if %{with python2} -BuildRequires: python2-setuptools -BuildRequires: python2-devel -%endif # with python2 -BuildArch: noarch +# Patch to use the Fedora ca certs instead of the bundled ones +# +Patch1: python-%{srcname}.certfile.patch -%if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -%endif # if with_python3 +BuildArch: noarch %global _description\ A comprehensive HTTP client library that supports many features left out of\ other HTTP libraries. -%description %_description +%description %{_description} -%if %{with python2} -%package -n python2-httplib2 -Summary: %summary -%{?python_provide:%python_provide python2-httplib2} +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-pytest +# This is listed as a test requirement, but doesn't seem to actually be used. +#BuildRequires: python3-pytest-forked +BuildRequires: python3-pytest-timeout +BuildRequires: python3-six +BuildRequires: python3-cryptography +# This is a runtime dependency required to run the tests: +BuildRequires: python3-pyparsing -%description -n python2-httplib2 %_description -%endif # with python2 +%description -n python3-%{srcname} %{_description} -%if 0%{?with_python3} -%package -n python3-httplib2 -Summary: A comprehensive HTTP client library -%{?python_provide:%python_provide python3-httplib2} - -%description -n python3-httplib2 -A comprehensive HTTP client library that supports many features left out of -other HTTP libraries. -%endif # with_python3 %prep -%setup -q -n httplib2-%{version} -%patch1 -p1 -b .certfile -%patch2 -p0 -b .getCertHost -%patch3 -p0 -b .rfc2459 -%patch4 -p1 - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' -%endif # with_python3 +%autosetup -p1 -n %{srcname}-%{version} + +# Drop coverage +sed -i '/--cov/d' setup.cfg + +%generate_buildrequires +%pyproject_buildrequires %build -%if %{with python2} -%py2_build -%endif # with python2 +%pyproject_wheel -%if 0%{?with_python3} -pushd %{py3dir} -%py3_build -popd -%endif # with_python3 %install -%if %{with python2} -%py2_install -%endif # with python2 - -%if 0%{?with_python3} -pushd %{py3dir} -%py3_install -popd -%endif # with_python3 - -%if %{with python2} -%files -n python2-httplib2 -%{python2_sitelib}/* -%endif # with python2 - -%if 0%{?with_python3} -%files -n python3-httplib2 -%{python3_sitelib}/* -%endif # with_python3 +%pyproject_install + +%pyproject_save_files -l httplib2 + +%check +# test_get_301_no_redirect is disabled because it leads to Segfault on Python 3.11 +# the other disabled tests are broken PySocks tests +%pytest -k "not test_unknown_server \ + and not test_socks5_auth and not \ + test_server_not_found_error_is_raised_for_invalid_hostname and not \ + test_functional_noproxy_star_https and not \ + test_sni_set_servername_callback and not test_not_trusted_ca and not \ + test_invalid_ca_certs_path and not test_max_tls_version and not \ + test_get_301_via_https and not test_client_cert_password_verified and not\ + test_get_via_https and not test_min_tls_version and not\ + test_client_cert_verified and not test_inject_space and not test_get_301_no_redirect" + +%files -n python3-%{srcname} -f %{pyproject_files} +%doc README.md %changelog -* Fri Jun 08 2018 Charalampos Stratakis - 0.10.3-4 -- Conditionalize the python2 subpackage +* Sat Dec 28 2024 Arkady L. Shane - 0.21.0-9 +- Rebuilt for MSVSphere 10 + +* Sun Sep 22 2024 Kevin Fenzi - 0.21.0-9 +- Modernize spec + +* Fri Jul 19 2024 Fedora Release Engineering - 0.21.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 07 2024 Python Maint - 0.21.0-7 +- Rebuilt for Python 3.13 + +* Fri Jan 26 2024 Fedora Release Engineering - 0.21.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.21.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 0.21.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jun 14 2023 Python Maint - 0.21.0-3 +- Rebuilt for Python 3.12 + +* Tue Mar 07 2023 Gwyn Ciesla - 0.21.0-2 +- migrated to SPDX license + +* Sun Feb 19 2023 Kevin Fenzi - 0.21.0-1 +- Update to 0.21.0. rhbz#2138541 + +* Wed Jan 25 2023 Miro Hrončok - 0.20.4-8 +- Explicitly BuildRequire runtime dependencies for tests + +* Fri Jan 20 2023 Fedora Release Engineering - 0.20.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 0.20.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 20 2022 Zbigniew Jędrzejewski-Szmek - 0.20.4-5 +- Rebuilt for pyparsing-3.0.9 (2nd attempt) + +* Tue Jul 19 2022 Zbigniew Jędrzejewski-Szmek - 0.20.4-4 +- Rebuilt for pyparsing-3.0.9 + +* Wed Jun 15 2022 Tomáš Hrnčiar - 0.20.4-3 +- Disable broken test for compatibility with Python 3.11 + +* Tue Jun 14 2022 Python Maint - 0.20.4-2 +- Rebuilt for Python 3.11 + +* Sun Feb 20 2022 Kevin Fenzi - 0.20.4-1 +- Update to 0.20.4. Fixes rhbz#2049986 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.20.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 13 2021 Paul Wouters - 0.20.3-1 +- Update to 0.20.3. Only fixes test cases + +* Sat Nov 06 2021 Kevin Fenzi - 0.20.2-1 +- Update to 0.20.2. Fixes rhbz#2011750 + +* Fri Jul 23 2021 Fedora Release Engineering - 0.19.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.19.1-3 +- Rebuilt for Python 3.10 + +* Thu May 13 2021 Miro Hrončok - 0.19.1-2 +- Drop BuildRequires on pytest-flake8 +- Deselect failing test +- Fixes: rhbz#1958945 + +* Sat Apr 24 2021 Kevin Fenzi - 0.19.1-1 +- Update to 0.19.1. Fixes rhbz#1944789 + +* Wed Mar 3 2021 Pavel Cahyna - 0.19.0-2 +- Remove unused python3-pytest-cov build dependency +- Use mock from the standard library, remove build dependency + on the deprecated python-mock package + +* Sun Feb 07 2021 Kevin Fenzi - 0.19.0-1 +- Update t0 0.19.0. Fixes rhbz#1925988 + +* Wed Jan 27 2021 Fedora Release Engineering - 0.18.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Jan 02 2021 Miro Hrončok - 0.18.1-9 +- Disable Python 2 build entirely + +* Tue Nov 24 2020 Miro Hrončok - 0.18.1-8 +- Disable Python 2 build on RHEL 9+ + +* Fri Sep 04 2020 Joel Capitao - 0.18.1-7 +- Remove unused BR + +* Wed Aug 05 2020 Gwyn Ciesla - 0.18.1-6 +- Disable tests related to PySocks bug. + +* Sat Aug 01 2020 Fedora Release Engineering - 0.18.1-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.18.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jun 11 2020 Gwyn Ciesla - 0.18.1-3 +- BR fixes. + +* Fri May 22 2020 Miro Hrončok - 0.18.1-2 +- Rebuilt for Python 3.9 + +* Wed May 20 2020 Gwyn Ciesla - 0.18.1-1 +- 0.18.1 + +* Wed May 20 2020 Gwyn Ciesla - 0.18.0-1 +- 0.18.0 + +* Wed May 20 2020 Gwyn Ciesla - 0.17.4-1 +- 0.17.4 + +* Mon May 04 2020 Miro Hrončok - 0.17.3-3 +- Fix python2/python3 mishmash (#1830222) +- Run tests + +* Wed Apr 22 2020 Igor Raits - 0.17.3-2 +- Cleanup spec + +* Wed Apr 22 2020 Gwyn Ciesla - 0.17.3-1 +- 0.17.3 + +* Mon Apr 13 2020 Gwyn Ciesla - 0.17.2-1 +- 0.17.2 + +* Thu Apr 02 2020 Gwyn Ciesla - 0.17.1-1 +- 0.17.1 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.17.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jan 24 2020 Gwyn Ciesla - 0.17.0-1 +- 0.17.0 + +* Fri Jan 17 2020 Gwyn Ciesla - 0.16.0-1 +- 0.16.0 + +* Thu Dec 19 2019 Gwyn Ciesla - 0.15.0-1 +- 0.15.0 + +* Wed Nov 06 2019 Gwyn Ciesla - 0.14.0-1 +- 0.14.0 + +* Thu Oct 03 2019 Miro Hrončok - 0.13.1-2 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Thu Aug 22 2019 Kevin Fenzi - 0.13.1-1 +- Update to 0.13.1. Fixes bug #1742362 + +* Thu Aug 15 2019 Miro Hrončok - 0.13.0-3 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.13.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Jun 30 2019 Kevin Fenzi - 0.13.0-1 +- Update to 0.13.0. + +* Tue Apr 23 2019 Kevin Fenzi - 0.12.3-1 +- Update to 0.12.3. + +* Sat Feb 02 2019 Fedora Release Engineering - 0.11.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 21 2018 Kevin Fenzi - 0.11.3-5 +- Fix files section on python2 subpackage. + +* Fri Jul 20 2018 Kevin Fenzi - 0.11.3-4 +- Fix FTBFS bug #1605725 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.11.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 15 2018 Miro Hrončok - 0.11.3-2 +- Rebuilt for Python 3.7 + +* Sun Jun 10 2018 Kevin Fenzi - 0.11.3-1 +- Update to 0.11.3. Fixes bug #1559204 * Fri Feb 09 2018 Fedora Release Engineering - 0.10.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild