Skip to content

Commit 782e620

Browse files
committed
Update dependencies for python 3.12+ and relock pdm lockfile for inherit_metadata strategy
Signed-off-by: Khakers <[email protected]>
1 parent 6aa98c7 commit 782e620

File tree

9 files changed

+855
-477
lines changed

9 files changed

+855
-477
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
1111
### Breaking
1212
- Completely rewritten blocklist system. Blocklisting now runs off its own mongoDB collection. This once again introduces backwards incompatible schema changes, so a manual migration is required. You may upgrade from both v4.0 and v4.1 using the `[p]migrate blocklist` command. This removes any need to perform the previous migration steps in v4.1.0, you may upgrade directly to this version. After running the command, blocklist functionality will return and legacy config based blocks will have been deleted. You should always back up your config before migration.
1313
- Remove internal logviewer plugin
14+
- Bump Python version to >= 3.12
1415

1516
### Deprecated
1617
- Legacy blocklist properties are deprecated and no longer function. They now log a warning when used and provide no functionality. They have been replaced with methods in blocklist.py
@@ -25,6 +26,8 @@ however, insignificant breaking changes do not guarantee a major version bump, s
2526
- Replace Pipenv with PDM
2627
- Bump discord.py version to 2.3.2
2728
- Rewrote docker build for PDM
29+
- Use Alpine for docker image
30+
- Upgrade dependencies for modern python
2831

2932
### Removed
3033
- Remove Discord.py dependency version check

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.11
1+
ARG PYTHON_VERSION=3.12
22
FROM python:${PYTHON_VERSION}-alpine AS base
33

44
RUN apk update && apk add git \

bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ def hosting_method(self) -> HostingMethod:
167167

168168
def startup(self):
169169
logger.line()
170+
""
170171
logger.info(
171-
"""
172+
r"""
172173
____ __ ___ __ _ __
173174
/ __ \___ ___ ___ / |/ /__ ___/ /_ _ ___ _(_) /
174175
/ /_/ / _ \/ -_) _ \/ /|_/ / _ \/ _ / ' \/ _ `/ / /

core/migrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
logger = getLogger(__name__)
99

10-
old_format_matcher = re.compile("by (\w*#\d{1,4})(?: until <t:(\d*):f>)?.")
10+
old_format_matcher = re.compile(r"by (\w*#\d{1,4})(?: until <t:(\d*):f>)?.")
1111

1212

