Skip to content
Open
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
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
strategy:
matrix:
python:
- 39
- 312
platform:
- windows-latest
runs-on: ${{ matrix.platform }}
Expand All @@ -131,7 +131,9 @@ jobs:
python -m pip install tox
- name: Run tests
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
run: python -m tox
run: |
git config --global --add safe.directory '*'
python -m tox

test_msys2_mingw:
strategy:
Expand All @@ -147,6 +149,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
Comment thread
lazka marked this conversation as resolved.
install: |
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-python
Expand Down
20 changes: 12 additions & 8 deletions distutils/tests/test_filelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
9 changes: 1 addition & 8 deletions distutils/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ def environment(monkeypatch):
@pytest.mark.usefixtures('save_env')
class TestUtil:
def test_get_host_platform(self):
with mock.patch('os.name', 'nt'):
with mock.patch('sys.version', '... [... (ARM64)]'):
assert get_host_platform() == 'win-arm64'
with mock.patch('sys.version', '... [... (ARM)]'):
assert get_host_platform() == 'win-arm32'

with mock.patch('sys.version_info', (3, 9, 0, 'final', 0)):
assert get_host_platform() == stdlib_sysconfig.get_platform()
assert get_host_platform() == stdlib_sysconfig.get_platform()

def test_get_platform(self):
with mock.patch('os.name', 'nt'):
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ doc = [
check = [
"pytest-checkdocs >= 2.14",
"pytest-ruff >= 0.2.1; sys_platform != 'cygwin'",
"ruff == 0.13.3; sys_platform != 'cygwin'",
]

cover = [
Expand All @@ -82,6 +83,7 @@ type = [

# Exclude PyPy from type checks (python/mypy#20454 jaraco/skeleton#187)
"pytest-mypy >= 1.0.1; platform_python_implementation != 'PyPy'",
"mypy == 1.15.0",

# local
"types-docutils",
Expand Down
2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
target-version = "py39"

[lint]
extend-select = [
# upstream
Expand Down
Loading