From e9fd9eaeadf9edbd398861799c14506faa244b82 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 15 Nov 2019 02:27:29 +0000 Subject: [PATCH] Address @joerick's comments --- README.md | 2 +- cibuildwheel/__main__.py | 2 +- docs/options.md | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5e06b880..050b8a55 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Options | | [`CIBW_BUILD`](https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip) [`CIBW_SKIP`](https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip) | Choose the Python versions to build | | **Build environment** | [`CIBW_ENVIRONMENT`](https://cibuildwheel.readthedocs.io/en/stable/options/#environment) | Set environment variables needed during the build | | | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build | -| | [`CIBW_REPAIR_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#repair-command) | Execute a shell command to repair each (non-pure Python) built wheel | +| | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each (non-pure Python) built wheel | | | [`CIBW_MANYLINUX_X86_64_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) [`CIBW_MANYLINUX_I686_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) | Specify alternative manylinux docker images | | **Testing** | [`CIBW_TEST_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#test-command) | Execute a shell command to test each built wheel | | | [`CIBW_TEST_REQUIRES`](https://cibuildwheel.readthedocs.io/en/stable/options/#test-requires) | Install Python dependencies before running the tests | diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index a4be4f52..9b237f76 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -95,7 +95,7 @@ def main(): repair_command_default = 'delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} {wheel}' else: repair_command_default = '' - repair_command = get_option_from_environment('CIBW_REPAIR_COMMAND', platform=platform, default=repair_command_default) + repair_command = get_option_from_environment('CIBW_REPAIR_WHEEL_COMMAND', platform=platform, default=repair_command_default) environment_config = get_option_from_environment('CIBW_ENVIRONMENT', platform=platform, default='') if test_extras: diff --git a/docs/options.md b/docs/options.md index 110c175a..45a42b72 100644 --- a/docs/options.md +++ b/docs/options.md @@ -197,10 +197,11 @@ Platform-specific variants also available:
`CIBW_BEFORE_BUILD_MACOS` | `CIBW_BEFORE_BUILD_WINDOWS` | `CIBW_BEFORE_BUILD_LINUX` -### `CIBW_REPAIR_COMMAND` {: #repair-command} +### `CIBW_REPAIR_WHEEL_COMMAND` {: #repair-wheel-command} > Execute a shell command to repair each (non-pure Python) built wheel Default: + - on Linux: `'auditwheel repair -w {dest_dir} {wheel}'` - on macOS: `'delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} {wheel}'` - on Windows: `''` @@ -209,13 +210,24 @@ A shell command to repair a built wheel by copying external library dependencies The command is run on each built wheel (except for pure Python ones) before testing it. The following placeholders must be used inside the command and will be replaced by `cibuildwheel`: + - `{wheel}` for the absolute path to the built wheel - `{dest_dir}` for the absolute path of the directory where to create the repaired wheel. On Linux and macOS, the command is run in a shell, so you can write things like `cmd1 && cmd2`. +#### Examples + +```yaml +# don't repair macOS wheels +CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" + +# pass the `--lib-sdir .` flag to auditwheel on Linux +CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --lib-sdir . -w {dest_dir} {wheel}" +``` + Platform-specific variants also available:
-`CIBW_REPAIR_COMMAND_MACOS` | `CIBW_REPAIR_COMMAND_WINDOWS` | `CIBW_REPAIR_COMMAND_LINUX` +`CIBW_REPAIR_WHEEL_COMMAND_MACOS` | `CIBW_REPAIR_WHEEL_COMMAND_WINDOWS` | `CIBW_REPAIR_WHEEL_COMMAND_LINUX` ### `CIBW_MANYLINUX_X86_64_IMAGE`, `CIBW_MANYLINUX_I686_IMAGE` {: #manylinux-image}