Merge pull request #1412 from pypa/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
This commit is contained in:
@@ -14,12 +14,12 @@ repos:
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.12.0
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.0.237
|
||||
rev: v0.0.243
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix"]
|
||||
@@ -31,7 +31,7 @@ repos:
|
||||
args: [--include-version-classifiers, --max-py-version=3.11]
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v0.991
|
||||
rev: v1.0.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy 3.7 on cibuildwheel/
|
||||
|
||||
@@ -65,7 +65,6 @@ AnyConfig = Union[ConfigWinCP, ConfigWinPP, ConfigMacOS]
|
||||
|
||||
class WindowsVersions:
|
||||
def __init__(self, arch_str: ArchStr) -> None:
|
||||
|
||||
response = requests.get("https://api.nuget.org/v3/index.json")
|
||||
response.raise_for_status()
|
||||
api_info = response.json()
|
||||
@@ -88,7 +87,6 @@ class WindowsVersions:
|
||||
self.version_dict = {Version(v): v for v in cp_info["versions"]}
|
||||
|
||||
def update_version_windows(self, spec: Specifier) -> ConfigWinCP | None:
|
||||
|
||||
# Specifier.filter selects all non pre-releases that match the spec,
|
||||
# unless there are only pre-releases, then it selects pre-releases
|
||||
# instead (like pip)
|
||||
@@ -111,7 +109,6 @@ class WindowsVersions:
|
||||
|
||||
class PyPyVersions:
|
||||
def __init__(self, arch_str: ArchStr):
|
||||
|
||||
response = requests.get("https://downloads.python.org/pypy/versions.json")
|
||||
response.raise_for_status()
|
||||
|
||||
@@ -191,7 +188,6 @@ class PyPyVersions:
|
||||
|
||||
class CPythonVersions:
|
||||
def __init__(self) -> None:
|
||||
|
||||
response = requests.get(
|
||||
"https://www.python.org/api/v2/downloads/release/?is_published=true"
|
||||
)
|
||||
@@ -210,7 +206,6 @@ class CPythonVersions:
|
||||
def update_version_macos(
|
||||
self, identifier: str, version: Version, spec: Specifier
|
||||
) -> ConfigMacOS | None:
|
||||
|
||||
# see note above on Specifier.filter
|
||||
unsorted_versions = spec.filter(self.versions_dict)
|
||||
sorted_versions = sorted(unsorted_versions, reverse=True)
|
||||
@@ -296,7 +291,6 @@ class AllVersions:
|
||||
"--level", default="INFO", type=click.Choice(["WARNING", "INFO", "DEBUG"], case_sensitive=False)
|
||||
)
|
||||
def update_pythons(force: bool, level: str) -> None:
|
||||
|
||||
logging.basicConfig(
|
||||
level="INFO",
|
||||
format="%(message)s",
|
||||
|
||||
@@ -72,7 +72,6 @@ def git_ls_remote_versions(url) -> list[VersionTuple]:
|
||||
"--level", default="INFO", type=click.Choice(["WARNING", "INFO", "DEBUG"], case_sensitive=False)
|
||||
)
|
||||
def update_virtualenv(force: bool, level: str) -> None:
|
||||
|
||||
logging.basicConfig(
|
||||
level="INFO",
|
||||
format="%(message)s",
|
||||
|
||||
@@ -134,7 +134,6 @@ def allowed_architectures_check(
|
||||
platform: PlatformName,
|
||||
architectures: set[Architecture],
|
||||
) -> None:
|
||||
|
||||
allowed_architectures = Architecture.all_archs(platform)
|
||||
|
||||
msg = f"{PRETTY_NAMES[platform]} only supports {sorted(allowed_architectures)} at the moment."
|
||||
|
||||
@@ -48,7 +48,6 @@ def get_python_configurations(
|
||||
build_selector: BuildSelector,
|
||||
architectures: set[Architecture],
|
||||
) -> list[PythonConfiguration]:
|
||||
|
||||
full_python_configs = read_python_configs("linux")
|
||||
|
||||
python_configurations = [PythonConfiguration(**item) for item in full_python_configs]
|
||||
@@ -224,7 +223,6 @@ def build_in_container(
|
||||
)
|
||||
repaired_wheels = [compatible_wheel]
|
||||
else:
|
||||
|
||||
if build_options.before_build:
|
||||
log.step("Running before_build...")
|
||||
before_build_prepared = prepare_command(
|
||||
@@ -421,7 +419,6 @@ def build(options: Options, tmp_path: Path) -> None: # noqa: ARG001
|
||||
cwd=container_project_path,
|
||||
engine=options.globals.container_engine,
|
||||
) as container:
|
||||
|
||||
build_in_container(
|
||||
options=options,
|
||||
platform_configs=build_step.platform_configs,
|
||||
@@ -446,7 +443,6 @@ def _matches_prepared_command(error_cmd: list[str], command_template: str) -> bo
|
||||
|
||||
|
||||
def troubleshoot(options: Options, error: Exception) -> None:
|
||||
|
||||
if isinstance(error, subprocess.CalledProcessError) and (
|
||||
error.cmd[0:4] == ["python", "-m", "pip", "wheel"]
|
||||
or error.cmd[0:3] == ["python", "-m", "build"]
|
||||
|
||||
@@ -71,7 +71,6 @@ class PythonConfiguration:
|
||||
def get_python_configurations(
|
||||
build_selector: BuildSelector, architectures: set[Architecture]
|
||||
) -> list[PythonConfiguration]:
|
||||
|
||||
full_python_configs = read_python_configs("macos")
|
||||
|
||||
python_configurations = [PythonConfiguration(**item) for item in full_python_configs]
|
||||
@@ -460,7 +459,7 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
env=env,
|
||||
capture_stdout=True,
|
||||
).strip()
|
||||
testing_archs: list[Literal["x86_64", "arm64"]] # noqa: F821
|
||||
testing_archs: list[Literal["x86_64", "arm64"]]
|
||||
|
||||
if config_is_arm64:
|
||||
testing_archs = ["arm64"]
|
||||
|
||||
@@ -68,7 +68,6 @@ class OCIContainer:
|
||||
self.engine = engine
|
||||
|
||||
def __enter__(self) -> OCIContainer:
|
||||
|
||||
self.name = f"cibuildwheel-{uuid.uuid4()}"
|
||||
|
||||
# work-around for Travis-CI PPC64le Docker runs since 2021:
|
||||
@@ -130,7 +129,6 @@ class OCIContainer:
|
||||
exc_val: BaseException | None,
|
||||
exc_tb: TracebackType | None,
|
||||
) -> None:
|
||||
|
||||
self.bash_stdin.write(b"exit 0\n")
|
||||
self.bash_stdin.flush()
|
||||
self.process.wait(timeout=30)
|
||||
@@ -244,7 +242,6 @@ class OCIContainer:
|
||||
capture_output: bool = False,
|
||||
cwd: PathOrStr | None = None,
|
||||
) -> str:
|
||||
|
||||
if cwd is None:
|
||||
# Podman does not start the a container in a specific working dir
|
||||
# so we always need to specify it when making calls.
|
||||
|
||||
@@ -44,7 +44,7 @@ from .util import (
|
||||
|
||||
@dataclasses.dataclass
|
||||
class CommandLineArguments:
|
||||
platform: Literal["auto", "linux", "macos", "windows"] | None # noqa: F821
|
||||
platform: Literal["auto", "linux", "macos", "windows"] | None
|
||||
archs: str | None
|
||||
output_dir: Path
|
||||
only: str | None
|
||||
|
||||
@@ -73,7 +73,6 @@ def get_python_configurations(
|
||||
build_selector: BuildSelector,
|
||||
architectures: set[Architecture],
|
||||
) -> list[PythonConfiguration]:
|
||||
|
||||
full_python_configs = read_python_configs("windows")
|
||||
|
||||
python_configurations = [PythonConfiguration(**item) for item in full_python_configs]
|
||||
|
||||
+2
-2
@@ -129,7 +129,7 @@ select = [
|
||||
"ISC", # flake8-implicit-str-concat
|
||||
"PGH", # pygrep-hooks
|
||||
"PIE", # flake8-pie
|
||||
"PLC", "PLE", "PLR", "PLW", # pylint
|
||||
"PLC", "PLE", "PLW", # pylint
|
||||
"PT", # flake8-pytest-style
|
||||
"RET", # flake8-return
|
||||
"RUF", # Ruff-specific
|
||||
@@ -137,7 +137,7 @@ select = [
|
||||
"UP", # pyupgrade
|
||||
"YTT", # flake8-2020
|
||||
]
|
||||
ignore = [
|
||||
extend-ignore = [
|
||||
"PLR2004", "E501",
|
||||
"RET504", "RET505", "RET508", # else after control flow
|
||||
"PT004", # Rename suggested for returnless fixtures
|
||||
|
||||
@@ -35,7 +35,6 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
|
||||
def test_pep518(tmp_path, build_frontend_env):
|
||||
|
||||
project_dir = tmp_path / "project"
|
||||
basic_project.generate(project_dir)
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ def test_platform_environment(intercepted_build_args):
|
||||
|
||||
|
||||
def test_archs_default(platform, intercepted_build_args):
|
||||
|
||||
main()
|
||||
options = intercepted_build_args.args[0]
|
||||
|
||||
@@ -89,7 +88,6 @@ def test_archs_default(platform, intercepted_build_args):
|
||||
|
||||
@pytest.mark.parametrize("use_env_var", [False, True])
|
||||
def test_archs_argument(platform, intercepted_build_args, monkeypatch, use_env_var):
|
||||
|
||||
if use_env_var:
|
||||
monkeypatch.setenv("CIBW_ARCHS", "ppc64le")
|
||||
else:
|
||||
|
||||
@@ -27,7 +27,6 @@ def fake_package_dir(monkeypatch, tmp_path):
|
||||
|
||||
@pytest.mark.usefixtures("platform")
|
||||
def test_no_override(intercepted_build_args):
|
||||
|
||||
main()
|
||||
|
||||
options = intercepted_build_args.args[0]
|
||||
@@ -56,7 +55,6 @@ def test_override_env(monkeypatch, intercepted_build_args):
|
||||
|
||||
@pytest.mark.usefixtures("platform")
|
||||
def test_override_setup_cfg(intercepted_build_args, fake_package_dir):
|
||||
|
||||
fake_package_dir.joinpath("setup.cfg").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
@@ -79,7 +77,6 @@ def test_override_setup_cfg(intercepted_build_args, fake_package_dir):
|
||||
|
||||
@pytest.mark.usefixtures("platform")
|
||||
def test_override_pyproject_toml(intercepted_build_args, fake_package_dir):
|
||||
|
||||
fake_package_dir.joinpath("pyproject.toml").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
@@ -102,7 +99,6 @@ def test_override_pyproject_toml(intercepted_build_args, fake_package_dir):
|
||||
|
||||
@pytest.mark.usefixtures("platform")
|
||||
def test_override_setup_py_simple(intercepted_build_args, fake_package_dir):
|
||||
|
||||
fake_package_dir.joinpath("setup.py").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user