From 9b2f68ef5dea0c60dc86dee4f139bddd21821373 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 14 May 2024 09:45:45 -0400 Subject: [PATCH 1/3] add docs explaining how to install libraries within build environment --- docs/source/publish.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/source/publish.rst b/docs/source/publish.rst index c50712e..98d1b3a 100644 --- a/docs/source/publish.rst +++ b/docs/source/publish.rst @@ -111,6 +111,36 @@ Packages needed to build the source distribution for testing. Must be a string of space-separated apt packages. Default is install nothing extra. +.. warning:: + These libraries are only installed on the host Linux machine. + To install libraries or packages within the build environment, alter the + ``cibuildwheel`` configuration to add an install command before the build, + such as by setting the ``CIBW_BEFORE_BUILD_MACOS`` environment variable: + + .. code:: yaml + + jobs: + build: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 + with: + env: | + CIBW_BEFORE_BUILD_LINUX: apt install libfftw3-dev + CIBW_BEFORE_BUILD_MACOS: brew install fftw + FFTW_DIR: /opt/homebrew/opt/fftw/lib/ + targets: | + - cp3*-manylinux_x86_64 + - cp3*-macosx_x86_64 + + or by adding an entry to the ``tool.cibuildwheel`` table in ``pyproject.toml``: + + .. code:: toml + + [tool.cibuildwheel.linux] + before-build = "apt install libfftw3-dev" + + [tool.cibuildwheel.macos] + before-build = "brew install fftw" + upload_to_pypi ^^^^^^^^^^^^^^ From c7ac864ad5cb9a02c620e17e1d8848d77b4e8141 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 14 May 2024 09:52:08 -0400 Subject: [PATCH 2/3] reorder examples --- docs/source/publish.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/source/publish.rst b/docs/source/publish.rst index 98d1b3a..d4bae45 100644 --- a/docs/source/publish.rst +++ b/docs/source/publish.rst @@ -115,7 +115,17 @@ extra. These libraries are only installed on the host Linux machine. To install libraries or packages within the build environment, alter the ``cibuildwheel`` configuration to add an install command before the build, - such as by setting the ``CIBW_BEFORE_BUILD_MACOS`` environment variable: + such as adding an entry to the ``tool.cibuildwheel`` table in ``pyproject.toml``: + + .. code:: toml + + [tool.cibuildwheel.linux] + before-build = "apt install libfftw3-dev" + + [tool.cibuildwheel.macos] + before-build = "brew install fftw" + + or by setting the ``CIBW_BEFORE_BUILD_MACOS`` environment variable: .. code:: yaml @@ -131,16 +141,6 @@ extra. - cp3*-manylinux_x86_64 - cp3*-macosx_x86_64 - or by adding an entry to the ``tool.cibuildwheel`` table in ``pyproject.toml``: - - .. code:: toml - - [tool.cibuildwheel.linux] - before-build = "apt install libfftw3-dev" - - [tool.cibuildwheel.macos] - before-build = "brew install fftw" - upload_to_pypi ^^^^^^^^^^^^^^ From 31597370f6984f63abd478ccc30b0bc863d1cbfe Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Mon, 3 Jun 2024 12:19:16 -0400 Subject: [PATCH 3/3] add link to CIBW docs --- docs/source/publish.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/publish.rst b/docs/source/publish.rst index d4bae45..2f43f36 100644 --- a/docs/source/publish.rst +++ b/docs/source/publish.rst @@ -125,7 +125,7 @@ extra. [tool.cibuildwheel.macos] before-build = "brew install fftw" - or by setting the ``CIBW_BEFORE_BUILD_MACOS`` environment variable: + or by [setting a ``CIBW_BEFORE_BUILD_*`` environment variable](https://cibuildwheel.pypa.io/en/stable/options/#before-build): .. code:: yaml