From 20cb2060e346af53b5f62848a03228c8baa3d866 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Sep 2026 19:07:13 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cibuildwheel/logger.py | 2 -- cibuildwheel/options.py | 1 - docs/faq.md | 14 ++++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cibuildwheel/logger.py b/cibuildwheel/logger.py index aeb6c42f..b2b48c04 100644 --- a/cibuildwheel/logger.py +++ b/cibuildwheel/logger.py @@ -2,8 +2,6 @@ from __future__ import annotations __lazy_modules__ = { "cibuildwheel.ci", - "contextlib", - "functools", "hashlib", "humanize", "io", diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index f3d4701a..017094b9 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -14,7 +14,6 @@ __lazy_modules__ = { "cibuildwheel.util.packaging", "collections", "configparser", - "contextlib", "difflib", "packaging", "packaging.specifiers", diff --git a/docs/faq.md b/docs/faq.md index 05cebfb7..956f6110 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -46,7 +46,7 @@ An easy way to do it in Python 3 is through the `optional` named argument of `Ex myextension = Extension( "myextension", ["myextension.c"], - optional=os.environ.get('CIBUILDWHEEL', '0') != '1', + optional=os.environ.get("CIBUILDWHEEL", "0") != "1", ) ``` @@ -253,7 +253,7 @@ class BuildPyCommand(setuptools.command.build_py.build_py): setuptools.setup( cmdclass={ - 'build_py': BuildPyCommand, + "build_py": BuildPyCommand, }, # Usual setup() args. # ... @@ -447,13 +447,15 @@ Additionally, Visual Studio 2019 started linking to an even newer DLL, `VCRUNTIM To add the `/d2FH4-` flag to a standard `setup.py` using `setuptools`, the `extra_compile_args` option can be used: ```python - ext_modules=[ +ext_modules = ( + [ Extension( - 'c_module', - sources=['extension.c'], - extra_compile_args=['/d2FH4-'] if sys.platform == 'win32' else [] + "c_module", + sources=["extension.c"], + extra_compile_args=["/d2FH4-"] if sys.platform == "win32" else [], ) ], +) ``` To investigate the dependencies of a C extension (i.e., the `.pyd` file, a DLL in disguise) on Windows, [Dependency Walker](http://www.dependencywalker.com/) is a great tool. For diagnosing a failing import, the [dlltracer](https://pypi.org/project/dlltracer/) tool may also provide additional details.