Skip to content

Commit cc20585

Browse files
auvipyjoeriddles
authored andcommitted
Revert "Feature: urllib3 instead of curl (#2134)" (#2261)
This reverts commit 07c8852.
1 parent 2f2f5d6 commit cc20585

File tree

19 files changed

+473
-521
lines changed

19 files changed

+473
-521
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ omit =
99
*/python?.?/*
1010
*/site-packages/*
1111
*/pypy/*
12-
*kombu/async/http/urllib3_client.py
12+
*kombu/async/http/curl.py
1313
*kombu/five.py
1414
*kombu/transport/mongodb.py
1515
*kombu/transport/filesystem.py

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
python-version: ["3.13"]
2121
steps:
2222
- name: Install system packages
23-
run: sudo apt-get update && sudo apt-get install libssl-dev
23+
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev
2424
- name: Check out code from GitHub
2525
uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
steps:
4040
- name: Install apt packages
4141
if: startsWith(matrix.os, 'blacksmith-4vcpu-ubuntu')
42-
run: sudo apt-get update && sudo apt-get install libssl-dev
42+
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev
4343
- uses: actions/checkout@v4
4444
- name: Set up Python ${{ matrix.python-version }}
4545
uses: useblacksmith/setup-python@v6
@@ -104,7 +104,7 @@ jobs:
104104

105105
steps:
106106
- name: Install apt packages
107-
run: sudo apt-get update && sudo apt-get install libssl-dev
107+
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev
108108

109109
- uses: actions/checkout@v4
110110
- name: Set up Python ${{ matrix.python-version }}

docs/reference/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Kombu Asynchronous
7171
kombu.asynchronous.debug
7272
kombu.asynchronous.http
7373
kombu.asynchronous.http.base
74-
kombu.asynchronous.http.urllib3_client
74+
kombu.asynchronous.http.curl
7575
kombu.asynchronous.aws
7676
kombu.asynchronous.aws.connection
7777
kombu.asynchronous.aws.sqs

docs/reference/kombu.asynchronous.http.urllib3_client.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

kombu/asynchronous/aws/connection.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from vine import promise, transform
99

10-
from kombu.asynchronous.aws.ext import AWSRequest, get_cert_path, get_response
10+
from kombu.asynchronous.aws.ext import AWSRequest, get_response
1111
from kombu.asynchronous.http import Headers, Request, get_client
1212

1313

@@ -92,8 +92,7 @@ def getrequest(self):
9292
headers = Headers(self.headers)
9393
return self.Request(self.path, method=self.method, headers=headers,
9494
body=self.body, connect_timeout=self.timeout,
95-
request_timeout=self.timeout,
96-
validate_cert=True, ca_certs=get_cert_path(True))
95+
request_timeout=self.timeout, validate_cert=False)
9796

9897
def getresponse(self, callback=None):
9998
request = self.getrequest()

kombu/asynchronous/aws/ext.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import boto3
77
from botocore import exceptions
88
from botocore.awsrequest import AWSRequest
9-
from botocore.httpsession import get_cert_path
109
from botocore.response import get_response
1110
except ImportError:
1211
boto3 = None
@@ -20,9 +19,8 @@ class BotoCoreError(Exception):
2019
exceptions.BotoCoreError = BotoCoreError
2120
AWSRequest = _void()
2221
get_response = _void()
23-
get_cert_path = _void()
2422

2523

2624
__all__ = (
27-
'exceptions', 'AWSRequest', 'get_response', 'get_cert_path',
25+
'exceptions', 'AWSRequest', 'get_response'
2826
)

kombu/asynchronous/http/__init__.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
from __future__ import annotations
22

3+
from typing import TYPE_CHECKING
4+
35
from kombu.asynchronous import get_event_loop
4-
from kombu.asynchronous.http.base import BaseClient, Headers, Request, Response
6+
from kombu.asynchronous.http.base import Headers, Request, Response
57
from kombu.asynchronous.hub import Hub
68

7-
__all__ = ('Client', 'Headers', 'Response', 'Request', 'get_client')
9+
if TYPE_CHECKING:
10+
from kombu.asynchronous.http.curl import CurlClient
11+
12+
__all__ = ('Client', 'Headers', 'Response', 'Request')
813

914

10-
def Client(hub: Hub | None = None, **kwargs: int) -> BaseClient:
15+
def Client(hub: Hub | None = None, **kwargs: int) -> CurlClient:
1116
"""Create new HTTP client."""
12-
from .urllib3_client import Urllib3Client
13-
return Urllib3Client(hub, **kwargs)
17+
from .curl import CurlClient
18+
return CurlClient(hub, **kwargs)
1419

1520

16-
def get_client(hub: Hub | None = None, **kwargs: int) -> BaseClient:
21+
def get_client(hub: Hub | None = None, **kwargs: int) -> CurlClient:
1722
"""Get or create HTTP client bound to the current event loop."""
1823
hub = hub or get_event_loop()
1924
try:

kombu/asynchronous/http/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
if TYPE_CHECKING:
1717
from types import TracebackType
1818

19-
__all__ = ('Headers', 'Response', 'Request', 'BaseClient')
19+
__all__ = ('Headers', 'Response', 'Request')
2020

2121
PYPY = hasattr(sys, 'pypy_version_info')
2222

@@ -236,12 +236,6 @@ def header_parser(keyt=normalize_header):
236236

237237

238238
class BaseClient:
239-
"""Base class for HTTP clients.
240-
241-
This class provides the basic structure and functionality for HTTP clients.
242-
Subclasses should implement specific HTTP client behavior.
243-
"""
244-
245239
Headers = Headers
246240
Request = Request
247241
Response = Response

0 commit comments

Comments
 (0)