1313
def _convert_legacy_dict_block_format(

dev.docker-compose.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
services:
22
bot:
33
image: ghcr.io/khakers/openmodmail:develop
4+
restart: no
45
build:
56
context: .
67
dockerfile: Dockerfile
7-
# env_file:
8-
# - .env
8+
args:
9+
INCLUDE_SUPPORTUTILS: true
10+
PYTHON_VERSION: 3.13
11+
# env_file:
12+
# - .env
913
environment:
1014
- CONNECTION_URI=mongodb://mongo
15+
- TOKEN=${DISCORD_BOT_TOKEN}
1116
depends_on:
1217
- mongo
1318

docker-bake.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
target "_common" {
22
args = {
3-
PYTHON_VERSION = "3.11"
3+
PYTHON_VERSION = "3.12"
44
}
55
platforms = ["linux/amd64", "linux/arm64"]
66
}

pdm.lock

Lines changed: 791 additions & 429 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,32 +57,36 @@ gitDescribe = "git describe --tags --dirty"
5757
# Manually sync with pdm sync-pre-commit
5858
[project]
5959
name = "Discord-OpenModmail"
60-
version = "4.2.0"
60+
version = "5.0.0-alpha"
6161
description = "Fork² of a feature rich Discord Modmail bot written in Python."
6262
authors = [
6363
{name = "", email = ""},
6464
]
6565
dependencies = [
66-
"aiohttp~=3.8.1",
66+
"aiohttp~=3.11.16",
6767
"colorama~=0.4.5",
6868
"emoji~=1.7.0",
6969
"isodate~=0.6.0",
70-
"motor~=3.1.2",
70+
# TODO MOTOR is deprecated for PyMongo 4.9+
71+
"motor>=3.7.0",
7172
"natural~=0.2.0",
7273
"parsedatetime~=2.6",
7374
"python-dateutil~=2.8.1",
7475
"python-dotenv~=1.0.0",
75-
"uvloop~=0.17.0; sys_platform != \"win32\"",
76-
"requests~=2.31.0",
76+
"uvloop~=0.21.0; sys_platform != \"win32\"",
77+
"requests>=2.32.0",
7778
"attrs~=23.1.0",
7879
"cairocffi~=1.3.0",
79-
"cffi~=1.15.0",
80+
"cffi>=1.17.1",
8081
"strenum",
8182
"discord-py~=2.3.0",
83+
# required by discord-py for python >= 3.13
84+
# Added as dep in discord-py 2.5.2
85+
"audioop-lts; python_version >= '3.13'",
8286
"setuptools>=69.0.3",
8387
"packaging>=24.1",
8488
]
85-
requires-python = ">=3.10"
89+
requires-python = ">=3.12"
8690
readme = "README.md"
8791
license = {text = "AGPL-3.0-or-later"}
8892
[project.optional-dependencies]
@@ -99,7 +103,7 @@ build-backend = "pdm.backend"
99103
# Run `pre-commit install` automatically if applicable
100104
automaticall-install-hooks = true
101105
# Should we sync your pre-commit versions with your lockfile (when running lock, add, update, remove, etc.)?
102-
disable-sync-from-lock = false
106+
disable-sync-from-lock = true
103107
# Packages to ignore when syncing from lock
104108
ignore = []
105109
# Name of the pre-commit config file to sync with
@@ -112,5 +116,4 @@ dev = [
112116
"tomli",
113117
"typing-extensions==4.6.3",
114118
"pre-commit",
115-
"utils @ git+https://github.com/Jerrie-Aries/modmail-plugins.git@master#subdirectory=utils",
116119
]

requirements.txt

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,54 @@
11
# This file is @generated by PDM.
22
# Please do not edit it manually.
33

4-
aiohttp==3.8.6
5-
aiosignal==1.3.1
6-
async-timeout==4.0.3
4+
aiohappyeyeballs==2.6.1
5+
aiohttp==3.11.16
6+
aiosignal==1.3.2
77
attrs==23.1.0
8-
black==24.4.2
8+
audioop-lts==0.2.1; python_version >= "3.13"
9+
black==25.1.0
910
cairocffi==1.3.0
10-
certifi==2023.7.22
11-
cffi==1.15.1
11+
certifi==2025.1.31
12+
cffi==1.17.1
1213
cfgv==3.4.0
13-
charset-normalizer==3.3.2
14-
click==8.1.7
14+
charset-normalizer==3.4.1
15+
click==8.1.8
1516
colorama==0.4.6
1617
discord-py==2.3.2
17-
distlib==0.3.7
18-
dnspython==2.4.2
18+
distlib==0.3.9
19+
dnspython==2.7.0
1920
emoji==1.7.0
20-
filelock==3.13.1
21-
frozenlist==1.4.0
22-
identify==2.5.31
23-
idna==3.4
21+
filelock==3.18.0
22+
frozenlist==1.5.0
23+
identify==2.6.9
24+
idna==3.10
2425
isodate==0.6.1
25-
motor==3.1.2
26-
multidict==6.0.4
26+
motor==3.7.0
27+
multidict==6.3.2
2728
mypy-extensions==1.0.0
2829
natural==0.2.0
29-
nodeenv==1.8.0
30-
packaging==24.1
30+
nodeenv==1.9.1
31+
packaging==24.2
3132
parsedatetime==2.6
32-
pathspec==0.11.2
33-
platformdirs==3.11.0
34-
pre-commit==3.5.0
35-
pycparser==2.21
36-
pymongo==4.6.0
33+
pathspec==0.12.1
34+
platformdirs==4.3.7
35+
pre-commit==4.2.0
36+
propcache==0.3.1
37+
pycparser==2.22
38+
pymongo==4.11.3
3739
python-dateutil==2.8.2
38-
python-dotenv==1.0.0
39-
pyyaml==6.0.1
40-
requests==2.31.0
41-
ruff==0.4.9
42-
setuptools==69.0.3
43-
six==1.16.0
40+
python-dotenv==1.0.1
41+
pyyaml==6.0.2
42+
requests==2.32.3
43+
ruff==0.11.4
44+
setuptools==78.1.0
45+
six==1.17.0
4446
strenum==0.4.15
45-
tomli==2.0.1
47+
tomli==2.2.1
4648
typing-extensions==4.6.3
47-
urllib3==2.0.7
48-
virtualenv==20.24.6
49-
yarl==1.9.2
49+
urllib3==2.3.0
50+
utils @ git+https://github.com/Jerrie-Aries/modmail-plugins.git@0d7ad9c5611d8649022557d5d55848c6ba6f4d4b#subdirectory=utils
51+
uvloop==0.21.0; sys_platform != "win32"
52+
virtualenv==20.30.0
53+
yarl==1.18.3
5054
--index-url https://pypi.org/simple

0 commit comments

Comments
 (0)