From 794ce40b709ca813e62eed9f99267f2bc819fef7 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 10 Feb 2026 19:14:12 +0100 Subject: [PATCH 1/4] CI: update MSYS2 packages before running tests Otherwise it installs the packages present at the time the installer was releases, which for some reason was broken the last time. Enable updates so the newest versions are used. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 834a1ad3..f484089a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,6 +147,7 @@ jobs: - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} + update: true install: | mingw-w64-${{matrix.env}}-toolchain mingw-w64-${{matrix.env}}-python From e6405175f1c9e981bbcbe065114d2b71c87598cb Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 10 Feb 2026 19:27:49 +0100 Subject: [PATCH 2/4] tests: fix test_glob_to_re with Python 3.14 Upstream changed from \Z to \z in https://github.com/python/cpython/commit/add0ca9ea00ab02fd3a58d059e8370c2d0a1d32c --- distutils/tests/test_filelist.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/distutils/tests/test_filelist.py b/distutils/tests/test_filelist.py index 130e6fb5..765b0a89 100644 --- a/distutils/tests/test_filelist.py +++ b/distutils/tests/test_filelist.py @@ -3,6 +3,7 @@ import logging import os import re +import sys from distutils import debug, filelist from distutils.errors import DistutilsTemplateError from distutils.filelist import FileList, glob_to_re, translate_pattern @@ -49,18 +50,21 @@ def test_glob_to_re(self): if os.sep == '\\': sep = re.escape(os.sep) + # https://docs.python.org/3/whatsnew/3.14.html#re + end = r"\z" if sys.version_info >= (3, 14) else r"\Z" + for glob, regex in ( # simple cases - ('foo*', r'(?s:foo[^%(sep)s]*)\Z'), - ('foo?', r'(?s:foo[^%(sep)s])\Z'), - ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'), + ('foo*', r'(?s:foo[^%(sep)s]*)%(end)s'), + ('foo?', r'(?s:foo[^%(sep)s])%(end)s'), + ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])%(end)s'), # special cases - (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'), - (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'), - ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'), - (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z'), + (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)%(end)s'), + (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)%(end)s'), + ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])%(end)s'), + (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])%(end)s'), ): - regex = regex % {'sep': sep} + regex = regex % {'sep': sep, 'end': end} assert glob_to_re(glob) == regex def test_process_template_line(self): From 4632f9571809a371f521a698fe1290cc21a1b38d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 10 Feb 2026 19:30:43 +0100 Subject: [PATCH 3/4] tests: skip test_get_host_platform with mingw Python the platform strings are different there compared to the official CPython distributions, so just skip the test there. --- distutils/tests/test_util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distutils/tests/test_util.py b/distutils/tests/test_util.py index 00c9743e..c053a153 100644 --- a/distutils/tests/test_util.py +++ b/distutils/tests/test_util.py @@ -20,6 +20,7 @@ get_host_platform, get_platform, grok_environment_error, + is_mingw, rfc822_escape, split_quoted, strtobool, @@ -42,6 +43,7 @@ def environment(monkeypatch): @pytest.mark.usefixtures('save_env') class TestUtil: + @pytest.mark.skipif(is_mingw(), reason="mingw has non-standard platform names") def test_get_host_platform(self): with mock.patch('os.name', 'nt'): with mock.patch('sys.version', '... [... (ARM64)]'): From c00c6323506f6c3f79b4829ff1830169342ab00f Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 10 Feb 2026 20:11:18 +0100 Subject: [PATCH 4/4] tests: pin mypy and ruff to avoid CI breakage with newer versions Downgrade to a version which succeeds with the current code. This makes sure that new ruff/mypy releases don't break the CI. Feel free to fix things and update to newer versions. --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f26f750c..3183143a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,7 @@ doc = [ check = [ "pytest-checkdocs >= 2.4", "pytest-ruff >= 0.2.1; sys_platform != 'cygwin'", + "ruff == 0.13.3; sys_platform != 'cygwin'", ] cover = [ @@ -80,6 +81,7 @@ enabler = [ type = [ # upstream "pytest-mypy", + "mypy == 1.15.0", # local "types-docutils",