From a0abe348dd17850558893c7d9797f7a4517c33a5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 4 Feb 2021 12:15:18 -0500 Subject: [PATCH 1/9] docs: support tabs --- docs/extra.css | 39 ++++++++++++++++++++ docs/setup.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 138 insertions(+) diff --git a/docs/extra.css b/docs/extra.css index e7d035aea..7e11f55e0 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -89,3 +89,42 @@ h1, h2, h3, h4, h5, h6 { /* import font awesome 4 for icons */ @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css); + + +/* Tabs */ + +/* Style the tab */ +.tab { + overflow: hidden; + border: 1px solid #ccc; + background-color: #f1f1f1; +} + +/* Style the buttons that are used to open the tab content */ +.tab button { + background-color: inherit; + float: left; + border: none; + outline: none; + cursor: pointer; + padding: 14px 16px; + transition: 0.3s; +} + +/* Change background color of buttons on hover */ +.tab button:hover { + background-color: #ddd; +} + +/* Create an active/current tablink class */ +.tab button.active { + background-color: #ccc; +} + +/* Style the tab content */ +.tabcontent { + display: none; + padding: 6px 12px; + border: 1px solid #ccc; + border-top: none; +} diff --git a/docs/setup.md b/docs/setup.md index cdc2880f9..1510d7b3a 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -6,10 +6,86 @@ title: 'Setup' To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/workflows/build.yml` file in your repo. + +
+ + + +
+ + +
+ +This is the most generic form. + > build.yml ```yaml {% include "../examples/github-minimal.yml" %} ``` +
+
+The GitHub Actions runners have pipx installed, so you can simplify this: + +> build.yml +```yaml +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] + + steps: + - uses: actions/checkout@v2 + + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: choco install vcpython27 -f -y + + - name: Build wheels + run: pix run cibuildwheel==1.8.0 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl +``` +
+
+You can instead use the action, which enables easier auto updating via GitHub's Dependabot. + +> build.yml +```yaml +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] + + steps: + - uses: actions/checkout@v2 + + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: choco install vcpython27 -f -y + + - uses: joerick/cibuildwheel@1.8.0 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl +``` +
Commit this file, and push to GitHub - either to your default branch, or to a PR branch. The build should start automatically. @@ -128,4 +204,26 @@ For more info on this config file, check out the [docs](https://www.appveyor.com } }); }); + + function openGHA(evt, ghaName) { + var i, tabcontent, tablinks; + + // Get all elements with class="tabcontent" and hide them + tabcontent = document.getElementsByClassName("tabcontent"); + for (i = 0; i < tabcontent.length; i++) { + tabcontent[i].style.display = "none"; + } + + // Get all elements with class="tablinks" and remove the class "active" + tablinks = document.getElementsByClassName("tablinks"); + for (i = 0; i < tablinks.length; i++) { + tablinks[i].className = tablinks[i].className.replace(" active", ""); + } + + // Show the current tab, and add an "active" class to the button that opened the tab + document.getElementById(ghaName).style.display = "block"; + evt.currentTarget.className += " active"; + } + + document.getElementById("defaultOpen").click(); diff --git a/mkdocs.yml b/mkdocs.yml index 3b404dbca..34f50c52d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,6 +25,7 @@ nav: - changelog.md markdown_extensions: + - md_in_html - fenced_code - toc: permalink: True From 8d56893a8b28b9731d7e13a0f5aa21e05bab7224 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 6 Feb 2021 11:46:04 +0000 Subject: [PATCH 2/9] Get superfences working --- docs/faq.md | 2 ++ docs/options.md | 5 +++++ docs/setup.md | 15 +++++++++++---- mkdocs.yml | 5 ++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index ade836871..d9dfb9f1b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -105,6 +105,7 @@ Actions. Once QEMU is set up and registered, you just need to set the Linux), and the other architectures are emulated automatically. > .github/workflows/build.yml + ```yaml {% include "../examples/github-with-qemu.yml" %} ``` @@ -130,6 +131,7 @@ Hopefully, this is a temporary situation. Once we have widely available Apple Si Here's an example GitHub Actions workflow with a job that builds for Apple Silicon: > .github/workflows/build_macos.yml + ```yml {% include "../examples/github-apple-silicon.yml" %} ``` diff --git a/docs/options.md b/docs/options.md index 7cba035b3..d1551e28e 100644 --- a/docs/options.md +++ b/docs/options.md @@ -11,6 +11,7 @@ For example, to configure cibuildwheel to run tests, add the following YAML to your CI config file: > .travis.yml ([docs](https://docs.travis-ci.com/user/environment-variables/)) + ```yaml env: global: @@ -19,6 +20,7 @@ env: ``` > appveyor.yml ([docs](https://www.appveyor.com/docs/build-configuration/#environment-variables)) + ```yaml environment: global: @@ -27,6 +29,7 @@ environment: ``` > .circleci/config.yml ([docs](https://circleci.com/docs/2.0/configuration-reference/#environment)) + ```yaml jobs: job_name: @@ -36,6 +39,7 @@ jobs: ``` > azure-pipelines.yml ([docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables)) + ```yaml variables: CIBW_TEST_REQUIRES: pytest @@ -43,6 +47,7 @@ variables: ``` > .github/workflows/*.yml ([docs](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables)) (can be global, in job, or in step) + ```yaml env: CIBW_TEST_REQUIRES: pytest diff --git a/docs/setup.md b/docs/setup.md index 1510d7b3a..0bd14161b 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -4,7 +4,7 @@ title: 'Setup' # 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. +To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/workflows/build_wheels.yml` file in your repo.
@@ -18,7 +18,8 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ This is the most generic form. -> build.yml +> .github/workflows/build_wheels.yml + ```yaml {% include "../examples/github-minimal.yml" %} ``` @@ -26,7 +27,8 @@ This is the most generic form.
The GitHub Actions runners have pipx installed, so you can simplify this: -> build.yml +> .github/workflows/build_wheels.yml + ```yaml name: Build @@ -58,7 +60,8 @@ jobs:
You can instead use the action, which enables easier auto updating via GitHub's Dependabot. -> build.yml +> .github/workflows/build_wheels.yml + ```yaml name: Build @@ -100,6 +103,7 @@ You can also use cibuildwheel directly as an action with `uses: joerick/cibuildw To build Linux, Mac, and Windows wheels on Azure Pipelines, create a `azure-pipelines.yml` file in your repo. > azure-pipelines.yml + ```yaml {% include "../examples/azure-pipelines-minimal.yml" %} ``` @@ -116,6 +120,7 @@ Wheels will be stored for you and available through the Pipelines interface. For To build Linux, Mac, and Windows wheels on Travis CI, create a `.travis.yml` file in your repo. > .travis.yml + ```yaml {% include "../examples/travis-ci-minimal.yml" %} ``` @@ -133,6 +138,7 @@ Then setup a deployment method by following the [Travis CI deployment docs](http To build Linux and Mac wheels on CircleCI, create a `.circleci/config.yml` file in your repo, > .circleci/config.yml + ```yaml {% include "../examples/circleci-minimal.yml" %} ``` @@ -149,6 +155,7 @@ CircleCI will store the built wheels for you - you can access them from the proj 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" %} ``` diff --git a/mkdocs.yml b/mkdocs.yml index 34f50c52d..59f6a2903 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,13 +26,16 @@ nav: markdown_extensions: - md_in_html - - fenced_code - toc: permalink: True - attr_list - admonition - pymdownx.magiclink: repo_url_shortener: True + - pymdownx.highlight: + # use highlightjs - it's built-in to the theme + use_pygments: False + - pymdownx.superfences plugins: - include-markdown From 2df65cf7345f36b1957406d8adfc1b21646e3de2 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 6 Feb 2021 18:15:22 +0000 Subject: [PATCH 3/9] Use an 'admonition' as a tab, add some styling --- docs/extra.css | 53 ++++++++++++------- docs/extra.js | 47 ++++++++++++++++- docs/setup.md | 138 +++++++++++++++++++------------------------------ setup.py | 2 +- 4 files changed, 135 insertions(+), 105 deletions(-) diff --git a/docs/extra.css b/docs/extra.css index 7e11f55e0..ab62371e1 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -94,37 +94,54 @@ h1, h2, h3, h4, h5, h6 { /* Tabs */ /* Style the tab */ -.tab { - overflow: hidden; - border: 1px solid #ccc; - background-color: #f1f1f1; +.tabs { + margin-bottom: 1em; + -webkit-font-smoothing: antialiased; +} + +.tabs-header { + background-color: white; + display: flex; + justify-content: flex-start; + border-bottom: 2px solid #ccc; } /* Style the buttons that are used to open the tab content */ -.tab button { - background-color: inherit; - float: left; +.tabs-header button { + background-color: transparent; border: none; outline: none; cursor: pointer; - padding: 14px 16px; - transition: 0.3s; + color: inherit; + font: inherit; + font-size: 0.9em; + font-weight: 600; + padding: 8px 16px; + border-bottom: 2px solid transparent; + + /* put the border on top of the parent border */ + margin-bottom: -2px; +} + +.tabs-header button:focus-visible { + /* preserve an outline for accesibility purposes */ + outline: 1px solid currentColor; } /* Change background color of buttons on hover */ -.tab button:hover { - background-color: #ddd; +.tabs-header button:hover { + background-color: rgba(0, 0, 0, 0.02); } /* Create an active/current tablink class */ -.tab button.active { - background-color: #ccc; +.tabs-header button.active { + color: #4086bd; + border-bottom-color: currentColor; } /* Style the tab content */ -.tabcontent { - display: none; - padding: 6px 12px; - border: 1px solid #ccc; - border-top: none; +.tabs-content { + background-color: #f1f6fa; + padding: 1px 1em; + padding-top: 0.8em; } diff --git a/docs/extra.js b/docs/extra.js index 1965a84e9..739ab826b 100644 --- a/docs/extra.js +++ b/docs/extra.js @@ -1,4 +1,49 @@ - +// add classes for code-block-filename styling $('.rst-content pre') .prev('blockquote') .addClass('code-block-filename'); + +var i=0 + +// convert tab admonition to tabs +while (true) { + const firstTab = $('.rst-content .admonition.tab').first() + if (firstTab.length == 0) break; + + const otherTabs = firstTab.nextUntil(':not(.admonition.tab)'); + const allTabs = $($.merge($.merge([], firstTab), otherTabs)); + + const tabContainer = $('
').addClass('tabs'); + const headerContainer = $('
').addClass('tabs-header'); + const contentContainer = $('
').addClass('tabs-content'); + console.log(allTabs) + + tabContainer.insertBefore(firstTab); + tabContainer.append(headerContainer, contentContainer) + + const selectTab = function (index) { + headerContainer.children().removeClass('active') + headerContainer.children().eq(index).addClass('active') + contentContainer.children().hide() + contentContainer.children().eq(index).show() + } + + allTabs.each(function (i, el) { + const $el = $(el) + const titleElement = $el.children('.admonition-title') + const title = titleElement.text() + const button = $(' - - -
+ > .github/workflows/build_wheels.yml + ```yaml + {% include "../examples/github-minimal.yml" preserve_includer_indent=true %} + ``` -
+!!! tab "pipx" + The GitHub Actions runners have pipx installed, so you can simplify this: -This is the most generic form. + > .github/workflows/build_wheels.yml -> .github/workflows/build_wheels.yml + ```yaml + name: Build -```yaml -{% include "../examples/github-minimal.yml" %} -``` -
-
-The GitHub Actions runners have pipx installed, so you can simplify this: + on: [push, pull_request] -> .github/workflows/build_wheels.yml + jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] -```yaml -name: Build + steps: + - uses: actions/checkout@v2 -on: [push, pull_request] + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: choco install vcpython27 -f -y -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + - name: Build wheels + run: pix run cibuildwheel==1.8.0 - steps: - - uses: actions/checkout@v2 + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + ``` - - name: Install Visual C++ for Python 2.7 - if: runner.os == 'Windows' - run: choco install vcpython27 -f -y +!!! tab "Action" + You can instead use the action, which enables easier auto updating via GitHub's Dependabot. - - name: Build wheels - run: pix run cibuildwheel==1.8.0 + > .github/workflows/build_wheels.yml - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl -``` -
-
-You can instead use the action, which enables easier auto updating via GitHub's Dependabot. + ```yaml + name: Build -> .github/workflows/build_wheels.yml + on: [push, pull_request] -```yaml -name: Build - -on: [push, pull_request] + jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + steps: + - uses: actions/checkout@v2 - steps: - - uses: actions/checkout@v2 + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: choco install vcpython27 -f -y - - name: Install Visual C++ for Python 2.7 - if: runner.os == 'Windows' - run: choco install vcpython27 -f -y + - uses: joerick/cibuildwheel@1.8.0 - - uses: joerick/cibuildwheel@1.8.0 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl -``` -
+ - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + ``` Commit this file, and push to GitHub - either to your default branch, or to a PR branch. The build should start automatically. @@ -211,26 +201,4 @@ For more info on this config file, check out the [docs](https://www.appveyor.com } }); }); - - function openGHA(evt, ghaName) { - var i, tabcontent, tablinks; - - // Get all elements with class="tabcontent" and hide them - tabcontent = document.getElementsByClassName("tabcontent"); - for (i = 0; i < tabcontent.length; i++) { - tabcontent[i].style.display = "none"; - } - - // Get all elements with class="tablinks" and remove the class "active" - tablinks = document.getElementsByClassName("tablinks"); - for (i = 0; i < tablinks.length; i++) { - tablinks[i].className = tablinks[i].className.replace(" active", ""); - } - - // Show the current tab, and add an "active" class to the button that opened the tab - document.getElementById(ghaName).style.display = "block"; - evt.currentTarget.className += " active"; - } - - document.getElementById("defaultOpen").click(); diff --git a/setup.py b/setup.py index bf34fe946..65e6a7023 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ extras = { "docs": [ - "mkdocs-include-markdown-plugin==2.1.1", + "mkdocs-include-markdown-plugin==2.7.2", "mkdocs==1.0.4", "pymdown-extensions", ], From e6d042ea3878a250036a3653cec4e44936eefb75 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 6 Feb 2021 15:28:14 -0500 Subject: [PATCH 4/9] docs: reorder tabs and modernize --- docs/setup.md | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/docs/setup.md b/docs/setup.md index 07b9bca0d..45b96fe48 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -6,17 +6,10 @@ title: 'Setup' To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/workflows/build_wheels.yml` file in your repo. -!!! tab "Generic" - This is the most generic form. - - > .github/workflows/build_wheels.yml - - ```yaml - {% include "../examples/github-minimal.yml" preserve_includer_indent=true %} - ``` - -!!! tab "pipx" - The GitHub Actions runners have pipx installed, so you can simplify this: +!!! tab "Action" + For GitHub Actions, `cibuildwheel` provides an action you can use. This is + concise and enables easier auto updating via GitHub's Dependabot; see + [Automatic updates](faq.md#automatic-updates). > .github/workflows/build_wheels.yml @@ -31,7 +24,7 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-10.15] steps: - uses: actions/checkout@v2 @@ -40,16 +33,21 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ if: runner.os == 'Windows' run: choco install vcpython27 -f -y - - name: Build wheels - run: pix run cibuildwheel==1.8.0 + - uses: joerick/cibuildwheel@1.8.0 - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl ``` -!!! tab "Action" - You can instead use the action, which enables easier auto updating via GitHub's Dependabot. + You can use `env:` with the action just like you would with `run:`; you can + also use `with:` to set the command line options: `package-dir: .` and + `output-dir: wheelhouse` (those values are the defaults). + +!!! tab "pipx" + The GitHub Actions runners have pipx installed, so you can easily build in + just one line. This is internally how the action works; the main benefit of + the action form is easy updates via GitHub's Dependabot. > .github/workflows/build_wheels.yml @@ -64,7 +62,7 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-10.15] steps: - uses: actions/checkout@v2 @@ -73,20 +71,33 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ if: runner.os == 'Windows' run: choco install vcpython27 -f -y - - uses: joerick/cibuildwheel@1.8.0 + - name: Build wheels + run: pix run cibuildwheel==1.8.0 - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl ``` +!!! tab "Generic" + This is the most generic form using setup-python and pip; it looks the most + like the other CI examples. If you want to avoid having setup that takes + advantage of GitHub Actions features or pipx being preinstalled, this might + appeal to you. + + > .github/workflows/build_wheels.yml + + ```yaml + {% include "../examples/github-minimal.yml" preserve_includer_indent=true %} + ``` + + 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. -You can also use cibuildwheel directly as an action with `uses: joerick/cibuildwheel@v1.9.0`; this combines the download and run steps into a single action, and command line arguments are available via `with:`. This makes it easy to manage cibuildwheel updates via normal actions update mechanisms like dependabot, see [Automatic updates](faq.md#automatic-updates). # Azure Pipelines [linux/mac/windows] {: #azure-pipelines} From 3cd34237e0d6330ec980110a1a240f894c723a6e Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 6 Feb 2021 15:49:58 -0500 Subject: [PATCH 5/9] docs: tabbed options settings --- docs/options.md | 87 +++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 32 deletions(-) diff --git a/docs/options.md b/docs/options.md index d1551e28e..11546bf96 100644 --- a/docs/options.md +++ b/docs/options.md @@ -10,49 +10,72 @@ your CI config. For example, to configure cibuildwheel to run tests, add the following YAML to your CI config file: -> .travis.yml ([docs](https://docs.travis-ci.com/user/environment-variables/)) -```yaml -env: - global: - - CIBW_TEST_REQUIRES=pytest - - CIBW_TEST_COMMAND="pytest {project}/tests" -``` +!!! tab "GitHub Actions" -> appveyor.yml ([docs](https://www.appveyor.com/docs/build-configuration/#environment-variables)) + > .github/workflows/*.yml ([docs](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables)) (can be global, in job, or in step) -```yaml -environment: - global: - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "pytest {project}\\tests" -``` + ```yaml + env: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}/tests" + ``` -> .circleci/config.yml ([docs](https://circleci.com/docs/2.0/configuration-reference/#environment)) +!!! tab "Azure Pipelines" -```yaml -jobs: - job_name: - environment: + > azure-pipelines.yml ([docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables)) + + ```yaml + variables: CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/tests" -``` + ``` -> azure-pipelines.yml ([docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables)) +!!! tab "Travis CI" -```yaml -variables: - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "pytest {project}/tests" -``` + > .travis.yml ([docs](https://docs.travis-ci.com/user/environment-variables/)) -> .github/workflows/*.yml ([docs](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables)) (can be global, in job, or in step) + ```yaml + env: + global: + - CIBW_TEST_REQUIRES=pytest + - CIBW_TEST_COMMAND="pytest {project}/tests" + ``` + +!!! tab "AppVeyor" + + > appveyor.yml ([docs](https://www.appveyor.com/docs/build-configuration/#environment-variables)) + + ```yaml + environment: + global: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}\\tests" + ``` + +!!! tab "CircleCI" + + > .circleci/config.yml ([docs](https://circleci.com/docs/2.0/configuration-reference/#environment)) + + ```yaml + jobs: + job_name: + environment: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}/tests" + ``` + +!!! tab "Gitlab CI" + + > .gitlab-ci.yml ([docs](https://docs.gitlab.com/ee/ci/variables/README.html#create-a-custom-variable-in-gitlab-ciyml)) + + ```yaml + linux: + variables: + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: "pytest {project}/tests" + ``` -```yaml -env: - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "pytest {project}/tests" -``` ## Build selection From 96ac7d14f3209d6cc37f70146715a31ba067a5bf Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 6 Feb 2021 16:01:33 -0500 Subject: [PATCH 6/9] docs: reorder to match order in other places --- docs/setup.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/setup.md b/docs/setup.md index 45b96fe48..93b2eabfd 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -134,6 +134,22 @@ Then setup a deployment method by following the [Travis CI deployment docs](http [`examples/travis-ci-deploy.yml`](https://github.com/joerick/cibuildwheel/blob/master/examples/travis-ci-deploy.yml) extends this minimal example with a demonstration of how to automatically upload the built wheels to PyPI. +# AppVeyor [linux/mac/windows] {: #appveyor} + +To build Linux, Mac, and Windows wheels on AppVeyor, create an `appveyor.yml` file in your repo. + +> appveyor.yml + +```yaml +{% include "../examples/appveyor-minimal.yml" %} +``` + +Commit this file, enable building of your repo on AppVeyor, and push. + +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/). + # CircleCI [linux/mac] {: #circleci} To build Linux and Mac wheels on CircleCI, create a `.circleci/config.yml` file in your repo, @@ -165,22 +181,6 @@ 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. -# AppVeyor [linux/mac/windows] {: #appveyor} - -To build Linux, Mac, and Windows wheels on AppVeyor, create an `appveyor.yml` file in your repo. - -> appveyor.yml - -```yaml -{% include "../examples/appveyor-minimal.yml" %} -``` - -Commit this file, enable building of your repo on AppVeyor, and push. - -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/). - > ⚠️ Got an error? Check the [FAQ](faq.md).