Skip to content

Commit 9b2f68e

Browse files
add docs explaining how to install libraries within build environment
1 parent 2042027 commit 9b2f68e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/source/publish.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,36 @@ Packages needed to build the source distribution for testing. Must be a
111111
string of space-separated apt packages. Default is install nothing
112112
extra.
113113

114+
.. warning::
115+
These libraries are only installed on the host Linux machine.
116+
To install libraries or packages within the build environment, alter the
117+
``cibuildwheel`` configuration to add an install command before the build,
118+
such as by setting the ``CIBW_BEFORE_BUILD_MACOS`` environment variable:
119+
120+
.. code:: yaml
121+
122+
jobs:
123+
build:
124+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
125+
with:
126+
env: |
127+
CIBW_BEFORE_BUILD_LINUX: apt install libfftw3-dev
128+
CIBW_BEFORE_BUILD_MACOS: brew install fftw
129+
FFTW_DIR: /opt/homebrew/opt/fftw/lib/
130+
targets: |
131+
- cp3*-manylinux_x86_64
132+
- cp3*-macosx_x86_64
133+
134+
or by adding an entry to the ``tool.cibuildwheel`` table in ``pyproject.toml``:
135+
136+
.. code:: toml
137+
138+
[tool.cibuildwheel.linux]
139+
before-build = "apt install libfftw3-dev"
140+
141+
[tool.cibuildwheel.macos]
142+
before-build = "brew install fftw"
143+
114144
upload_to_pypi
115145
^^^^^^^^^^^^^^
116146

0 commit comments

Comments
 (0)