Skip to content

Commit

Permalink
Merge branch 'main' into devon/poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
devonh authored May 16, 2024
2 parents 0e6af7c + f308a28 commit 852853a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
ref: ${{github.event.pull_request.head.sha}}
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: python -m pip install towncrier
- run: "scripts-dev/check_newsfragment.sh ${{ github.event.number }}"
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- run: python -m pip install -e .
- run: python -m twisted.trial tests

Expand Down
1 change: 1 addition & 0 deletions changelog.d/373.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update docker build and CI workflows to Python 3.11.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###
### Stage 0: builder
###
FROM python:3.10-slim as builder
FROM python:3.11-slim as builder

# Install git; Sygnal uses it to obtain the package version from the state of the
# git repository.
Expand All @@ -25,7 +25,7 @@ RUN pip install --prefix="/install" --no-warn-script-location /sygnal
### Stage 1: runtime
###

FROM python:3.10-slim
FROM python:3.11-slim
COPY --from=builder /install /usr/local

EXPOSE 5000/tcp
Expand Down
11 changes: 8 additions & 3 deletions tests/asyncio_test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import types
from asyncio import AbstractEventLoop, transports
from asyncio.protocols import BaseProtocol, Protocol
from asyncio.protocols import BaseProtocol, BufferedProtocol, Protocol
from asyncio.transports import Transport
from contextvars import Context
from typing import Any, Callable, List, Optional, Tuple
Expand Down Expand Up @@ -164,8 +164,13 @@ def abort(self) -> None:

def pretend_to_receive(self, data: bytes) -> None:
proto = self.get_protocol()
assert isinstance(proto, Protocol)
proto.data_received(data)
if isinstance(proto, Protocol):
proto.data_received(data)
elif isinstance(proto, BufferedProtocol):
data_len = len(data)
b = proto.get_buffer(data_len)
b[0:data_len] = data # type: ignore[index]
proto.buffer_updated(data_len)

def set_protocol(self, protocol: BaseProtocol) -> None:
self.protocol = protocol
Expand Down

0 comments on commit 852853a

Please sign in to comment.