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()