Skip to content

Commit a826df6

Browse files
committed
Merge branch 'main' into pathlike_ext
2 parents 3debdcc + 9bebfda commit a826df6

File tree

142 files changed

+6545
-1528
lines changed

Some content is hidden

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

142 files changed

+6545
-1528
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
omit =
33
# leading `*/` for pytest-dev/pytest-cov#456
44
*/.tox/*
5+
6+
# local
7+
*/compat/*
8+
*/distutils/_vendor/*
59
disable_warnings =
610
couldnt-parse
711

.github/workflows/main.yml

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ on:
44
merge_group:
55
push:
66
branches-ignore:
7-
# disabled for jaraco/skeleton#103
8-
# - gh-readonly-queue/** # Temporary merge queue-related GH-made branches
7+
# temporary GH branches relating to merge queues (jaraco/skeleton#93)
8+
- gh-readonly-queue/**
9+
tags:
10+
# required if branches-ignore is supplied (jaraco/skeleton#103)
11+
- '**'
912
pull_request:
1013

1114
concurrency:
@@ -34,10 +37,10 @@ env:
3437
jobs:
3538
test:
3639
strategy:
40+
# https://blog.jaraco.com/efficient-use-of-ci-resources/
3741
matrix:
3842
python:
3943
- "3.8"
40-
- "3.11"
4144
- "3.12"
4245
platform:
4346
- ubuntu-latest
@@ -48,6 +51,8 @@ jobs:
4851
platform: ubuntu-latest
4952
- python: "3.10"
5053
platform: ubuntu-latest
54+
- python: "3.11"
55+
platform: ubuntu-latest
5156
- python: pypy3.10
5257
platform: ubuntu-latest
5358
runs-on: ${{ matrix.platform }}
@@ -87,8 +92,6 @@ jobs:
8792
run: tox -e ${{ matrix.job }}
8893

8994
test_cygwin:
90-
# disabled due to lack of Rust support pypa/setuptools#3921
91-
if: ${{ false }}
9295
strategy:
9396
matrix:
9497
python:
@@ -115,6 +118,51 @@ jobs:
115118
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
116119
run: tox
117120

121+
test_msys2_mingw:
122+
strategy:
123+
matrix:
124+
include:
125+
- { sys: mingw64, env: x86_64, cc: gcc, cxx: g++ }
126+
- { sys: mingw32, env: i686, cc: gcc, cxx: g++ }
127+
- { sys: ucrt64, env: ucrt-x86_64, cc: gcc, cxx: g++ }
128+
- { sys: clang64, env: clang-x86_64, cc: clang, cxx: clang++}
129+
runs-on: windows-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
- uses: msys2/setup-msys2@v2
133+
with:
134+
msystem: ${{matrix.sys}}
135+
install: |
136+
mingw-w64-${{matrix.env}}-toolchain
137+
mingw-w64-${{matrix.env}}-python
138+
mingw-w64-${{matrix.env}}-python-pip
139+
mingw-w64-${{matrix.env}}-python-virtualenv
140+
mingw-w64-${{matrix.env}}-cc
141+
git
142+
- name: Install Dependencies
143+
shell: msys2 {0}
144+
env:
145+
CC: ${{ matrix.cc }}
146+
CXX: ${{ matrix.cxx }}
147+
run: |
148+
export VIRTUALENV_NO_SETUPTOOLS=1
149+
150+
python -m virtualenv /tmp/venv
151+
source /tmp/venv/bin/activate
152+
153+
# python-ruff doesn't work without rust
154+
sed -i '/pytest-ruff/d' pyproject.toml
155+
156+
pip install -e .[test]
157+
- name: Run tests
158+
shell: msys2 {0}
159+
env:
160+
CC: ${{ matrix.cc }}
161+
CXX: ${{ matrix.cxx }}
162+
run: |
163+
source /tmp/venv/bin/activate
164+
pytest
165+
118166
ci_setuptools:
119167
# Integration testing with setuptools
120168
strategy:

.readthedocs.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ python:
33
install:
44
- path: .
55
extra_requirements:
6-
- docs
6+
- doc
77

88
# required boilerplate readthedocs/readthedocs.org#10401
99
build:
1010
os: ubuntu-lts-latest
1111
tools:
1212
python: latest
13+
# post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114
14+
jobs:
15+
post_checkout:
16+
- git fetch --unshallow || true

README.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919

2020
Python Module Distribution Utilities extracted from the Python Standard Library
2121

22-
Synchronizing
23-
=============
22+
This package is unsupported except as integrated into and exposed by Setuptools.
2423

25-
This project is no longer kept in sync with the code still in stdlib, which is deprecated and scheduled for removal.
26-
27-
To Setuptools
28-
-------------
24+
Integration
25+
-----------
2926

3027
Simply merge the changes directly into setuptools' repo.

conftest.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
import logging
12
import os
2-
import sys
3-
import platform
43
import pathlib
5-
import logging
4+
import platform
5+
import sys
66

7-
import pytest
87
import path
9-
8+
import pytest
109

1110
collect_ignore = []
1211

@@ -17,6 +16,11 @@
1716
])
1817

1918

19+
collect_ignore_glob = [
20+
'distutils/_vendor/**/*',
21+
]
22+
23+
2024
@pytest.fixture
2125
def save_env():
2226
orig = os.environ.copy()
@@ -57,7 +61,7 @@ def _save_cwd():
5761

