Skip to content

Commit 7d299a4

Browse files
authored
Merge pull request #202 from zacharyburnett/docs/cibw_lib_install_conf
add docs explaining how to install libraries within build environment
2 parents 333dcd6 + 3159737 commit 7d299a4

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 adding an entry to the ``tool.cibuildwheel`` table in ``pyproject.toml``:
119+
120+
.. code:: toml
121+
122+
[tool.cibuildwheel.linux]
123+
before-build = "apt install libfftw3-dev"
124+
125+
[tool.cibuildwheel.macos]
126+
before-build = "brew install fftw"
127+
128+
or by [setting a ``CIBW_BEFORE_BUILD_*`` environment variable](https://cibuildwheel.pypa.io/en/stable/options/#before-build):
129+
130+
.. code:: yaml
131+
132+
jobs:
133+
build:
134+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
135+
with:
136+
env: |
137+
CIBW_BEFORE_BUILD_LINUX: apt install libfftw3-dev
138+
CIBW_BEFORE_BUILD_MACOS: brew install fftw
139+
FFTW_DIR: /opt/homebrew/opt/fftw/lib/
140+
targets: |
141+
- cp3*-manylinux_x86_64
142+
- cp3*-macosx_x86_64
143+
114144
upload_to_pypi
115145
^^^^^^^^^^^^^^
116146

0 commit comments

Comments
 (0)