8 Commits

Author SHA256 Message Date
ffaf135edc Accepting request 1229355 from devel:languages:python
- Switch to %pyproject_*.

OBS-URL: https://build.opensuse.org/request/show/1229355
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pycurl?expand=0&rev=49
2024-12-10 22:43:03 +00:00
c0fada6647 Switch off services
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=114
2024-12-09 11:12:04 +00:00
cfc61e9bab Fix macro
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=113
2024-12-09 09:39:44 +00:00
b27bb314ff - Switch to %pyproject_*.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=112
2024-12-09 09:39:18 +00:00
f169947e72 Accepting request 1205723 from devel:languages:python
- Switching off test_multi_ tests, they are just too
  unrealiable. When running the test cycle in cycle I have never
  managed to make it pass ten times without this change.

OBS-URL: https://build.opensuse.org/request/show/1205723
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pycurl?expand=0&rev=48
2024-10-06 15:51:39 +00:00
32aec400c7 - Switching off test_multi_ tests, they are just too
unrealiable. When running the test cycle in cycle I have never
  managed to make it pass ten times without this change.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=110
2024-10-04 14:29:20 +00:00
44a08c916c Accepting request 1202901 from devel:languages:python
- Add upstream patch test-bottle-flask.patch to use Flask instead of
  bottle for tests.
  gh#pycurl/pycurl#838

OBS-URL: https://build.opensuse.org/request/show/1202901
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pycurl?expand=0&rev=47
2024-09-25 19:52:39 +00:00
3ea19cb85b - Add upstream patch test-bottle-flask.patch to use Flask instead of
bottle for tests.
  gh#pycurl/pycurl#838

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=108
2024-09-24 10:48:42 +00:00
8 changed files with 241 additions and 110 deletions

View File

@@ -1,15 +1,15 @@
<services>
<service name="obs_scm" mode="disabled">
<service name="obs_scm" mode="manual">
<param name="versionprefix">7.45.3+git</param>
<param name="url">https://github.com/pycurl/pycurl.git</param>
<param name="scm">git</param>
<param name="revision">main</param>
<param name="changesgenerate">enable</param>
</service>
<service name="tar" mode="disabled"/>
<service name="recompress" mode="disabled">
<service name="tar" mode="manual"/>
<service name="recompress" mode="manual">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled" />
<service name="set_version" mode="manual" />
</services>

View File

@@ -1,28 +0,0 @@
From eb7f52eeef85feb6c117678d52803050bbdd7bc8 Mon Sep 17 00:00:00 2001
From: Carlos Henrique Lima Melara <charlesmelara@riseup.net>
Date: Thu, 28 Aug 2025 20:37:33 -0300
Subject: [PATCH] tests: handle change in debug output in curl 8.16.0
Debug message has changed and so the assert in the test is failing.
Handle this by checking the version to pick the expected string to
compare in the test.
---
tests/debug_test.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: pycurl-7.45.6/tests/debug_test.py
===================================================================
--- pycurl-7.45.6.orig/tests/debug_test.py
+++ pycurl-7.45.6/tests/debug_test.py
@@ -34,8 +34,10 @@ class DebugTest(unittest.TestCase):
self.check(0, util.b('Trying'))
if util.pycurl_version_less_than(7, 24):
self.check(0, util.b('connected'))
- else:
+ elif util.pycurl_version_less_than(8, 16):
self.check(0, util.b('Connected to %s' % localhost))
+ else:
+ self.check(0, util.b('Established connection to %s' % localhost))
self.check(0, util.b('port 8380'))
# request
self.check(2, util.b('GET /success HTTP/1.1'))

BIN
pycurl-7.45.3.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2b73e66b22719ea48ac08a93fc88e57ef36d46d03cb09d972063c9aa86bb74e6
size 239470

View File

