Skip to content

Commit 2b73839

Browse files
authored
Drop support for Python 3.10 (#9750)
2 parents 9cd0743 + 4955fb4 commit 2b73839

54 files changed

Lines changed: 127 additions & 174 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/compare-dist-sizes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111

1212
# /// script
13-
# requires-python = ">=3.10"
13+
# requires-python = ">=3.11"
1414
# dependencies = [
1515
# "humanize",
1616
# "prettytable",

.github/generate-sbom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def upstream_diff_b64(
5959

6060
def generate(version: str) -> dict:
6161
serial = str(uuid.uuid4())
62-
now = dt.datetime.now(dt.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
62+
now = dt.datetime.now(dt.UTC).strftime("%Y-%m-%dT%H:%M:%SZ")
6363
purl = f"pkg:pypi/pillow@{version}"
6464
root = Path(__file__).parent.parent
6565
thirdparty = root / "src" / "thirdparty"

.github/workflows/test-docker.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
fedora-43-amd64,
4848
fedora-44-amd64,
4949
gentoo,
50-
ubuntu-22.04-jammy-amd64,
5150
ubuntu-24.04-noble-amd64,
5251
ubuntu-26.04-resolute-amd64,
5352
]

.github/workflows/test-valgrind-memory.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
docker: [
41-
ubuntu-22.04-jammy-amd64-valgrind,
41+
ubuntu-24.04-noble-amd64-valgrind,
4242
]
4343
dockerTag: [main]
44+
split: [1, 2, 3, 4]
4445

45-
name: ${{ matrix.docker }}
46+
name: ${{ matrix.docker }} ${{ matrix.split }}
4647

4748
steps:
4849
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -60,5 +61,5 @@ jobs:
6061
run: |
6162
# The Pillow user in the docker container is UID 1001
6263
sudo chown -R 1001 $GITHUB_WORKSPACE
63-
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
64+
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -e "SPLIT_COUNT=4" -e "SPLIT_INDEX=${{ matrix.split }}" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
6465
sudo chown -R runner $GITHUB_WORKSPACE

.github/workflows/test-valgrind.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
docker: [
35-
ubuntu-22.04-jammy-amd64-valgrind,
35+
ubuntu-24.04-noble-amd64-valgrind,
3636
]
3737
dockerTag: [main]
38+
split: [1, 2, 3, 4]
3839

39-
name: ${{ matrix.docker }}
40+
name: ${{ matrix.docker }} ${{ matrix.split }}
4041

4142
steps:
4243
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -54,5 +55,5 @@ jobs:
5455
run: |
5556
# The Pillow user in the docker container is UID 1001
5657
sudo chown -R 1001 $GITHUB_WORKSPACE
57-
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
58+
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -e "SPLIT_COUNT=4" -e "SPLIT_INDEX=${{ matrix.split }}" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
5859
sudo chown -R runner $GITHUB_WORKSPACE

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version: ["pypy3.11", "3.11", "3.12", "3.13", "3.14", "3.15"]
33+
python-version: ["pypy3.11", "3.12", "3.13", "3.14", "3.15"]
3434
architecture: ["x64"]
3535
os: ["windows-latest"]
3636
include:
3737
# Test the oldest Python on 32-bit
38-
- { python-version: "3.10", architecture: "x86", os: "windows-2022" }
38+
- { python-version: "3.11", architecture: "x86", os: "windows-2022" }
3939

4040
timeout-minutes: 45
4141

.github/workflows/test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ jobs:
4444
"3.13",
4545
"3.12",
4646
"3.11",
47-
"3.10",
4847
]
4948
include:
50-
- { python-version: "3.12", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" }
51-
- { python-version: "3.11", PYTHONOPTIMIZE: 2 }
49+
- { python-version: "3.13", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" }
50+
- { python-version: "3.12", PYTHONOPTIMIZE: 2 }
5251
# Intel
53-
- { os: "macos-26-intel", python-version: "3.10" }
52+
- { os: "macos-26-intel", python-version: "3.11" }
5453
exclude:
55-
- { os: "macos-latest", python-version: "3.10" }
54+
- { os: "macos-latest", python-version: "3.11" }
5655

5756
runs-on: ${{ matrix.os }}
5857
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ concurrency:
3737
cancel-in-progress: true
3838

3939
env:
40-
EXPECTED_DISTS: 87
40+
EXPECTED_DISTS: 78
4141
FORCE_COLOR: 1
4242

4343
jobs:
@@ -81,7 +81,7 @@ jobs:
8181
platform: macos
8282
os: macos-26-intel
8383
cibw_arch: x86_64
84-
build: "cp3{10,11}*"
84+
build: "cp311*"
8585
macosx_deployment_target: "10.10"
8686
- name: "macOS 10.13 x86_64"
8787
platform: macos

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ valgrind-leak:
114114
PILLOW_VALGRIND_TEST=true PYTHONMALLOC=malloc valgrind --suppressions=Tests/oss-fuzz/python.supp \
115115
--leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite \
116116
--log-file=/tmp/valgrind-output \
117-
python3 -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output
117+
python3 -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output $(PYTEST_ARGS)
118118

119119
.PHONY: readme
120120
readme:

Tests/test_bmp_reference.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ def test_bad() -> None:
2121
either"""
2222
for f in get_files("b"):
2323
# Assert that there is no unclosed file warning
24-
with warnings.catch_warnings():
25-
warnings.simplefilter("error")
26-
24+
with warnings.catch_warnings(action="error"):
2725
try:
2826
with Image.open(f) as im:
2927
im.load()
@@ -56,7 +54,7 @@ def test_questionable() -> None:
5654
im.load()
5755
if os.path.basename(f) not in supported:
5856
print(f"Please add {f} to the partially supported bmp specs.")
59-
except Exception: # noqa: PERF203
57+
except Exception:
6058
if os.path.basename(f) in supported:
6159
raise
6260

@@ -106,7 +104,7 @@ def get_compare(f: str) -> str:
106104

107105
assert_image_similar(im_converted, compare_converted, 5)
108106

109-
except Exception as msg: # noqa: PERF203
107+
except Exception as msg:
110108
# there are three here that are unsupported:
111109
unsupported = (
112110
os.path.join(base, "g", "rgb32bf.bmp"),

0 commit comments

Comments
 (0)