Skip to content

Commit 611d944

Browse files
committed
Drop support for Python 3.10 and 3.11
Support for PyPy dropped until PyPy supports Python 3.12 Apply Ruff and Mypy lint fixes Necessary to keep up with typing changes in Numpy Not strictly required, but Python 3.10 is reaching EOL anyways
1 parent 00dcb1d commit 611d944

19 files changed

Lines changed: 64 additions & 75 deletions

.github/workflows/python-package.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ jobs:
109109
strategy:
110110
matrix:
111111
os: ["ubuntu-latest", "windows-latest"]
112-
python-version: ["3.10", "3.14t", "pypy-3.10"]
112+
python-version: ["3.12", "3.14t"]
113113
architecture: ["x64"]
114114
include:
115115
- os: "windows-latest"
116-
python-version: "3.10"
116+
python-version: "3.12"
117117
architecture: "x86"
118118
- os: "windows-latest"
119119
python-version: "3.14t"
120120
architecture: "x86"
121121
- os: "windows-11-arm"
122-
python-version: "3.11"
122+
python-version: "3.12"
123123
architecture: "arm64"
124124
- os: "windows-11-arm"
125125
python-version: "3.14t"
@@ -243,7 +243,7 @@ jobs:
243243
strategy:
244244
matrix:
245245
arch: ["x86_64", "aarch64"]
246-
build: ["cp310-manylinux*", "pp311-manylinux*", "cp314t-manylinux*"]
246+
build: ["cp312-manylinux*", "cp314t-manylinux*"]
247247
env:
248248
BUILD_DESC: ""
249249
steps:
@@ -301,7 +301,7 @@ jobs:
301301
strategy:
302302
fail-fast: true
303303
matrix:
304-
python: ["cp310-*_universal2", "cp314t-*_universal2", "pp311-*"]
304+
python: ["cp312-*_universal2", "cp314t-*_universal2"]
305305
env:
306306
PYTHON_DESC: ""
307307
steps:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
66

77
## [Unreleased]
88

9+
### Removed
10+
11+
- Support dropped for Python 3.10 and 3.11.
12+
913
## [21.2.1] - 2026-06-04
1014

1115
### Deployment

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For the most part it's just::
4646
==============
4747
Requirements
4848
==============
49-
* Python 3.10+
49+
* Python 3.12+
5050
* Windows, Linux, or MacOS X 10.9+.
5151
* On Linux, requires libsdl3
5252

build_libtcod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def walk_sources(directory: str) -> Iterator[str]:
228228
for include in includes:
229229
try:
230230
ffi.cdef(include.header)
231-
except Exception: # noqa: PERF203
231+
except Exception:
232232
# Print the source, for debugging.
233233
print(f"Error with: {include.path}")
234234
for i, line in enumerate(include.header.split("\n"), 1):

build_sdl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ def check_sdl_version() -> None:
157157
)
158158
raise RuntimeError(msg) from exc
159159
except subprocess.CalledProcessError as exc:
160-
if sys.version_info >= (3, 11):
161-
exc.add_note(f"Note: {os.environ.get('PKG_CONFIG_PATH')=}")
160+
exc.add_note(f"Note: {os.environ.get('PKG_CONFIG_PATH')=}")
162161
raise
163162
logger.info(f"Found SDL {sdl_version_str}.")
164163
sdl_version = tuple(int(s) for s in sdl_version_str.split("."))

docs/tcod/event.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Getting events
1515
The primary way to capture events is with the :any:`tcod.event.get` and :any:`tcod.event.wait` functions.
1616
These functions return events in a loop until the internal event queue is empty.
1717
Use :func:`isinstance`, :any:`tcod.event.EventDispatch`, or `match statements <https://docs.python.org/3/tutorial/controlflow.html#match-statements>`_
18-
(introduced in Python 3.10) to determine which event was returned.
18+
to determine which event was returned.
1919

2020
.. autofunction:: tcod.event.get
2121
.. autofunction:: tcod.event.wait

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dynamic = ["version"]
2020
description = "The official Python port of libtcod."
2121
authors = [{ name = "Kyle Benesch", email = "4b796c65+tcod@gmail.com" }]
2222
readme = "README.rst"
23-
requires-python = ">=3.10"
23+
requires-python = ">=3.12"
2424
license = "BSD-2-Clause"
2525
license-files = [
2626
"LICENSE.txt",
@@ -106,7 +106,7 @@ enable = ["pypy", "pyodide-prerelease"]
106106

107107
[tool.mypy]
108108
files = ["."]
109-
python_version = "3.10"
109+
python_version = "3.12"
110110
warn_unused_configs = true
111111
show_error_codes = true
112112
disallow_subclassing_any = true

scripts/tag_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def parse_changelog(args: argparse.Namespace) -> tuple[str, str]:
3636
assert match
3737
header, changes, tail = match.groups()
3838

39-
iso_date = datetime.datetime.now(tz=datetime.timezone.utc).date().isoformat()
39+
iso_date = datetime.datetime.now(tz=datetime.UTC).date().isoformat()
4040
tagged = f"\n## [{args.tag}] - {iso_date}\n{changes}"
4141
if args.verbose:
4242
print("--- Tagged section:")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_package_data() -> list[str]:
4242

4343
options = {
4444
"bdist_wheel": {
45-
"py_limited_api": "cp310",
45+
"py_limited_api": "cp312",
4646
}
4747
}
4848
if "free-threading build" in sys.version:

tcod/_internal.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _check(error: int) -> int:
6161
return error
6262

6363

64-
def _check_p(pointer: T) -> T:
64+
def _check_p[T](pointer: T) -> T:
6565
"""Treats NULL pointers as errors and raises a libtcod exception."""
6666
if not pointer:
6767
_raise_tcod_error()
@@ -94,13 +94,13 @@ def _int(int_or_str: SupportsInt | str | bytes) -> int:
9494
return int(int_or_str)
9595

9696

97-
def _bytes(string: AnyStr) -> bytes:
97+
def _bytes(string: AnyStr) -> bytes: # noqa: UP047
9898
if isinstance(string, str):
9999
return string.encode("utf-8")
100100
return string
101101

102102

103-
def _unicode(string: AnyStr, stacklevel: int = 2) -> str:
103+
def _unicode(string: AnyStr, stacklevel: int = 2) -> str: # noqa: UP047
104104
if isinstance(string, bytes):
105105
warnings.warn(
106106
"Passing byte strings as parameters to Unicode functions is deprecated.",
@@ -129,8 +129,7 @@ def _path_encode(path: Path) -> bytes:
129129
try:
130130
return str(path).encode(locale.getlocale()[1] or "utf-8") # Stay classy, Windows
131131
except UnicodeEncodeError as exc:
132-
if sys.version_info >= (3, 11):
133-
exc.add_note("""Consider calling 'locale.setlocale(locale.LC_CTYPES, ".UTF8")' to support Unicode paths.""")
132+
exc.add_note("""Consider calling 'locale.setlocale(locale.LC_CTYPES, ".UTF8")' to support Unicode paths.""")
134133
raise
135134

136135

0 commit comments

Comments
 (0)