Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docs explaining how to install libraries within build environment #202

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/source/publish.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 a ``CIBW_BEFORE_BUILD_*`` environment variable](https://cibuildwheel.pypa.io/en/stable/options/#before-build):

.. 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

upload_to_pypi
^^^^^^^^^^^^^^

Expand Down