@@ -1,42 +1,3 @@
-------------------------------------------------------------------
Thu Nov 6 16:51:52 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- fix build with libcurl >= 8.17.0 boo#1253116
skip_kerberos_tests_on_libcurl_8_17_0.patch
-------------------------------------------------------------------
Fri Sep 12 06:19:06 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Add patch handle-change-debug-curl-8.16.0.patch (bsc#1249448, gh#pycurl/pycurl@eb7f52eeef85)
- Drop patch test-bottle-flask.patch, not needed anymore
- Update to 7.45.6:
* Re-enable building Linux wheels with CA bundle autodetection
- 7.45.5
* Enable GSS-API and brotli support in wheels (patch by Scott Talbert).
* Add support for calling getinfo with CURLOPT_*_T arguments
(patch by Scott Talbert)
* Change wheels to build using shared libraries (vice static libraries)
(patch by Scott Talbert)
* Build wheels with curl 8.12.1 (mainly for security fixes)
- 7.45.4
* Add support for CURLOPT_HAPROXY_CLIENT_IP (patch by Scott Talbert).
* Port tests from bottle to flask (patch by Miro Hrončok).
* Add constant for CURL_HTTP_VERSION_3ONLY (patch by Pavel Horáček).
* Add EFFECTIVE_METHOD info option (patch by Pavel Horáček).
* Don't use `-flat_namespace` on macOS (patch by Michael Cho).
* Add some missing GIL checks to callback functions
(patch by Scott Talbert).
* Fix assorted bugs in pycurl tests, including a segfault
(patch by Scott Talbert). All tests should now pass on Linux and
macOS.
* Fix minor bug in examples/multi-socket_action-select.py
(patch by Oleg Broytman).
* Build all wheels using the latest version of libcurl and its
dependencies (patch by Scott Talbert). All wheels should now have
openssl, HTTP2, and SSH support.
* Implement Certificate Authority path autodetection when building
Linux wheels (patch by Scott Talbert).
-------------------------------------------------------------------
Mon Dec 9 09:38:48 UTC 2024 - Matej Cepl <mcepl@cepl.eu>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pycurl
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -27,7 +27,7 @@
%endif
%{?sle15_python_module_pythons}
Name: python-pycurl%{psuffix}
Version: 7.45.6
Version: 7.45.3
%global upversion %{version}
Release: 0
Summary: PycURL -- cURL library module
@@ -43,10 +43,8 @@ Patch2: disable_randomly_failing_tests.patch
# PATCH-FIX-OPENSUSE make-leap15-compat.patch mcepl@suse.com
# Make tests passing with Leap 15.2
Patch3: make-leap15-compat.patch
# PATCH-FIX-UPSTREAM handle-change-debug-curl-8.16.0.patch gh#pycurl/pycurl@eb7f52eeef85
Patch4: handle-change-debug-curl-8.16.0.patch
# PATCH-FIX-UPSTREAM skip_kerberos_tests_on_libcurl_8_17_0.patch gh#pycurl/pycurl@33bf92f
Patch5: skip_kerberos_tests_on_libcurl_8_17_0.patch
# PATCH-FIX-UPSTREAM test-bottle-flask.patch gh#pycurl/pycurl#838
Patch4: test-bottle-flask.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}

View File

@@ -1,30 +0,0 @@
From ea92e3ca230a3ff3d464cb6816102fa157177aca Mon Sep 17 00:00:00 2001
From: Jacek Migacz <jmigacz@redhat.com>
Date: Fri, 17 Oct 2025 13:55:48 +0200
Subject: [PATCH] Skip Kerberos tests on libcurl >= 8.17.0
CURLOPT_KRBLEVEL and CURLOPT_KRB4LEVEL were removed in libcurl
8.17.0 and now return CURLE_NOT_BUILT_IN.
---
tests/option_constants_test.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py
index 1dd862c39..de1b08012 100644
--- a/tests/option_constants_test.py
+++ b/tests/option_constants_test.py
@@ -502,12 +502,14 @@ def test_ssl_sessionid_cache(self):
curl.setopt(curl.SSL_SESSIONID_CACHE, True)
curl.close()
+ @util.removed_in_libcurl(8, 17, 0)
@util.only_gssapi
def test_krblevel(self):
curl = pycurl.Curl()
curl.setopt(curl.KRBLEVEL, 'clear')
curl.close()
+ @util.removed_in_libcurl(8, 17, 0)
@util.only_gssapi
def test_krb4level(self):
curl = pycurl.Curl()

230
test-bottle-flask.patch Normal file
View File

