diff --git a/.github/workflows/changelog_check.yml b/.github/workflows/changelog_check.yml index a8d592b1..a18212c9 100644 --- a/.github/workflows/changelog_check.yml +++ b/.github/workflows/changelog_check.yml @@ -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 }}" diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0bf75ee7..90e00ac5 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -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 diff --git a/changelog.d/373.misc b/changelog.d/373.misc new file mode 100644 index 00000000..bfec9b82 --- /dev/null +++ b/changelog.d/373.misc @@ -0,0 +1 @@ +Update docker build and CI workflows to Python 3.11. diff --git a/docker/Dockerfile b/docker/Dockerfile index 0b37cc3f..38b5f578 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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. @@ -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 diff --git a/tests/asyncio_test_helpers.py b/tests/asyncio_test_helpers.py index 32dc7d94..6bd5dc91 100644 --- a/tests/asyncio_test_helpers.py +++ b/tests/asyncio_test_helpers.py @@ -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 @@ -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