style: remove from future import annotations
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
committed by
Henry Schreiner
parent
1b63074d76
commit
708cf1d32b
@@ -5,8 +5,6 @@
|
|||||||
# ///
|
# ///
|
||||||
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ This will cache the results to all_known_setup.yaml; you can reprint
|
|||||||
the results without the `--online` setting.
|
the results without the `--online` setting.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
from collections.abc import Iterable, Iterator
|
from collections.abc import Iterable, Iterator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|||||||
+2
-4
@@ -17,8 +17,6 @@ Suggested usage:
|
|||||||
git diff
|
git diff
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import functools
|
import functools
|
||||||
import textwrap
|
import textwrap
|
||||||
@@ -28,7 +26,7 @@ from collections.abc import Iterable, Mapping, Sequence
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, TextIO
|
from typing import Any, Self, TextIO
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import yaml
|
import yaml
|
||||||
@@ -85,7 +83,7 @@ class Project:
|
|||||||
name_len = len(self.name) + 4
|
name_len = len(self.name) + 4
|
||||||
self.__class__.NAME = max(self.__class__.NAME, name_len)
|
self.__class__.NAME = max(self.__class__.NAME, name_len)
|
||||||
|
|
||||||
def __lt__(self, other: Project) -> bool:
|
def __lt__(self, other: Self) -> bool:
|
||||||
if self.online:
|
if self.online:
|
||||||
return self.num_stars < other.num_stars
|
return self.num_stars < other.num_stars
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import difflib
|
import difflib
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import difflib
|
import difflib
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import difflib
|
import difflib
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
__version__ = "2.22.0"
|
__version__ = "2.22.0"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
import contextlib
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import typing
|
||||||
from collections.abc import Set
|
from collections.abc import Set
|
||||||
from enum import StrEnum, auto
|
from enum import StrEnum, auto
|
||||||
from typing import Final, Literal, assert_never
|
from typing import Final, Literal
|
||||||
|
|
||||||
from .typing import PlatformName
|
from .typing import PlatformName
|
||||||
|
|
||||||
@@ -38,6 +37,7 @@ def _check_aarch32_el0() -> bool:
|
|||||||
return check.returncode == 0 and check.stdout.startswith("armv")
|
return check.returncode == 0 and check.stdout.startswith("armv")
|
||||||
|
|
||||||
|
|
||||||
|
@typing.final
|
||||||
class Architecture(StrEnum):
|
class Architecture(StrEnum):
|
||||||
# mac/linux archs
|
# mac/linux archs
|
||||||
x86_64 = auto()
|
x86_64 = auto()
|
||||||
@@ -62,7 +62,7 @@ class Architecture(StrEnum):
|
|||||||
wasm32 = auto()
|
wasm32 = auto()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_config(config: str, platform: PlatformName) -> set[Architecture]:
|
def parse_config(config: str, platform: PlatformName) -> "set[Architecture]":
|
||||||
result = set()
|
result = set()
|
||||||
for arch_str in re.split(r"[\s,]+", config):
|
for arch_str in re.split(r"[\s,]+", config):
|
||||||
if arch_str == "auto":
|
if arch_str == "auto":
|
||||||
@@ -82,7 +82,7 @@ class Architecture(StrEnum):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def native_arch(platform: PlatformName) -> Architecture | None:
|
def native_arch(platform: PlatformName) -> "Architecture | None":
|
||||||
if platform == "pyodide":
|
if platform == "pyodide":
|
||||||
return Architecture.wasm32
|
return Architecture.wasm32
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class Architecture(StrEnum):
|
|||||||
return native_architecture
|
return native_architecture
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def auto_archs(platform: PlatformName) -> set[Architecture]:
|
def auto_archs(platform: PlatformName) -> "set[Architecture]":
|
||||||
native_arch = Architecture.native_arch(platform)
|
native_arch = Architecture.native_arch(platform)
|
||||||
if native_arch is None:
|
if native_arch is None:
|
||||||
return set() # can't build anything on this platform
|
return set() # can't build anything on this platform
|
||||||
@@ -131,7 +131,7 @@ class Architecture(StrEnum):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def all_archs(platform: PlatformName) -> set[Architecture]:
|
def all_archs(platform: PlatformName) -> "set[Architecture]":
|
||||||
all_archs_map = {
|
all_archs_map = {
|
||||||
"linux": {
|
"linux": {
|
||||||
Architecture.x86_64,
|
Architecture.x86_64,
|
||||||
@@ -148,7 +148,7 @@ class Architecture(StrEnum):
|
|||||||
return all_archs_map[platform]
|
return all_archs_map[platform]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> set[Architecture]:
|
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> "set[Architecture]":
|
||||||
archs_32 = {Architecture.i686, Architecture.x86, Architecture.armv7l}
|
archs_32 = {Architecture.i686, Architecture.x86, Architecture.armv7l}
|
||||||
auto_archs = Architecture.auto_archs(platform)
|
auto_archs = Architecture.auto_archs(platform)
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ class Architecture(StrEnum):
|
|||||||
return auto_archs - archs_32
|
return auto_archs - archs_32
|
||||||
if bitness == "32":
|
if bitness == "32":
|
||||||
return auto_archs & archs_32
|
return auto_archs & archs_32
|
||||||
assert_never(bitness)
|
typing.assert_never(bitness)
|
||||||
|
|
||||||
|
|
||||||
def allowed_architectures_check(
|
def allowed_architectures_check(
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from collections.abc import (
|
from collections.abc import (
|
||||||
Callable,
|
Callable,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from collections.abc import Mapping, Sequence
|
from collections.abc import Mapping, Sequence
|
||||||
from typing import Any, Protocol
|
from typing import Any, Protocol
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
|
These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from collections.abc import Mapping, Sequence
|
from collections.abc import Mapping, Sequence
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from typing import Protocol
|
from typing import Protocol
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import shlex
|
import shlex
|
||||||
import typing
|
import typing
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Literal, get_args
|
from typing import Literal, Self, get_args
|
||||||
|
|
||||||
from .logger import log
|
from .logger import log
|
||||||
from .util.helpers import parse_key_value_string
|
from .util.helpers import parse_key_value_string
|
||||||
@@ -17,8 +15,8 @@ class BuildFrontendConfig:
|
|||||||
name: BuildFrontendName
|
name: BuildFrontendName
|
||||||
args: Sequence[str] = ()
|
args: Sequence[str] = ()
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def from_config_string(config_string: str) -> BuildFrontendConfig:
|
def from_config_string(cls, config_string: str) -> Self:
|
||||||
config_dict = parse_key_value_string(config_string, ["name"], ["args"])
|
config_dict = parse_key_value_string(config_string, ["name"], ["args"])
|
||||||
name = " ".join(config_dict["name"])
|
name = " ".join(config_dict["name"])
|
||||||
if name not in get_args(BuildFrontendName):
|
if name not in get_args(BuildFrontendName):
|
||||||
@@ -29,7 +27,7 @@ class BuildFrontendConfig:
|
|||||||
name = typing.cast(BuildFrontendName, name)
|
name = typing.cast(BuildFrontendName, name)
|
||||||
|
|
||||||
args = config_dict.get("args") or []
|
args = config_dict.get("args") or []
|
||||||
return BuildFrontendConfig(name=name, args=args)
|
return cls(name=name, args=args)
|
||||||
|
|
||||||
def options_summary(self) -> str | dict[str, str]:
|
def options_summary(self) -> str | dict[str, str]:
|
||||||
if not self.args:
|
if not self.args:
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
+26
-28
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -40,6 +38,32 @@ PLATFORM_IDENTIFIER_DESCRIPTIONS: Final[dict[str, str]] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Colors:
|
||||||
|
def __init__(self, *, enabled: bool) -> None:
|
||||||
|
self.red = "\033[31m" if enabled else ""
|
||||||
|
self.green = "\033[32m" if enabled else ""
|
||||||
|
self.yellow = "\033[33m" if enabled else ""
|
||||||
|
self.blue = "\033[34m" if enabled else ""
|
||||||
|
self.cyan = "\033[36m" if enabled else ""
|
||||||
|
self.bright_red = "\033[91m" if enabled else ""
|
||||||
|
self.bright_green = "\033[92m" if enabled else ""
|
||||||
|
self.white = "\033[37m\033[97m" if enabled else ""
|
||||||
|
self.gray = "\033[38;5;244m" if enabled else ""
|
||||||
|
|
||||||
|
self.bg_grey = "\033[48;5;235m" if enabled else ""
|
||||||
|
|
||||||
|
self.bold = "\033[1m" if enabled else ""
|
||||||
|
self.faint = "\033[2m" if enabled else ""
|
||||||
|
|
||||||
|
self.end = "\033[0m" if enabled else ""
|
||||||
|
|
||||||
|
|
||||||
|
class Symbols:
|
||||||
|
def __init__(self, *, unicode: bool) -> None:
|
||||||
|
self.done = "✓" if unicode else "done"
|
||||||
|
self.error = "✕" if unicode else "failed"
|
||||||
|
|
||||||
|
|
||||||
class Logger:
|
class Logger:
|
||||||
fold_mode: str
|
fold_mode: str
|
||||||
colors_enabled: bool
|
colors_enabled: bool
|
||||||
@@ -229,32 +253,6 @@ def build_description_from_identifier(identifier: str) -> str:
|
|||||||
return build_description
|
return build_description
|
||||||
|
|
||||||
|
|
||||||
class Colors:
|
|
||||||
def __init__(self, *, enabled: bool) -> None:
|
|
||||||
self.red = "\033[31m" if enabled else ""
|
|
||||||
self.green = "\033[32m" if enabled else ""
|
|
||||||
self.yellow = "\033[33m" if enabled else ""
|
|
||||||
self.blue = "\033[34m" if enabled else ""
|
|
||||||
self.cyan = "\033[36m" if enabled else ""
|
|
||||||
self.bright_red = "\033[91m" if enabled else ""
|
|
||||||
self.bright_green = "\033[92m" if enabled else ""
|
|
||||||
self.white = "\033[37m\033[97m" if enabled else ""
|
|
||||||
self.gray = "\033[38;5;244m" if enabled else ""
|
|
||||||
|
|
||||||
self.bg_grey = "\033[48;5;235m" if enabled else ""
|
|
||||||
|
|
||||||
self.bold = "\033[1m" if enabled else ""
|
|
||||||
self.faint = "\033[2m" if enabled else ""
|
|
||||||
|
|
||||||
self.end = "\033[0m" if enabled else ""
|
|
||||||
|
|
||||||
|
|
||||||
class Symbols:
|
|
||||||
def __init__(self, *, unicode: bool) -> None:
|
|
||||||
self.done = "✓" if unicode else "done"
|
|
||||||
self.error = "✕" if unicode else "failed"
|
|
||||||
|
|
||||||
|
|
||||||
def file_supports_color(file_obj: IO[AnyStr]) -> bool:
|
def file_supports_color(file_obj: IO[AnyStr]) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns True if the running system's terminal supports color.
|
Returns True if the running system's terminal supports color.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@@ -44,8 +42,8 @@ class OCIContainerEngineConfig:
|
|||||||
create_args: tuple[str, ...] = field(default_factory=tuple)
|
create_args: tuple[str, ...] = field(default_factory=tuple)
|
||||||
disable_host_mount: bool = False
|
disable_host_mount: bool = False
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def from_config_string(config_string: str) -> OCIContainerEngineConfig:
|
def from_config_string(cls, config_string: str) -> Self:
|
||||||
config_dict = parse_key_value_string(
|
config_dict = parse_key_value_string(
|
||||||
config_string,
|
config_string,
|
||||||
["name"],
|
["name"],
|
||||||
@@ -75,9 +73,7 @@ class OCIContainerEngineConfig:
|
|||||||
else:
|
else:
|
||||||
create_args = [arg for arg in create_args if not arg.startswith("--platform=")]
|
create_args = [arg for arg in create_args if not arg.startswith("--platform=")]
|
||||||
|
|
||||||
return OCIContainerEngineConfig(
|
return cls(name=name, create_args=tuple(create_args), disable_host_mount=disable_host_mount)
|
||||||
name=name, create_args=tuple(create_args), disable_host_mount=disable_host_mount
|
|
||||||
)
|
|
||||||
|
|
||||||
def options_summary(self) -> str | dict[str, str]:
|
def options_summary(self) -> str | dict[str, str]:
|
||||||
if not self.create_args:
|
if not self.create_args:
|
||||||
|
|||||||
+12
-14
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import configparser
|
import configparser
|
||||||
import contextlib
|
import contextlib
|
||||||
@@ -12,7 +10,7 @@ import textwrap
|
|||||||
import tomllib
|
import tomllib
|
||||||
from collections.abc import Callable, Generator, Iterable, Mapping, Sequence, Set
|
from collections.abc import Callable, Generator, Iterable, Mapping, Sequence, Set
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Final, Literal, assert_never
|
from typing import Any, Final, Literal, Self, assert_never
|
||||||
|
|
||||||
from packaging.specifiers import SpecifierSet
|
from packaging.specifiers import SpecifierSet
|
||||||
|
|
||||||
@@ -64,9 +62,9 @@ class CommandLineArguments:
|
|||||||
debug_traceback: bool
|
debug_traceback: bool
|
||||||
enable: list[str]
|
enable: list[str]
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def defaults() -> CommandLineArguments:
|
def defaults(cls) -> Self:
|
||||||
return CommandLineArguments(
|
return cls(
|
||||||
platform="auto",
|
platform="auto",
|
||||||
allow_empty=False,
|
allow_empty=False,
|
||||||
archs=None,
|
archs=None,
|
||||||
@@ -138,6 +136,12 @@ SettingTable = Mapping[str, SettingLeaf | SettingList]
|
|||||||
SettingValue = SettingTable | SettingList | SettingLeaf
|
SettingValue = SettingTable | SettingList | SettingLeaf
|
||||||
|
|
||||||
|
|
||||||
|
class InheritRule(enum.Enum):
|
||||||
|
NONE = enum.auto()
|
||||||
|
APPEND = enum.auto()
|
||||||
|
PREPEND = enum.auto()
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True)
|
||||||
class Override:
|
class Override:
|
||||||
select_pattern: str
|
select_pattern: str
|
||||||
@@ -272,12 +276,6 @@ class EnvironmentFormat(OptionFormat):
|
|||||||
return f"{before} {after}"
|
return f"{before} {after}"
|
||||||
|
|
||||||
|
|
||||||
class InheritRule(enum.Enum):
|
|
||||||
NONE = enum.auto()
|
|
||||||
APPEND = enum.auto()
|
|
||||||
PREPEND = enum.auto()
|
|
||||||
|
|
||||||
|
|
||||||
def _resolve_cascade(
|
def _resolve_cascade(
|
||||||
*pairs: tuple[SettingValue | None, InheritRule],
|
*pairs: tuple[SettingValue | None, InheritRule],
|
||||||
ignore_empty: bool = False,
|
ignore_empty: bool = False,
|
||||||
@@ -847,8 +845,8 @@ class Options:
|
|||||||
deprecated_selectors("CIBW_TEST_SKIP", test_selector.skip_config)
|
deprecated_selectors("CIBW_TEST_SKIP", test_selector.skip_config)
|
||||||
|
|
||||||
@functools.cached_property
|
@functools.cached_property
|
||||||
def defaults(self) -> Options:
|
def defaults(self) -> Self:
|
||||||
return Options(
|
return self.__class__(
|
||||||
platform=self.platform,
|
platform=self.platform,
|
||||||
command_line_arguments=CommandLineArguments.defaults(),
|
command_line_arguments=CommandLineArguments.defaults(),
|
||||||
env={},
|
env={},
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
import configparser
|
import configparser
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import itertools
|
import itertools
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import typing
|
import typing
|
||||||
from typing import Final, Literal, Protocol
|
from typing import Final, Literal, Protocol
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import ssl
|
import ssl
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from collections.abc import Mapping, MutableMapping, Sequence
|
from collections.abc import Mapping, MutableMapping, Sequence
|
||||||
from pathlib import Path, PurePath
|
from pathlib import Path, PurePath
|
||||||
from typing import Any, Literal, TypeVar
|
from typing import Any, Literal, Self, TypeVar
|
||||||
|
|
||||||
from packaging.utils import parse_wheel_filename
|
from packaging.utils import parse_wheel_filename
|
||||||
|
|
||||||
@@ -15,9 +13,9 @@ class DependencyConstraints:
|
|||||||
assert base_file_path.exists()
|
assert base_file_path.exists()
|
||||||
self.base_file_path = base_file_path.resolve()
|
self.base_file_path = base_file_path.resolve()
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def with_defaults() -> DependencyConstraints:
|
def with_defaults(cls) -> Self:
|
||||||
return DependencyConstraints(base_file_path=resources.CONSTRAINTS)
|
return cls(base_file_path=resources.CONSTRAINTS)
|
||||||
|
|
||||||
def get_for_python_version(
|
def get_for_python_version(
|
||||||
self, version: str, *, variant: Literal["python", "pyodide"] = "python"
|
self, version: str, *, variant: Literal["python", "pyodide"] = "python"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import tomllib
|
import tomllib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Final
|
from typing import Final
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sysconfig
|
import sysconfig
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ Tags:
|
|||||||
See sessions with `nox -l`
|
See sessions with `nox -l`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
from collections.abc import Generator
|
from collections.abc import Generator
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|
||||||
before_test_project = test_projects.new_c_project()
|
before_test_project = test_projects.new_c_project()
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from contextlib import nullcontext as does_not_raise
|
from contextlib import nullcontext as does_not_raise
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from .base import TestProject
|
from .base import TestProject
|
||||||
from .c import new_c_project
|
from .c import new_c_project
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any, Self
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
@@ -37,8 +35,8 @@ class TestProject:
|
|||||||
|
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
def copy(self) -> TestProject:
|
def copy(self) -> Self:
|
||||||
other = TestProject()
|
other = self.__class__()
|
||||||
other.files = self.files.copy()
|
other.files = self.files.copy()
|
||||||
other.template_context = self.template_context.copy()
|
other.template_context = self.template_context.copy()
|
||||||
return other
|
return other
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
from .base import TestProject
|
from .base import TestProject
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from . import test_projects, utils
|
from . import test_projects, utils
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ Utility functions used by the cibuildwheel tests.
|
|||||||
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
|
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform as pm
|
import platform as pm
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from packaging.specifiers import SpecifierSet
|
from packaging.specifiers import SpecifierSet
|
||||||
|
|
||||||
from cibuildwheel.selector import BuildSelector, EnableGroup
|
from cibuildwheel.selector import BuildSelector, EnableGroup
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from cibuildwheel.util.packaging import DependencyConstraints
|
from cibuildwheel.util.packaging import DependencyConstraints
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import certifi
|
import certifi
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import tomllib
|
import tomllib
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import shlex
|
import shlex
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import tomllib
|
import tomllib
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import PurePath
|
from pathlib import PurePath
|
||||||
from unittest.mock import Mock, call
|
from unittest.mock import Mock, call
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import tomllib
|
import tomllib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from cibuildwheel.__main__ import print_new_wheels
|
from cibuildwheel.__main__ import print_new_wheels
|
||||||
|
|||||||
Reference in New Issue
Block a user