@@ -0,0 +1,230 @@
Index: pycurl-7.45.3/README.rst
===================================================================
--- pycurl-7.45.3.orig/README.rst
+++ pycurl-7.45.3/README.rst
@@ -89,7 +89,7 @@ PycURL comes with an automated test suit
make test
-The suite depends on packages `pytest`_ and `bottle`_, as well as `vsftpd`_.
+The suite depends on packages `pytest`_ and `flask`_, as well as `vsftpd`_.
Some tests use vsftpd configured to accept anonymous uploads. These tests
are not run by default. As configured, vsftpd will allow reads and writes to
@@ -103,7 +103,7 @@ vsftpd tests you must explicitly set PYC
export PYCURL_VSFTPD_PATH=/usr/local/libexec/vsftpd
.. _pytest: https://pytest.org/
-.. _bottle: http://bottlepy.org/
+.. _flask: https://flask.palletsprojects.com/
.. _vsftpd: http://vsftpd.beasts.org/
Index: pycurl-7.45.3/requirements-dev.txt
===================================================================
--- pycurl-7.45.3.orig/requirements-dev.txt
+++ pycurl-7.45.3/requirements-dev.txt
@@ -1,7 +1,5 @@
-# bottle 0.12.17 changed behavior
-# https://github.com/pycurl/pycurl/issues/573
-bottle
flaky
+flask
pyflakes
pytest>=5
sphinx
Index: pycurl-7.45.3/tests/app.py
===================================================================
--- pycurl-7.45.3.orig/tests/app.py
+++ pycurl-7.45.3/tests/app.py
@@ -2,7 +2,7 @@
# vi:ts=4:et
import time as _time, sys
-import bottle
+import flask
try:
import json
except ImportError:
@@ -10,7 +10,7 @@ except ImportError:
py3 = sys.version_info[0] == 3
-app = bottle.Bottle()
+app = flask.Flask(__name__)
app.debug = True
@app.route('/success')
@@ -24,62 +24,47 @@ def short_wait():
@app.route('/status/403')
def forbidden():
- return bottle.HTTPResponse('forbidden', 403)
+ return flask.Response('forbidden', 403)
@app.route('/status/404')
def not_found():
- return bottle.HTTPResponse('not found', 404)
+ return flask.Response('not found', 404)
-@app.route('/postfields', method='get')
-@app.route('/postfields', method='post')
+@app.route('/postfields', methods=['GET', 'POST'])
def postfields():
- return json.dumps(dict(bottle.request.forms))
+ return json.dumps(dict(flask.request.form))
-@app.route('/raw_utf8', method='post')
+@app.route('/raw_utf8', methods=['POST'])
def raw_utf8():
- data = bottle.request.body.getvalue().decode('utf8')
+ data = flask.request.data.decode('utf8')
return json.dumps(data)
-# XXX file is not a bottle FileUpload instance, but FieldStorage?
def xconvert_file(key, file):
return {
'key': key,
'name': file.name,
- 'raw_filename': file.raw_filename,
+ 'filename': file.filename,
'headers': file.headers,
'content_type': file.content_type,
'content_length': file.content_length,
'data': file.read(),
}
-if hasattr(bottle, 'FileUpload'):
- # bottle 0.12
- def convert_file(key, file):
- return {
- 'name': file.name,
- # file.filename lowercases the file name
- # https://github.com/defnull/bottle/issues/582
- # raw_filenames is a string on python 3
- 'filename': file.raw_filename,
- 'data': file.file.read().decode(),
- }
-else:
- # bottle 0.11
- def convert_file(key, file):
- return {
- 'name': file.name,
- 'filename': file.filename,
- 'data': file.file.read().decode(),
- }
+def convert_file(key, file):
+ return {
+ 'name': file.name,
+ 'filename': file.filename,
+ 'data': file.read().decode(),
+ }
-@app.route('/files', method='post')
+@app.route('/files', methods=['POST'])
def files():
- files = [convert_file(key, bottle.request.files[key]) for key in bottle.request.files]
+ files = [convert_file(key, flask.request.files[key]) for key in flask.request.files]
return json.dumps(files)
@app.route('/header')
def header():
- return bottle.request.headers.get(bottle.request.query['h'], '')
+ return flask.request.headers.get(flask.request.args['h'], '')
# This is a hacky endpoint to test non-ascii text being given to libcurl
# via headers.
@@ -89,7 +74,7 @@ def header():
# Thanks to bdarnell for the idea: https://github.com/pycurl/pycurl/issues/124
@app.route('/header_utf8')
def header_utf8():
- header_value = bottle.request.headers.get(bottle.request.query['h'], '' if py3 else b'')
+ header_value = flask.request.headers.get(flask.request.args['h'], '' if py3 else b'')
if py3:
# header_value is a string, headers are decoded in latin1
header_value = header_value.encode('latin1').decode('utf8')
@@ -98,13 +83,9 @@ def header_utf8():
header_value = header_value.decode('utf8')
return header_value
-@app.route('/param_utf8_hack', method='post')
+@app.route('/param_utf8_hack', methods=['POST'])
def param_utf8_hack():
- param = bottle.request.forms['p']
- if py3:
- # python 3 decodes bytes as latin1 perhaps?
- # apply the latin1-utf8 hack
- param = param.encode('latin').decode('utf8')
+ param = flask.request.form['p']
return param
def pause_writer(interval):
@@ -127,19 +108,25 @@ def utf8_body():
@app.route('/invalid_utf8_body')
def invalid_utf8_body():
- # bottle encodes the body
- raise bottle.HTTPResponse(b'\xb3\xd2\xda\xcd\xd7', 200)
+ return flask.Response(b'\xb3\xd2\xda\xcd\xd7', 200)
@app.route('/set_cookie_invalid_utf8')
def set_cookie_invalid_utf8():
- bottle.response.set_header('Set-Cookie', '\xb3\xd2\xda\xcd\xd7=%96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A')
- return 'cookie set'
+ response = flask.Response('cookie set')
+ # WARNING: The original bottle test passed '\xb3\xd2\xda\xcd\xd7...' as string
+ # Presumably bottle encoded that as utf-8 in the response.
+ # Flask on the other hand encodes such strings as latin-1 (chars in == bytes out).
+ # In order to make the test pass I replicate the original bottle behavior by utf-8->latin1 roundtrip.
+ response.headers['Set-Cookie'] = '\xb3\xd2\xda\xcd\xd7=%96%A6g%9Ay%B0%A5g%A7tm%7C%95%9A'.encode('utf-8').decode('latin-1')
+ return response
@app.route('/content_type_invalid_utf8')
def content_type_invalid_utf8():
- bottle.response.set_header('Content-Type', '\xb3\xd2\xda\xcd\xd7')
- return 'content type set'
+ response = flask.Response('content type set')
+ # See the WARNING in set_cookie_invalid_utf8
+ response.headers['Content-Type'] = '\xb3\xd2\xda\xcd\xd7'.encode('utf-8').decode('latin-1')
+ return response
@app.route('/status_invalid_utf8')
def status_invalid_utf8():
- raise bottle.HTTPResponse('status set', '555 \xb3\xd2\xda\xcd\xd7')
+ raise flask.Response('status set', b'555 \xb3\xd2\xda\xcd\xd7')
Index: pycurl-7.45.3/tests/runwsgi.py
===================================================================
--- pycurl-7.45.3.orig/tests/runwsgi.py
+++ pycurl-7.45.3/tests/runwsgi.py
@@ -1,6 +1,5 @@
# Run a WSGI application in a daemon thread
-import bottle
import threading
import os.path
@@ -8,7 +7,14 @@ from . import util
global_stop = False
-class Server(bottle.WSGIRefServer):
+class Server:
+ quiet = False
+
+ def __init__(self, host, port, **options):
+ self.options = options
+ self.host = host
+ self.port = int(port)
+
def run(self, handler): # pragma: no cover
self.srv = self.make_server(handler)
self.serve()
@@ -66,7 +72,7 @@ class ServerThread(threading.Thread):
self.server = server(host='127.0.0.1', port=self.port, **self.server_kwargs)
def run(self):
- bottle.run(self.app, server=self.server, quiet=True)
+ self.server.run(self.app)
started_servers = {}