Skip to content

Commit ef984d3

Browse files
committed
LITE-31450: Support httpx 0.28, add Python 3.12 to test matrix, bump deps
1 parent 5e7cdec commit ef984d3

File tree

6 files changed

+274
-257
lines changed

6 files changed

+274
-257
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
timeout-minutes: 10
1616
strategy:
1717
matrix:
18-
python-version: ["3.9", "3.10", "3.11"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1919
steps:
2020
- uses: actions/checkout@v3
2121
with:
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install poetry
31-
poetry install
31+
poetry install --all-groups
3232
- name: Linting
3333
run: |
3434
poetry run flake8
@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
python -m pip install --upgrade pip
5252
pip install poetry
53-
poetry install
53+
poetry install --all-groups
5454
- name: Generate coverage report
5555
run: |
5656
poetry run pytest

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
python -m pip install --upgrade pip
2020
pip install poetry
21-
poetry install
21+
poetry install --all-groups
2222
- name: Linting
2323
run: |
2424
poetry run flake8

connect/eaas/runner/helpers.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,17 @@ def notify_process_restarted(process_type):
224224

225225

226226
def iter_entry_points(group, name=None):
227-
group_entrypoints = entry_points().get(group)
228-
if not group_entrypoints:
229-
return
230-
for ep in group_entrypoints:
231-
if name:
232-
if ep.name == name:
233-
yield ep
234-
else:
227+
eps = entry_points()
228+
229+
# Support for Python 3.10+ where .select() is available
230+
if hasattr(eps, 'select'):
231+
matches = eps.select(group=group)
232+
else:
233+
# Older versions (pre-3.10)
234+
matches = eps.get(group, [])
235+
236+
for ep in matches:
237+
if name is None or ep.name == name:
235238
yield ep
236239

237240

connect/eaas/runner/workers/web.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class WebWorker(WorkerBase):
3939
the server and wait for tasks that need to be processed using
4040
the tasks manager.
4141
"""
42+
def __init__(self, *args, **kwargs):
43+
super().__init__(*args, **kwargs)
44+
self._httpx_app_transport = httpx.ASGITransport(app=self.handler.app)
4245

4346
def get_url(self):
4447
return self.config.get_webapp_ws_url()
@@ -86,7 +89,7 @@ async def process_task(self, task):
8689
message = None
8790
try:
8891
async with httpx.AsyncClient(
89-
app=self.handler.app, base_url='http://localhost',
92+
base_url='http://localhost', transport=self._httpx_app_transport,
9093
) as client:
9194
body = (
9295
base64.decodebytes(task.request.content.encode('utf-8'))

0 commit comments

Comments
 (0)