Skip to content

Commit 9654a95

Browse files
committed
chore: use SPEC 0 schedule for cibuildwheel
1 parent 31de15b commit 9654a95

File tree

15 files changed

+49
-39
lines changed

15 files changed

+49
-39
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
python_version: ['3.12']
4141
include:
4242
- os: ubuntu-latest
43-
python_version: '3.8'
43+
python_version: '3.10'
4444
timeout-minutes: 180
4545
steps:
4646
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ repos:
2424
rev: v1.10.0
2525
hooks:
2626
- id: mypy
27-
name: mypy 3.8 on cibuildwheel/
27+
name: mypy 3.10 on cibuildwheel/
2828
exclude: ^cibuildwheel/resources/.*py|bin/generate_schema.py$
29-
args: ["--python-version=3.8"]
29+
args: ["--python-version=3.10"]
3030
additional_dependencies: &mypy-dependencies
3131
- bracex
3232
- nox

bin/update_pythons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import logging
88
from collections.abc import Mapping, MutableMapping
99
from pathlib import Path
10-
from typing import Any, Final, Literal, TypedDict, Union
10+
from typing import Any, Final, Literal, TypedDict
1111

1212
import click
1313
import requests
@@ -50,7 +50,7 @@ class ConfigMacOS(TypedDict):
5050
url: str
5151

5252

53-
AnyConfig = Union[ConfigWinCP, ConfigWinPP, ConfigMacOS]
53+
AnyConfig = ConfigWinCP | ConfigWinPP | ConfigMacOS
5454

5555

5656
# The following set of "Versions" classes allow the initial call to the APIs to

cibuildwheel/bashlex_eval.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
from __future__ import annotations
22

33
import subprocess
4-
from collections.abc import Iterable, Mapping, Sequence
4+
from collections.abc import (
5+
Callable,
6+
Iterable,
7+
Mapping,
8+
Sequence,
9+
)
510
from dataclasses import dataclass
6-
from typing import Callable, Dict, List # noqa: TID251
711

812
import bashlex
913

1014
# a function that takes a command and the environment, and returns the result
11-
EnvironmentExecutor = Callable[[List[str], Dict[str, str]], str]
15+
EnvironmentExecutor = Callable[[list[str], dict[str, str]], str]
1216

1317

1418
def local_environment_executor(command: Sequence[str], env: Mapping[str, str]) -> str:

cibuildwheel/linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import subprocess
44
import sys
55
import textwrap
6+
from collections import OrderedDict
67
from collections.abc import Iterable, Iterator, Sequence, Set
78
from dataclasses import dataclass
89
from pathlib import Path, PurePath, PurePosixPath
9-
from typing import OrderedDict, Tuple
1010

1111
from packaging.version import Version
1212

@@ -96,7 +96,7 @@ def get_build_steps(
9696
Groups PythonConfigurations into BuildSteps. Each BuildStep represents a
9797
separate container instance.
9898
"""
99-
steps = OrderedDict[Tuple[str, str, str, OCIContainerEngineConfig], BuildStep]()
99+
steps = OrderedDict[tuple[str, str, str, OCIContainerEngineConfig], BuildStep]()
100100

101101
for config in python_configurations:
102102
_, platform_tag = config.identifier.split("-", 1)

cibuildwheel/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import re
66
import sys
77
import time
8-
from typing import IO, AnyStr, Final, Tuple
8+
from typing import IO, AnyStr, Final
99

1010
from .util import CIProvider, detect_ci_provider
1111

12-
FoldPattern = Tuple[str, str]
12+
FoldPattern = tuple[str, str]
1313
DEFAULT_FOLD_PATTERN: Final[FoldPattern] = ("{name}", "")
1414
FOLD_PATTERNS: Final[dict[str, FoldPattern]] = {
1515
"azure": ("##[group]{name}", "##[endgroup]"),

cibuildwheel/macos.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from collections.abc import Sequence, Set
1212
from dataclasses import dataclass
1313
from pathlib import Path
14-
from typing import Literal, Tuple
14+
from typing import Literal
1515

1616
from filelock import FileLock
1717
from packaging.version import Version
@@ -51,7 +51,7 @@
5151
)
5252

5353

54-
@functools.lru_cache(maxsize=None)
54+
@functools.cache
5555
def get_macos_version() -> tuple[int, int]:
5656
"""
5757
Returns the macOS major/minor version, as a tuple, e.g. (10, 15) or (11, 0)
@@ -75,10 +75,10 @@ def get_macos_version() -> tuple[int, int]:
7575
capture_stdout=True,
7676
)
7777
version = tuple(map(int, version_str.split(".")[:2]))
78-
return typing.cast(Tuple[int, int], version)
78+
return typing.cast(tuple[int, int], version)
7979

