From 063161f5af6245e8b5c8e3be0ca89fee80ce029e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 14:06:56 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#1468) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate 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) * chore: update for mypy bug Signed-off-by: Henry Schreiner --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 6 +++--- cibuildwheel/oci_container.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afe33c4f..ace6a97e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,10 +19,10 @@ repos: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.260 + 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 @@ -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/ diff --git a/cibuildwheel/oci_container.py b/cibuildwheel/oci_container.py index b92acceb..df6af6c9 100644 --- a/cibuildwheel/oci_container.py +++ b/cibuildwheel/oci_container.py @@ -166,6 +166,7 @@ class OCIContainer: cwd=from_path, ) else: + exec_process: subprocess.Popen[bytes] with subprocess.Popen( [ self.engine, @@ -178,10 +179,10 @@ class OCIContainer: ], 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()