Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for python 3.8 & add 3.13 #929

Merged
merged 7 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: poetry_setup
uses: ItsDrike/setup-poetry@v1
with:
python-version: 3.12
python-version: 3.13
install-args: "--with release"

- name: Prepare pyproject.toml with dynamic version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false # Allows for matrix sub-jobs to fail without cancelling the rest
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.12"]
python-version: ["3.9", "3.13"]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: poetry_setup
uses: ItsDrike/setup-poetry@v1
with:
python-version: 3.12
python-version: 3.13

- name: Pre-commit Environment Caching
uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions docs/examples/code/ping_as_java_and_bedrock_in_one_time.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import asyncio

from mcstatus import BedrockServer, JavaServer
Expand Down
3 changes: 2 additions & 1 deletion mcstatus/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import socket
import dataclasses
from typing import TYPE_CHECKING
from typing_extensions import TypeAlias

from mcstatus import JavaServer, BedrockServer
from mcstatus.responses import JavaStatusResponse
from mcstatus.motd import Motd

if TYPE_CHECKING:
SupportedServers = JavaServer | BedrockServer
SupportedServers: TypeAlias = "JavaServer | BedrockServer"


def _motd(motd: Motd) -> str:
Expand Down
149 changes: 74 additions & 75 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Games/Entertainment",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
Expand All @@ -30,7 +30,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.8.1,<4"
python = ">=3.9,<4"
asyncio-dgram = "^2.1.2"
dnspython = "^2.4.2"

Expand Down Expand Up @@ -92,7 +92,7 @@ enable = true
style = "pep440"

[tool.ruff]
target-version = "py38"
target-version = "py39"
line-length = 127

[tool.ruff.lint]
Expand All @@ -112,8 +112,6 @@ select = [
ignore = [
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"ANN204", # Missing return type annotation for special method
"B904", # Exception raised within try-except should use raise ... from exc
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
Expand Down
2 changes: 1 addition & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
// Documentation configuration files do not require type checking
"docs/conf.py"
],
"pythonVersion": "3.10"
"pythonVersion": "3.9"
}
14 changes: 8 additions & 6 deletions tests/test_bedrock_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def mocked_read_status():
return mock.DEFAULT

pinger = BedrockServerStatus(Address("localhost", 25565))
with mock.patch.object(pinger, "_read_status") as mocked_read, mock.patch.object(
pinger, "parse_response"
) as mocked_parse_response:
with (
mock.patch.object(pinger, "_read_status") as mocked_read,
mock.patch.object(pinger, "parse_response") as mocked_parse_response,
):
mocked_read.side_effect = mocked_read_status

pinger.read_status()
Expand All @@ -50,9 +51,10 @@ def mocked_read_status():
return mock.DEFAULT

pinger = BedrockServerStatus(Address("localhost", 25565))
with mock.patch.object(pinger, "_read_status_async") as mocked_read, mock.patch.object(
pinger, "parse_response"
) as mocked_parse_response:
with (
mock.patch.object(pinger, "_read_status_async") as mocked_read,
mock.patch.object(pinger, "parse_response") as mocked_parse_response,
):
mocked_read.side_effect = mocked_read_status

await pinger.read_status_async()
Expand Down
7 changes: 4 additions & 3 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ def test_query(self):
with patch("mcstatus.protocol.connection.Connection.remaining") as mock_remaining:
mock_remaining.side_effect = [15, 208]

with patch("mcstatus.server.UDPSocketConnection") as connection, patch.object(
self.server.address, "resolve_ip"
) as resolve_ip:
with (
patch("mcstatus.server.UDPSocketConnection") as connection,
patch.object(self.server.address, "resolve_ip") as resolve_ip,
):
connection.return_value.__enter__.return_value = self.socket
resolve_ip.return_value = "127.0.0.1"
info = self.server.query()
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[tox]
isolated_build = True
envlist =
format-check,lint,py{38,39,310,311,312},coverage
format-check,lint,py{39,310,311,312,313},coverage

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312, coverage
3.12: py312
3.13: py313, coverage

[testenv]
setenv =
Expand All @@ -19,7 +19,7 @@ commands =

[testenv:coverage]
depends =
py{38,39,310,311,312}
py{39,310,311,312,313}
setenv =
COVERAGE_FILE=.coverage
commands =
Expand Down
Loading