8080

81-
@functools.lru_cache(maxsize=None)
81+
@functools.cache
8282
def get_test_macosx_deployment_target() -> str:
8383
version = get_macos_version()
8484
if version >= (11, 0):

cibuildwheel/oci_container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from dataclasses import dataclass, field
1515
from pathlib import Path, PurePath, PurePosixPath
1616
from types import TracebackType
17-
from typing import IO, Dict, Literal
17+
from typing import IO, Literal
1818

1919
from ._compat.typing import Self
2020
from .typing import PathOrStr, PopenBytes
@@ -398,7 +398,7 @@ def get_environment(self) -> dict[str, str]:
398398
capture_output=True,
399399
)
400400
)
401-
return typing.cast(Dict[str, str], env)
401+
return typing.cast(dict[str, str], env)
402402

403403
def environment_executor(self, command: Sequence[str], environment: dict[str, str]) -> str:
404404
# used as an EnvironmentExecutor to evaluate commands and capture output

cibuildwheel/options.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@
99
import functools
1010
import shlex
1111
import textwrap
12-
from collections.abc import Callable, Generator, Iterable, Iterator, Set
12+
from collections.abc import (
13+
Callable,
14+
Generator,
15+
Iterable,
16+
Iterator,
17+
Mapping,
18+
Sequence,
19+
Set,
20+
)
1321
from pathlib import Path
14-
from typing import Any, Literal, Mapping, Sequence, TypedDict, Union # noqa: TID251
22+
from typing import Any, Literal, TypedDict
1523

1624
from packaging.specifiers import SpecifierSet
1725

@@ -117,7 +125,7 @@ def architectures(self) -> set[Architecture]:
117125
return self.globals.architectures
118126

119127

120-
Setting = Union[Mapping[str, str], Sequence[str], str, int, bool]
128+
Setting = Mapping[str, str] | Sequence[str] | str | int | bool
121129

122130

123131
@dataclasses.dataclass(frozen=True)
@@ -258,7 +266,7 @@ def _stringify_setting(
258266
raise ConfigOptionError(msg)
259267
return list_sep.join(setting)
260268

261-
if isinstance(setting, (bool, int)):
269+
if isinstance(setting, bool | int):
262270
return str(setting)
263271

264272
return setting
@@ -838,7 +846,7 @@ def compute_options(
838846
return options
839847

840848

841-
@functools.lru_cache(maxsize=None)
849+
@functools.cache
842850
def _get_pinned_container_images() -> Mapping[str, Mapping[str, str]]:
843851
"""
844852
This looks like a dict of dicts, e.g.

cibuildwheel/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
if typing.TYPE_CHECKING:
1818
PopenBytes = subprocess.Popen[bytes]
19-
PathOrStr = Union[str, os.PathLike[str]]
19+
PathOrStr = str | os.PathLike[str]
2020
else:
2121
PopenBytes = subprocess.Popen
2222
PathOrStr = Union[str, "os.PathLike[str]"]

0 commit comments

Comments
 (0)