From 8d13773fe2d83c023a9952b816bf774128de8cd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 22:01:05 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.260 → v0.0.261](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.260...v0.0.261) - [github.com/pre-commit/mirrors-mypy: v1.1.1 → v1.2.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.1.1...v1.2.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afe33c4f2..ae8c8064f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.260 + rev: v0.0.261 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: v1.1.1 + rev: v1.2.0 hooks: - id: mypy name: mypy 3.7 on cibuildwheel/ From 41e488edff25e49d2bb8da15399857a1db6a29b0 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 17 Apr 2023 10:17:03 -0400 Subject: [PATCH 2/2] chore: update for mypy bug Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 2 +- cibuildwheel/oci_container.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae8c8064f..ace6a97e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: rev: v0.0.261 hooks: - id: ruff - args: ["--fix"] + args: ["--fix", "--show-fixes"] - repo: https://github.com/asottile/setup-cfg-fmt rev: v2.2.0 diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index b92acceb0..df6af6c97 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -166,6 +166,7 @@ def copy_into(self, from_path: Path, to_path: PurePath) -> None: cwd=from_path, ) else: + exec_process: subprocess.Popen[bytes] with subprocess.Popen( [ self.engine, @@ -178,10 +179,10 @@ def copy_into(self, from_path: Path, to_path: PurePath) -> None: ], stdin=subprocess.PIPE, ) as exec_process: - exec_process.stdin = cast(IO[bytes], exec_process.stdin) - + assert exec_process.stdin with open(from_path, "rb") as from_file: - shutil.copyfileobj(from_file, exec_process.stdin) + # Bug in mypy, https://github.com/python/mypy/issues/15031 + shutil.copyfileobj(from_file, exec_process.stdin) # type: ignore[misc] exec_process.stdin.close() exec_process.wait()