Skip to content

Commit 2371f84

Browse files
authored
Upgrade: Bump Python to 3.11 (#316)
This includes a dependency-bump, as it might add/remove polyfill libraries
1 parent 4fc7f83 commit 2371f84

File tree

7 files changed

+33
-34
lines changed

7 files changed

+33
-34
lines changed

.github/workflows/testing.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: OpenTTD/actions/.github/workflows/rw-entry-testing-docker-py.yml@v5
1515
with:
1616
python-path: master_server
17-
python-version: 3.8
17+
python-version: 3.11
1818

1919
regression:
2020
name: Regression
@@ -23,10 +23,10 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525

26-
- name: Set up Python 3.8
26+
- name: Set up Python 3.11
2727
uses: actions/setup-python@v5
2828
with:
29-
python-version: 3.8
29+
python-version: 3.11
3030

3131
- name: Set up packages
3232
shell: bash

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.8-slim
1+
FROM python:3.11-slim
22

33
ARG BUILD_DATE=""
44
ARG BUILD_VERSION="dev"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ These are in a single repository, as they share the same database access.
1111

1212
## Development
1313

14-
The `master_server` and `web_api` are written in Python 3.8, and makes strong use of asyncio and aiohttp.
14+
The `master_server` and `web_api` are written in Python 3.11, and makes strong use of asyncio and aiohttp.
1515

1616
Both make use of the AWS DynamoDB database to store the known servers.
1717

1818
### Running a local server
1919

2020
#### Dependencies
2121

22-
- Python3.8 or higher.
22+
- Python3.11 or higher.
2323
- Docker
2424

2525
#### Preparing your venv

master_server/database/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import aioredis
21
import click
32
import hashlib
43
import ipaddress
54
import json
65
import logging
76

87
from openttd_helpers import click_helper
8+
from redis import asyncio as aioredis
99

1010
from .interface import DatabaseInterface
1111

master_server/openttd/test_receive.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_receive_packet_success(data, result):
2828
[
2929
(b"\x05\x00\x06\x01", PacketInvalidSize),
3030
(b"\x03\x00\x06\x01", PacketInvalidSize),
31-
(b"\x03\x00\xFF", PacketInvalidType),
31+
(b"\x03\x00\xff", PacketInvalidType),
3232
(b"\x03\x00\x00", PacketInvalidType),
3333
],
3434
)
@@ -68,8 +68,8 @@ def test_receive_PACKET_UDP_CLIENT_GET_LIST_success(ip, data, result):
6868
b"",
6969
b"\x02",
7070
# Too much data
71-
b"\x01\xFF",
72-
b"\x02\x00\xFF",
71+
b"\x01\xff",
72+
b"\x02\x00\xff",
7373
# Invalid version number
7474
b"\x00",
7575
b"\x03",
@@ -103,8 +103,8 @@ def test_receive_PACKET_UDP_SERVER_REGISTER_success(data, result):
103103
b"OpenTTDRegister\x00\x01\x34",
104104
b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00",
105105
# Too much data
106-
b"OpenTTDRegister\x00\x01\x34\x12\xFF",
107-
b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00\x00\xFF",
106+
b"OpenTTDRegister\x00\x01\x34\x12\xff",
107+
b"OpenTTDRegister\x00\x02\x34\x12\x01\x00\x00\x00\x00\x00\x00\x00\xff",
108108
# Invalid version number
109109
b"OpenTTDRegister\x00\x00\x34\x12",
110110
b"OpenTTDRegister\x00\x03\x34\x12",
@@ -138,8 +138,8 @@ def test_receive_PACKET_UDP_SERVER_UNREGISTER_success(data, result):
138138
b"\x01\x34",
139139
b"\x02\x34",
140140
# Too much data
141-
b"\x01\x34\x12\xFF",
142-
b"\x02\x34\x12\xFF",
141+
b"\x01\x34\x12\xff",
142+
b"\x02\x34\x12\xff",
143143
# Invalid version number
144144
b"\x00\x34\x12",
145145
b"\x03\x34\x12",

requirements.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
aiohttp
2-
aioredis
32
click
43
hiredis
54
sentry-sdk
65
openttd-helpers
76
pproxy
87
PynamoDB
8+
redis

requirements.txt

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
aiohttp==3.9.5
2-
aioredis==2.0.1
3-
aiosignal==1.3.1
4-
async-timeout==4.0.3
5-
attrs==23.2.0
6-
botocore==1.34.137
7-
certifi==2024.6.2
8-
charset-normalizer==3.3.2
9-
click==8.1.7
10-
frozenlist==1.4.1
11-
hiredis==2.3.2
12-
idna==3.7
1+
aiohappyeyeballs==2.4.6
2+
aiohttp==3.11.12
3+
aiosignal==1.3.2
4+
attrs==25.1.0
5+
botocore==1.36.21
6+
certifi==2025.1.31
7+
click==8.1.8
8+
frozenlist==1.5.0
9+
hiredis==3.1.0
10+
idna==3.10
1311
jmespath==1.0.1
14-
multidict==6.0.5
12+
multidict==6.1.0
1513
openttd-helpers==1.4.0
1614
pproxy==2.7.9
17-
pynamodb==6.0.1
15+
propcache==0.2.1
16+
pynamodb==6.0.2
1817
python-dateutil==2.9.0.post0
19-
sentry-sdk==2.7.1
20-
six==1.16.0
21-
typing_extensions==4.12.2
22-
urllib3==1.26.19
23-
yarl==1.9.4
18+
redis==5.2.1
19+
sentry-sdk==2.21.0
20+
six==1.17.0
21+
urllib3==2.3.0
22+
yarl==1.18.3

0 commit comments

Comments
 (0)