Files
cibuildwheel/docs/setup.md
T

130 lines
5.1 KiB
Markdown
Raw Normal View History

2019-11-09 19:38:59 +00:00
---
title: 'Setup'
---
2020-03-12 19:46:58 +00:00
# GitHub Actions [linux/mac/windows] {: #github-actions}
To build Linux, Mac, and Windows wheels using Github Actions, create a `.github/workflows/build.yml` file in your repo.
> build.yml
```yaml
{% include "../examples/github-minimal.yml" %}
```
Commit this file, and push to Github - either to your default branch, or to a PR branch. The build should start automatically.
For more info on this file, check out the [docs](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions).
[`examples/github-deploy.yml`](https://github.com/joerick/cibuildwheel/blob/master/examples/github-deploy.yml) extends this minimal example with a demonstration of how to automatically upload the built wheels to PyPI.
2019-11-09 19:38:59 +00:00
# Azure Pipelines [linux/mac/windows] {: #azure-pipelines}
2019-09-29 21:53:18 +01:00
2020-03-12 19:46:58 +00:00
To build Linux, Mac, and Windows wheels on Azure Pipelines, create a `azure-pipelines.yml` file in your repo.
2019-09-29 21:53:18 +01:00
2019-10-06 20:36:21 +01:00
> azure-pipelines.yml
2019-09-29 21:53:18 +01:00
```yaml
{% include "../examples/azure-pipelines-minimal.yml" %}
2019-09-29 21:53:18 +01:00
```
!!! note
To support Python 3.5 on Windows, make sure to specify the use of `{vmImage: 'vs2017-win2016'}` on Windows, to ensure the required toolchain is available.
2019-10-07 09:15:59 +01:00
Commit this file, enable building of your repo on Azure Pipelines, and push.
Wheels will be stored for you and available through the Pipelines interface. For more info on this file, check out the [docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema).
2019-11-25 12:43:26 -08:00
# Travis CI [linux/mac/windows] {: #travis-ci}
2019-09-29 21:53:18 +01:00
2019-11-25 12:43:26 -08:00
To build Linux, Mac, and Windows wheels on Travis CI, create a `.travis.yml` file in your repo.
2019-09-29 21:53:18 +01:00
2019-10-06 20:36:21 +01:00
> .travis.yml
```yaml
{% include "../examples/travis-ci-minimal.yml" %}
```
Note that building Windows Python 2.7 wheels on Travis is unsupported.
2019-10-07 09:15:59 +01:00
Commit this file, enable building of your repo on Travis CI, and push.
Then setup a deployment method by following the [Travis CI deployment docs](https://docs.travis-ci.com/user/deployment/), or see [Delivering to PyPI](deliver-to-pypi.md). For more info on `.travis.yml`, check out the [docs](https://docs.travis-ci.com/).
2019-09-29 21:53:18 +01:00
[`examples/travis-deploy.yml`](https://github.com/joerick/cibuildwheel/blob/master/examples/travis-deploy.yml) extends this minimal example with a demonstration of how to automatically upload the built wheels to PyPI.
2019-11-09 19:38:59 +00:00
# CircleCI [linux/mac] {: #circleci}
2019-09-29 21:53:18 +01:00
To build Linux and Mac wheels on CircleCI, create a `.circleci/config.yml` file in your repo,
2019-10-06 20:36:21 +01:00
> .circleci/config.yml
2019-09-29 21:53:18 +01:00
```yaml
{% include "../examples/circleci-minimal.yml" %}
2019-09-29 21:53:18 +01:00
```
2019-10-07 09:15:59 +01:00
Commit this file, enable building of your repo on CircleCI, and push.
2019-10-02 09:49:31 +01:00
!!! note
CircleCI doesn't enable free macOS containers for open source by default, but you can ask for access. See [here](https://circleci.com/docs/2.0/oss/#overview) for more information.
2019-09-29 21:53:18 +01:00
2019-10-07 09:15:59 +01:00
CircleCI will store the built wheels for you - you can access them from the project console. Check out the CircleCI [docs](https://circleci.com/docs/2.0/configuration-reference/#section=configuration) for more info on this config file.
2019-09-29 21:53:18 +01:00
2020-09-02 19:53:03 +01:00
# Gitlab CI [linux] {: #gitlab-ci}
To build Linux wheels on Gitlab CI, create a `.gitlab-ci.yml` file in your repo,
> .gitlab-ci.yml
```yaml
{% include "../examples/gitlab-minimal.yml" %}
```
Commit this file, and push to Gitlab. The pipeline should start automatically.
Gitlab will store the built wheels for you - you can access them from the Pipelines view. Check out the Gitlab [docs](https://docs.gitlab.com/ee/ci/yaml/) for more info on this config file.
2019-11-23 12:51:11 +01:00
# AppVeyor [linux/mac/windows] {: #appveyor}
2019-09-29 21:53:18 +01:00
2019-11-23 12:51:11 +01:00
To build Linux, Mac, and Windows wheels on AppVeyor, create an `appveyor.yml` file in your repo.
2019-09-29 21:53:18 +01:00
2019-10-06 20:36:21 +01:00
> appveyor.yml
2019-09-29 21:53:18 +01:00
```yaml
{% include "../examples/appveyor-minimal.yml" %}
2019-09-29 21:53:18 +01:00
```
2019-10-07 09:15:59 +01:00
Commit this file, enable building of your repo on AppVeyor, and push.
2019-09-29 21:53:18 +01:00
2019-10-07 09:15:59 +01:00
AppVeyor will store the built wheels for you - you can access them from the project console. Alternatively, you may want to store them in the same place as the Travis CI build. See [AppVeyor deployment docs](https://www.appveyor.com/docs/deployment/) for more info, or see [Delivering to PyPI](deliver-to-pypi.md) below.
For more info on this config file, check out the [docs](https://www.appveyor.com/docs/).
2019-09-29 21:53:18 +01:00
2019-10-06 20:36:21 +01:00
> ⚠️ Got an error? Check the [FAQ](faq.md).
2019-11-12 00:43:25 +01:00
<script>
2019-10-06 20:36:21 +01:00
document.addEventListener('DOMContentLoaded', function() {
2019-11-09 19:38:59 +00:00
$('.toctree-l2 a, .rst-content h1').each(function(i, el) {
2019-10-06 20:36:21 +01:00
var text = $(el).text()
var match = text.match(/(.*) \[([a-z/]+)\]/);
if (match) {
2019-11-09 19:38:59 +00:00
var iconHTML = $.map(match[2].split('/'), function(ident) {
2019-10-06 20:36:21 +01:00
switch (ident) {
case 'linux':
return '<i class="fa fa-linux" aria-hidden="true"></i>'
case 'windows':
return '<i class="fa fa-windows" aria-hidden="true"></i>'
case 'mac':
return '<i class="fa fa-apple" aria-hidden="true"></i>'
}
}).join(' ');
2019-11-09 19:38:59 +00:00
$(el).append(
$('<div>')
.append(iconHTML)
.css({float: 'right'})
)
$(el).contents()
.filter(function(){ return this.nodeType == 3; }).first()
.replaceWith(match[1]);
2019-10-06 20:36:21 +01:00
}
});
});
2019-11-12 00:43:25 +01:00
</script>