Files
cibuildwheel/docs/setup.md
T
Joe RickerbyandHenry Schreiner 1d34f85c63 General docs improvements for v3.0 (#2280)
* Split the docs into sections

* Split the options page into two pages - so the reference is more clean

* Reorder/Tidy up this 'deliver' page to make auto-deploy more obvious

* Fix up some links

* Merge the platform docs into a single page to clean up the navbar.

* Split the setup page to make a page dedicated to CI setup

* Move general platform-specific information into the platforms page

* Tidy up the platforms page

* Remove some redundancy in the cpp/platforms docs

* Clarify this section

* Move another FAQ entry to the platforms page

* Remove some out-of-date entries from the FAQ

* A few corrections to the options page

* Fix some broken links

* Improve the Docker references

* Update bump version filename

* Improve options TOC information density

* whitespace

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

* Convert the normal test invocation to `pytest ./tests`, not placeholder

---------

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2025-04-13 08:16:55 +02:00

2.0 KiB

title
title
Getting started

Getting started

Before getting to CI setup, it can be convenient to test cibuildwheel locally to quickly iterate and track down issues without having to commit each change, push, and then check CI logs.

Install cibuildwheel and run a build like this:

# run using uv
uvx cibuildwheel

# or pipx
pipx run cibuildwheel

# or, install it first
pip install cibuildwheel
cibuildwheel

!!!tip You can pass the --platform linux option to cibuildwheel to build Linux wheels, even if you're not on Linux. On most machines, the easiest builds to try are the Linux builds. You don't need any software installed except a Docker daemon, such as Docker Desktop. Each platform that cibuildwheel supports has its own system requirements and platform-specific behaviors. See the platforms page for details.

You should see the builds taking place. You can experiment with options using environment variables or pyproject.toml.

!!! tab "Environment variables"

cibuildwheel will read config from the environment. Syntax varies, depending on your shell:

> POSIX shell (Linux/macOS)

```sh
# run a command to set up the build system
export CIBW_BEFORE_ALL='uname -a'

cibuildwheel
```

> CMD (Windows)

```bat
set CIBW_BEFORE_ALL='uname -a'

cibuildwheel
```

!!! tab "pyproject.toml"

If you write your options into [`pyproject.toml`](configuration.md#configuration-file), you can work on your options locally, and they'll be automatically picked up when running in CI.

> pyproject.toml

```
[tool.cibuildwheel]
before-all = "uname -a"
```

Then invoke cibuildwheel, like:

```console
cibuildwheel
```