5862
@pytest.fixture
5963
def distutils_managed_tempdir(request):
60-
from distutils.tests import py38compat as os_helper
64+
from distutils.tests.compat import py38 as os_helper
6165

6266
self = request.instance
6367
self.tempdirs = []
@@ -93,8 +97,7 @@ def temp_cwd(tmp_path):
9397

9498
@pytest.fixture
9599
def pypirc(request, save_env, distutils_managed_tempdir):
96-
from distutils.core import PyPIRCCommand
97-
from distutils.core import Distribution
100+
from distutils.core import Distribution, PyPIRCCommand
98101

99102
self = request.instance
100103
self.tmp_dir = self.mkdtemp()

distutils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import sys
21
import importlib
2+
import sys
33

44
__version__, _, _ = sys.version.partition(' ')
55

distutils/_collections.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
from __future__ import annotations
2+
13
import collections
24
import functools
35
import itertools
46
import operator
7+
from collections.abc import Mapping
8+
from typing import Any
59

610

711
# from jaraco.collections 3.5.1
@@ -58,7 +62,7 @@ def __len__(self):
5862
return len(list(iter(self)))
5963

6064

61-
# from jaraco.collections 3.7
65+
# from jaraco.collections 5.0.1
6266
class RangeMap(dict):
6367
"""
6468
A dictionary-like object that uses the keys as bounds for a range.
@@ -70,7 +74,7 @@ class RangeMap(dict):
7074
One may supply keyword parameters to be passed to the sort function used
7175
to sort keys (i.e. key, reverse) as sort_params.
7276
73-
Let's create a map that maps 1-3 -> 'a', 4-6 -> 'b'
77+
Create a map that maps 1-3 -> 'a', 4-6 -> 'b'
7478
7579
>>> r = RangeMap({3: 'a', 6: 'b'}) # boy, that was easy
7680
>>> r[1], r[2], r[3], r[4], r[5], r[6]
@@ -82,7 +86,7 @@ class RangeMap(dict):
8286
>>> r[4.5]
8387
'b'
8488
85-
But you'll notice that the way rangemap is defined, it must be open-ended
89+
Notice that the way rangemap is defined, it must be open-ended
8690
on one side.
8791
8892
>>> r[0]
@@ -140,7 +144,12 @@ class RangeMap(dict):
140144
141145
"""
142146

143-
def __init__(self, source, sort_params={}, key_match_comparator=operator.le):
147+
def __init__(
148+
self,
149+
source,
150+
sort_params: Mapping[str, Any] = {},
151+
key_match_comparator=operator.le,
152+
):
144153
dict.__init__(self, source)
145154
self.sort_params = sort_params
146155
self.match = key_match_comparator

distutils/_log.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import logging
22

3-
43
log = logging.getLogger()

distutils/_macos_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import sys
21
import importlib
2+
import sys
33

44

55
def bypass_compiler_fixup(cmd, args):

distutils/_modified.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import functools
44
import os.path
55

6-
from .errors import DistutilsFileError
7-
from .py39compat import zip_strict
86
from ._functools import splat
7+
from .compat.py39 import zip_strict
8+
from .errors import DistutilsFileError
99

1010

1111
def _newer(source, target):
@@ -24,7 +24,7 @@ def newer(source, target):
2424
Raises DistutilsFileError if 'source' does not exist.
2525
"""
2626
if not os.path.exists(source):
27-
raise DistutilsFileError("file '%s' does not exist" % os.path.abspath(source))
27+
raise DistutilsFileError(f"file '{os.path.abspath(source)}' does not exist")
2828

2929
return _newer(source, target)
3030

0 commit comments

Comments
 (0)