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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.0
rev: v0.15.12
hooks:
- id: ruff-check
args: [--fix, --unsafe-fixes]
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _save_cwd():

@pytest.fixture
def distutils_managed_tempdir(request):
from distutils.tests.compat import py39 as os_helper
from test.support import os_helper

self = request.instance
self.tempdirs = []
Expand Down
3 changes: 1 addition & 2 deletions distutils/_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from jaraco.functools import splat

from .compat.py39 import zip_strict
from .errors import DistutilsFileError

_SourcesT = TypeVar(
Expand Down Expand Up @@ -57,7 +56,7 @@ def newer_pairwise(
targets) where source is newer than target, according to the semantics
of 'newer()'.
"""
newer_pairs = filter(splat(newer), zip_strict(sources, targets))
newer_pairs = filter(splat(newer), zip(sources, targets, strict=True))
return tuple(map(list, zip(*newer_pairs, strict=False))) or ([], [])


Expand Down
66 changes: 0 additions & 66 deletions distutils/compat/py39.py

This file was deleted.

10 changes: 5 additions & 5 deletions distutils/compilers/C/tests/test_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from distutils.compat import consolidate_linker_args
from distutils.errors import DistutilsPlatformError
from distutils.tests import support
from distutils.tests.compat.py39 import EnvironmentVarGuard
from distutils.util import _clear_cached_macosx_ver

import pytest
from test.support import os_helper

from .. import unix

Expand Down Expand Up @@ -238,7 +238,7 @@ def gcvs(*args, _orig=sysconfig.get_config_vars):

sysconfig.get_config_var = gcv
sysconfig.get_config_vars = gcvs
with EnvironmentVarGuard() as env:
with os_helper.EnvironmentVarGuard() as env:
env['CC'] = 'my_cc'
del env['LDSHARED']
sysconfig.customize_compiler(self.cc)
Expand Down Expand Up @@ -268,7 +268,7 @@ def gcvs(*args, _orig=sysconfig.get_config_vars):
mock.patch.object(self.cc, 'spawn', return_value=None) as mock_spawn,
mock.patch.object(self.cc, '_need_link', return_value=True),
mock.patch.object(self.cc, 'mkpath', return_value=None),
EnvironmentVarGuard() as env,
os_helper.EnvironmentVarGuard() as env,
):
# override environment overrides in case they're specified by CI
del env['CXX']
Expand Down Expand Up @@ -339,7 +339,7 @@ def gcvs(*args, _orig=sysconfig.get_config_vars):
mock.patch.object(self.cc, 'spawn', return_value=None) as mock_spawn,
mock.patch.object(self.cc, '_need_link', return_value=True),
mock.patch.object(self.cc, 'mkpath', return_value=None),
EnvironmentVarGuard() as env,
os_helper.EnvironmentVarGuard() as env,
):
env['CC'] = 'ccache my_cc'
env['CXX'] = 'my_cxx'
Expand Down Expand Up @@ -368,7 +368,7 @@ def gcvs(*args, _orig=sysconfig.get_config_vars):

sysconfig.get_config_var = gcv
sysconfig.get_config_vars = gcvs
with EnvironmentVarGuard() as env:
with os_helper.EnvironmentVarGuard() as env:
env['CC'] = 'my_cc'
env['LDSHARED'] = 'my_ld -bundle -dynamic'
sysconfig.customize_compiler(self.cc)
Expand Down
2 changes: 0 additions & 2 deletions distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from jaraco.functools import pass_none

from .ccompiler import CCompiler
from .compat import py39
from .errors import DistutilsPlatformError
from .util import is_mingw

Expand Down Expand Up @@ -563,7 +562,6 @@ def get_config_vars(*args: str) -> list[str | int] | dict[str, str | int]:
global _config_vars
if _config_vars is None:
_config_vars = sysconfig.get_config_vars().copy()
py39.add_ext_suffix(_config_vars)

return [_config_vars.get(name) for name in args] if args else _config_vars

Expand Down
Empty file removed distutils/tests/compat/__init__.py
Empty file.
18 changes: 0 additions & 18 deletions distutils/tests/compat/py39.py

This file was deleted.

3 changes: 1 addition & 2 deletions distutils/tests/test_build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
import path
import pytest
from test import support

from .compat import py39 as import_helper
from test.support import import_helper


@pytest.fixture()
Expand Down
3 changes: 1 addition & 2 deletions distutils/tests/test_filelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

import jaraco.path
import pytest

from .compat import py39 as os_helper
from test.support import os_helper

MANIFEST_IN = """\
include ok
Expand Down
4 changes: 1 addition & 3 deletions distutils/tests/test_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

import path
import pytest
from test.support import unix_shell

from .compat import py39 as os_helper
from test.support import os_helper, unix_shell


class TestSpawn(support.TempdirManager):
Expand Down
Loading