diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5f8579a..10d72ba 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,7 +14,7 @@ jobs: uses: OpenTTD/actions/.github/workflows/rw-entry-testing-docker-py.yml@v5 with: python-path: master_server - python-version: 3.8 + python-version: 3.11 regression: name: Regression @@ -23,10 +23,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Set up packages shell: bash diff --git a/Dockerfile b/Dockerfile index b63d2f1..98292b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim +FROM python:3.11-slim ARG BUILD_DATE="" ARG BUILD_VERSION="dev" diff --git a/README.md b/README.md index 11ded76..62eadab 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ These are in a single repository, as they share the same database access. ## Development -The `master_server` and `web_api` are written in Python 3.8, and makes strong use of asyncio and aiohttp. +The `master_server` and `web_api` are written in Python 3.11, and makes strong use of asyncio and aiohttp. Both make use of the AWS DynamoDB database to store the known servers. @@ -19,7 +19,7 @@ Both make use of the AWS DynamoDB database to store the known servers. #### Dependencies -- Python3.8 or higher. +- Python3.11 or higher. - Docker #### Preparing your venv diff --git a/master_server/database/redis.py b/master_server/database/redis.py index 5c895a9..a9d1744 100644 --- a/master_server/database/redis.py +++ b/master_server/database/redis.py @@ -1,4 +1,3 @@ -import aioredis import click import hashlib import ipaddress @@ -6,6 +5,7 @@ import logging from openttd_helpers import click_helper +from redis import asyncio as aioredis from .interface import DatabaseInterface diff --git a/master_server/openttd/test_receive.py b/master_server/openttd/test_receive.py index 2f1fec1..224d191 100644 --- a/master_server/openttd/test_receive.py +++ b/master_server/openttd/test_receive.py @@ -28,7 +28,7 @@ def test_receive_packet_success(data, result): [ (b"\x05\x00\x06\x01", PacketInvalidSize), (b"\x03\x00\x06\x01", PacketInvalidSize), - (b"\x03\x00\xFF", PacketInvalidType), + (b"\x03\x00\xff", PacketInvalidType), (b"\x03\x00\x00", PacketInvalidType), ], ) @@ -68,8 +68,8 @@ def test_receive_PACKET_UDP_CLIENT_GET_LIST_success(ip, data, result): b"", b"\x02", # Too much data - b"\x01\xFF", - b"\x02\x00\xFF", + b"\x01\xff", + b"\x02\x00\xff", # Invalid version number b"\x00", b"\x03", @@ -103,8 +103,8 @@ def test_receive_PACKET_UDP_SERVER_REGISTER_success(data, result): b"OpenTTDRegister\x00\x01\x34", b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00", # Too much data - b"OpenTTDRegister\x00\x01\x34\x12\xFF", - b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00\x00\xFF", + b"OpenTTDRegister\x00\x01\x34\x12\xff", + b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00\x00\xff", # Invalid version number b"OpenTTDRegister\x00\x00\x34\x12", b"OpenTTDRegister\x00\x03\x34\x12", @@ -138,8 +138,8 @@ def test_receive_PACKET_UDP_SERVER_UNREGISTER_success(data, result): b"\x01\x34", b"\x02\x34", # Too much data - b"\x01\x34\x12\xFF", - b"\x02\x34\x12\xFF", + b"\x01\x34\x12\xff", + b"\x02\x34\x12\xff", # Invalid version number b"\x00\x34\x12", b"\x03\x34\x12", diff --git a/requirements.base b/requirements.base index 9e098ec..a3a80d6 100644 --- a/requirements.base +++ b/requirements.base @@ -1,8 +1,8 @@ aiohttp -aioredis click hiredis sentry-sdk openttd-helpers pproxy PynamoDB +redis diff --git a/requirements.txt b/requirements.txt index bb04006..73b3c29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,22 @@ -aiohttp==3.9.5 -aioredis==2.0.1 -aiosignal==1.3.1 -async-timeout==4.0.3 -attrs==23.2.0 -botocore==1.34.137 -certifi==2024.6.2 -charset-normalizer==3.3.2 -click==8.1.7 -frozenlist==1.4.1 -hiredis==2.3.2 -idna==3.7 +aiohappyeyeballs==2.4.6 +aiohttp==3.11.12 +aiosignal==1.3.2 +attrs==25.1.0 +botocore==1.36.21 +certifi==2025.1.31 +click==8.1.8 +frozenlist==1.5.0 +hiredis==3.1.0 +idna==3.10 jmespath==1.0.1 -multidict==6.0.5 +multidict==6.1.0 openttd-helpers==1.4.0 pproxy==2.7.9 -pynamodb==6.0.1 +propcache==0.2.1 +pynamodb==6.0.2 python-dateutil==2.9.0.post0 -sentry-sdk==2.7.1 -six==1.16.0 -typing_extensions==4.12.2 -urllib3==1.26.19 -yarl==1.9.4 +redis==5.2.1 +sentry-sdk==2.21.0 +six==1.17.0 +urllib3==2.3.0 +yarl==1.18.3