diff --git a/Fix-warnings-when-running-tests.patch b/Fix-warnings-when-running-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdbc6456fc948c51571479506eee7a699f58780f --- /dev/null +++ b/Fix-warnings-when-running-tests.patch @@ -0,0 +1,95 @@ +From 41728025340a02643085adcbcecf986ad8667209 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Tue, 17 Aug 2021 20:39:00 -0400 +Subject: [PATCH] Fix warnings when running tests + +--- + tests/memory_mgmt_test.py | 4 ++-- + tests/reload_test.py | 4 ++-- + tests/setopt_lifecycle_test.py | 1 + + tests/setopt_test.py | 8 ++++---- + 4 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/tests/memory_mgmt_test.py b/tests/memory_mgmt_test.py +index 416fd4c97..ec841f235 100644 +--- a/tests/memory_mgmt_test.py ++++ b/tests/memory_mgmt_test.py +@@ -297,7 +297,7 @@ def test_postfields_unicode_memory_leak_gh252(self): + + gc.collect() + after_object_count = len(gc.get_objects()) +- self.assert_(after_object_count <= before_object_count + 1000, 'Grew from %d to %d objects' % (before_object_count, after_object_count)) ++ self.assertTrue(after_object_count <= before_object_count + 1000, 'Grew from %d to %d objects' % (before_object_count, after_object_count)) + c.close() + + def test_form_bufferptr_memory_leak_gh267(self): +@@ -317,7 +317,7 @@ def test_form_bufferptr_memory_leak_gh267(self): + + gc.collect() + after_object_count = len(gc.get_objects()) +- self.assert_(after_object_count <= before_object_count + 1000, 'Grew from %d to %d objects' % (before_object_count, after_object_count)) ++ self.assertTrue(after_object_count <= before_object_count + 1000, 'Grew from %d to %d objects' % (before_object_count, after_object_count)) + c.close() + + def do_data_refcounting(self, option): +diff --git a/tests/reload_test.py b/tests/reload_test.py +index 3f037a129..e6c1fbcef 100644 +--- a/tests/reload_test.py ++++ b/tests/reload_test.py +@@ -14,6 +14,6 @@ def test_reloading(self): + reload_fn = reload + except NameError: + # python 3 +- import imp +- reload_fn = imp.reload ++ import importlib ++ reload_fn = importlib.reload + reload_fn(pycurl) +diff --git a/tests/setopt_lifecycle_test.py b/tests/setopt_lifecycle_test.py +index 1adb70c14..eacedc8f7 100644 +--- a/tests/setopt_lifecycle_test.py ++++ b/tests/setopt_lifecycle_test.py +@@ -17,6 +17,7 @@ + setup_module, teardown_module = appmanager.setup(('app', 8380)) + + class TestString(str): ++ __test__ = False + def __del__(self): + self.replace('1', '2') + #print self +diff --git a/tests/setopt_test.py b/tests/setopt_test.py +index 29ae2f027..472cf341c 100644 +--- a/tests/setopt_test.py ++++ b/tests/setopt_test.py +@@ -58,13 +58,13 @@ def test_unset_httpheader(self): + io = util.BytesIO() + self.curl.setopt(self.curl.WRITEDATA, io) + self.curl.perform() +- self.assertEquals(util.b('foo'), io.getvalue()) ++ self.assertEqual(util.b('foo'), io.getvalue()) + + self.curl.unsetopt(self.curl.HTTPHEADER) + io = util.BytesIO() + self.curl.setopt(self.curl.WRITEDATA, io) + self.curl.perform() +- self.assertEquals(util.b(''), io.getvalue()) ++ self.assertEqual(util.b(''), io.getvalue()) + + def test_set_httpheader_none(self): + self.curl.setopt(self.curl.HTTPHEADER, ('x-test: foo',)) +@@ -72,13 +72,13 @@ def test_set_httpheader_none(self): + io = util.BytesIO() + self.curl.setopt(self.curl.WRITEDATA, io) + self.curl.perform() +- self.assertEquals(util.b('foo'), io.getvalue()) ++ self.assertEqual(util.b('foo'), io.getvalue()) + + self.curl.setopt(self.curl.HTTPHEADER, None) + io = util.BytesIO() + self.curl.setopt(self.curl.WRITEDATA, io) + self.curl.perform() +- self.assertEquals(util.b(''), io.getvalue()) ++ self.assertEqual(util.b(''), io.getvalue()) + + @util.min_libcurl(7, 37, 0) + def test_proxyheader_list(self): diff --git a/Include-pytest-in-sdist.patch b/Include-pytest-in-sdist.patch new file mode 100644 index 0000000000000000000000000000000000000000..37c62b404e1a1607029ec4bb5b8ad60d21cee16e --- /dev/null +++ b/Include-pytest-in-sdist.patch @@ -0,0 +1,21 @@ +From 60f2b9a4c5e82428797c3f4d0aa009092edf11dd Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Tue, 17 Aug 2021 20:00:32 -0400 +Subject: [PATCH] Include pytest.ini in sdist + +--- + MANIFEST.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/MANIFEST.in b/MANIFEST.in +index e862aa259..d957246e0 100644 +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -10,6 +10,7 @@ include ChangeLog + include INSTALL.rst + include MANIFEST.in + include Makefile ++include pytest.ini + include README.rst + include RELEASE-NOTES.rst + include doc/*.py diff --git a/backport-failonerror_test-skip-the-test-with-curl-7.75.0+.patch b/backport-failonerror_test-skip-the-test-with-curl-7.75.0+.patch deleted file mode 100644 index d4282078ba3f6cee7abcefcf0c1d081c31ef0765..0000000000000000000000000000000000000000 --- a/backport-failonerror_test-skip-the-test-with-curl-7.75.0+.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a03c4a4ea3fb42b347bada24faae1d31c7d0c90e Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Tue, 1 Jun 2021 16:56:40 +0200 -Subject: [PATCH] failonerror_test: skip the test with curl-7.75.0+ - -libcurl does not provide the reason phrase from HTTP status line -in the error buffer any more: - - https://github.com/curl/curl/issues/6615 - -Fixes: https://github.com/pycurl/pycurl/issues/679 ---- - tests/failonerror_test.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/tests/failonerror_test.py b/tests/failonerror_test.py -index dc4d8cd6b..519aed821 100644 ---- a/tests/failonerror_test.py -+++ b/tests/failonerror_test.py -@@ -21,6 +21,8 @@ def tearDown(self): - # not sure what the actual min is but 7.26 is too old - # and does not include status text, only the status code - @util.min_libcurl(7, 38, 0) -+ # no longer supported by libcurl: https://github.com/curl/curl/issues/6615 -+ @util.removed_in_libcurl(7, 75, 0) - def test_failonerror(self): - self.curl.setopt(pycurl.URL, 'http://%s:8380/status/403' % localhost) - sio = util.BytesIO() -@@ -41,6 +43,8 @@ def test_failonerror(self): - # not sure what the actual min is but 7.26 is too old - # and does not include status text, only the status code - @util.min_libcurl(7, 38, 0) -+ # no longer supported by libcurl: https://github.com/curl/curl/issues/6615 -+ @util.removed_in_libcurl(7, 75, 0) - def test_failonerror_status_line_invalid_utf8_python2(self): - self.curl.setopt(pycurl.URL, 'http://%s:8380/status_invalid_utf8' % localhost) - sio = util.BytesIO() -@@ -61,6 +65,8 @@ def test_failonerror_status_line_invalid_utf8_python2(self): - # not sure what the actual min is but 7.26 is too old - # and does not include status text, only the status code - @util.min_libcurl(7, 38, 0) -+ # no longer supported by libcurl: https://github.com/curl/curl/issues/6615 -+ @util.removed_in_libcurl(7, 75, 0) - def test_failonerror_status_line_invalid_utf8_python3(self): - self.curl.setopt(pycurl.URL, 'http://%s:8380/status_invalid_utf8' % localhost) - sio = util.BytesIO() diff --git a/backport-option_constants_test-skip-check-of-SSLVERSION_SSLv*.patch b/backport-option_constants_test-skip-check-of-SSLVERSION_SSLv*.patch deleted file mode 100644 index 514dac31d6d7e7bddcb97e93283d9c8b96be6b56..0000000000000000000000000000000000000000 --- a/backport-option_constants_test-skip-check-of-SSLVERSION_SSLv*.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 18f1103fb9c6b4dc2233e323e3df1818db25c209 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Thu, 27 May 2021 10:52:09 +0200 -Subject: [PATCH] option_constants_test: skip check of SSLVERSION_SSLv* - -... with curl-7.77.0, where they started to return -CURLE_BAD_FUNCTION_ARGUMENT: - - https://github.com/curl/curl/pull/6773 - -Closes: https://github.com/pycurl/pycurl/pull/689 ---- - tests/option_constants_test.py | 9 ++++++++- - tests/util.py | 15 +++++++++++++++ - 2 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py -index 20228c66f..8b3bd9c69 100644 ---- a/tests/option_constants_test.py -+++ b/tests/option_constants_test.py -@@ -164,9 +164,16 @@ def test_gssapi_delegation_options(self): - def test_sslversion_options(self): - curl = pycurl.Curl() - curl.setopt(curl.SSLVERSION, curl.SSLVERSION_DEFAULT) -+ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1) -+ curl.close() -+ -+ # SSLVERSION_SSLv* return CURLE_BAD_FUNCTION_ARGUMENT with curl-7.77.0 -+ @util.removed_in_libcurl(7, 77, 0) -+ @util.only_ssl -+ def test_legacy_sslversion_options(self): -+ curl = pycurl.Curl() - curl.setopt(curl.SSLVERSION, curl.SSLVERSION_SSLv2) - curl.setopt(curl.SSLVERSION, curl.SSLVERSION_SSLv3) -- curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1) - curl.close() - - @util.min_libcurl(7, 34, 0) -diff --git a/tests/util.py b/tests/util.py -index e12e25152..37ad2f9ab 100644 ---- a/tests/util.py -+++ b/tests/util.py -@@ -122,6 +122,21 @@ def decorated(*args, **kwargs): - - return decorator - -+def removed_in_libcurl(major, minor, patch): -+ import nose.plugins.skip -+ -+ def decorator(fn): -+ @functools.wraps(fn) -+ def decorated(*args, **kwargs): -+ if not pycurl_version_less_than(major, minor, patch): -+ raise nose.plugins.skip.SkipTest('libcurl >= %d.%d.%d' % (major, minor, patch)) -+ -+ return fn(*args, **kwargs) -+ -+ return decorated -+ -+ return decorator -+ - def only_ssl(fn): - import nose.plugins.skip - import pycurl diff --git a/pycurl-7.43.0.6.tar.gz b/pycurl-7.43.0.6.tar.gz deleted file mode 100644 index 587c00ffd1c8aea466314fe2e604433428aa8657..0000000000000000000000000000000000000000 Binary files a/pycurl-7.43.0.6.tar.gz and /dev/null differ diff --git a/pycurl-7.44.1.tar.gz b/pycurl-7.44.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..99cffacc759082b7c2dabaaa3240a05fcb1c078e Binary files /dev/null and b/pycurl-7.44.1.tar.gz differ diff --git a/python-pycurl.spec b/python-pycurl.spec index 3d86f04a85ab4856fba52c1fa9130773e33ec270..67b931a203d24375380da519c9f4d825b89fc8d4 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -6,7 +6,7 @@ %global srcname pycurl Name: python-%{srcname} -Version: 7.43.0.6 +Version: 7.44.1 Release: 2 Summary: A Python interface to libcurl License: LGPLv2+ or MIT @@ -14,8 +14,8 @@ URL: http://pycurl.sourceforge.net/ Source0: %{pypi_source} # drop link-time vs. run-time TLS backend check (#1446850) -Patch6000: backport-option_constants_test-skip-check-of-SSLVERSION_SSLv*.patch -Patch6001: backport-failonerror_test-skip-the-test-with-curl-7.75.0+.patch +Patch6000: Include-pytest-in-sdist.patch +Patch6001: Fix-warnings-when-running-tests.patch BuildRequires: gcc libcurl-devel openssl-devel vsftpd @@ -38,7 +38,7 @@ This package contains development files for %{name} %package -n python3-pycurl Summary: Python interface to libcurl for Python 3 %{?python_provide:%python_provide python3-pycurl} -BuildRequires: python3-devel python3-bottle python3-nose python3-pyflakes +BuildRequires: python3-devel python3-bottle python3-pyflakes python3-pytest Requires: libcurl >= %{libcurl_ver} %description -n python3-pycurl