From 442174157a01a400959cf249f9edac96ba11eb0d Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Aug 2020 12:15:53 +0100 Subject: [PATCH 01/21] Add a test Gitlab CI config --- cibuildwheel/.gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 cibuildwheel/.gitlab-ci.yml diff --git a/cibuildwheel/.gitlab-ci.yml b/cibuildwheel/.gitlab-ci.yml new file mode 100644 index 00000000..9a441134 --- /dev/null +++ b/cibuildwheel/.gitlab-ci.yml @@ -0,0 +1,6 @@ + +linux: + image: docker + script: + - python -m pip install -r requirements-dev.txt + - python ./bin/run_tests.py From 48c23b10d0c60791ca58e9b407ff749ad4119041 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Aug 2020 13:36:48 +0100 Subject: [PATCH 02/21] Move gitlab config to the right location --- cibuildwheel/.gitlab-ci.yml => .gitlab-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cibuildwheel/.gitlab-ci.yml => .gitlab-ci.yml (100%) diff --git a/cibuildwheel/.gitlab-ci.yml b/.gitlab-ci.yml similarity index 100% rename from cibuildwheel/.gitlab-ci.yml rename to .gitlab-ci.yml From 8ce553b2ea48c3b7d002e6d7a787d78185443dbf Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Aug 2020 13:42:52 +0100 Subject: [PATCH 03/21] Tweak config --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a441134..fc7b81fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ linux: - image: docker + image: python:3.8 script: + - curl -sSL https://get.docker.com/ | sh - python -m pip install -r requirements-dev.txt - python ./bin/run_tests.py From 3c577ab036852be4b5f8c97e2578554ee03b19a2 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Aug 2020 13:49:52 +0100 Subject: [PATCH 04/21] Add docker config --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc7b81fa..19fae5d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,15 @@ linux: image: python:3.8 + services: + - name: docker:dind + # entrypoint: ["env", "-u", "DOCKER_HOST"] + # command: ["dockerd-entrypoint.sh"] + # variables: + # DOCKER_HOST: tcp://docker:2375/ + # DOCKER_DRIVER: overlay2 + # # See https://github.com/docker-library/docker/pull/166 + # DOCKER_TLS_CERTDIR: "" script: - curl -sSL https://get.docker.com/ | sh - python -m pip install -r requirements-dev.txt From 2942c99ce4380a7b132e3361ef23c953203a3c68 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 13 Aug 2020 13:58:14 +0100 Subject: [PATCH 05/21] docker tweaks --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19fae5d3..697e9fe4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,13 +3,13 @@ linux: image: python:3.8 services: - name: docker:dind - # entrypoint: ["env", "-u", "DOCKER_HOST"] - # command: ["dockerd-entrypoint.sh"] - # variables: - # DOCKER_HOST: tcp://docker:2375/ - # DOCKER_DRIVER: overlay2 - # # See https://github.com/docker-library/docker/pull/166 - # DOCKER_TLS_CERTDIR: "" + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + # See https://github.com/docker-library/docker/pull/166 + DOCKER_TLS_CERTDIR: "" script: - curl -sSL https://get.docker.com/ | sh - python -m pip install -r requirements-dev.txt From efa195802360c2d82dff83cec6fce8820b8dd68a Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 14 Aug 2020 09:51:30 +0000 Subject: [PATCH 06/21] Add a windows gitlab implementation --- .gitlab-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 697e9fe4..c67398e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,3 @@ - linux: image: python:3.8 services: @@ -14,3 +13,15 @@ linux: - curl -sSL https://get.docker.com/ | sh - python -m pip install -r requirements-dev.txt - python ./bin/run_tests.py + +windows: + tags: + - shared-windows + - windows + - windows-1809 + variables: + - PYTHON=C:\\Python36\\python + script: + - choco install python3 --version 3.6.8 --no-progress -y + - $PYTHON -m pip install -r requirements-dev.txt + - $PYTHON ./bin/run_tests.py From d36b2d35c6d9fbeee8c720597895718810b015c6 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 14 Aug 2020 11:42:25 +0100 Subject: [PATCH 07/21] fix PYTHON variable --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c67398e0..e6e4531b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ windows: - windows - windows-1809 variables: - - PYTHON=C:\\Python36\\python + PYTHON: C:\\Python36\\python script: - choco install python3 --version 3.6.8 --no-progress -y - $PYTHON -m pip install -r requirements-dev.txt From ac90f2b9ac7479006432c97a90df6c75e6eafec9 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 29 Aug 2020 21:29:01 +0100 Subject: [PATCH 08/21] Add CI example test script --- bin/run_example_ci_configs.py | 133 ++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100755 bin/run_example_ci_configs.py diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py new file mode 100755 index 00000000..d7b099e6 --- /dev/null +++ b/bin/run_example_ci_configs.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 + +import os +from pathlib import Path +import shutil +from subprocess import run +import sys +import textwrap +import time +import click +from collections import namedtuple +from urllib.parse import quote + + +def shell(cmd, **kwargs): + return run([cmd], shell=True, **kwargs) + + +def git_repo_has_changes(): + unstaged_changes = shell('git diff-index --quiet HEAD --').returncode != 0 + staged_changes = shell('git diff-index --quiet --cached HEAD --').returncode != 0 + return unstaged_changes or staged_changes + + +def generate_basic_project(path): + sys.path.insert(0, '') + from test.test_projects.c import new_c_project + + project = new_c_project() + project.generate(path) + + +CIService = namedtuple('CIService', 'name src_config_path dst_config_path badge_md') +services = [ + CIService( + name='appveyor', + src_config_path='examples/appveyor-minimal.yml', + dst_config_path='appveyor.yml', + badge_md='[![Build status](https://ci.appveyor.com/api/projects/status/wbsgxshp05tt1tif/branch/{branch}?svg=true)](https://ci.appveyor.com/project/joerick/cibuildwheel/branch/{branch})', + ), + CIService( + name='azure-pipelines', + src_config_path='examples/azure-pipelines-minimal.yml', + dst_config_path='azure-pipelines.yml', + badge_md='[![Build Status](https://dev.azure.com/joerick0429/cibuildwheel/_apis/build/status/joerick.cibuildwheel?branchName={branch})](https://dev.azure.com/joerick0429/cibuildwheel/_build/latest?definitionId=2&branchName={branch})', + ), + CIService( + name='circle-ci', + src_config_path='examples/circleci-minimal.yml', + dst_config_path='.circleci/config.yml', + badge_md='[![CircleCI](https://circleci.com/gh/joerick/cibuildwheel/tree/{branch_escaped}.svg?style=svg)](https://circleci.com/gh/joerick/cibuildwheel/tree/{branch})', + ), + CIService( + name='github', + src_config_path='examples/github-minimal.yml', + dst_config_path='.github/workflows/example.yml', + badge_md='![Build](https://github.com/joerick/cibuildwheel/workflows/Build/badge.svg?branch={branch})', + ), + CIService( + name='travis-ci', + src_config_path='examples/travis-ci-minimal.yml', + dst_config_path='.travis.yml', + badge_md='[![Build Status](https://travis-ci.org/joerick/cibuildwheel.svg?branch={branch})](https://travis-ci.org/joerick/cibuildwheel)', + ), + # CIService( + # name='gitlab', src_config_path='gitlab-minimal.yml', dst_config_path='.gitlab-ci.yml'), +] + + +@click.command() +def run_example_ci_configs(): + if git_repo_has_changes(): + print('Your git repo has uncommitted changes. Commit or stash before continuing.') + exit(1) + + previous_branch = shell('git rev-parse --abbrev-ref HEAD', + check=True, + capture_output=True, + encoding='utf8').stdout.strip() + + timestamp = time.strftime('%Y-%m-%dT%H-%M-%S', time.gmtime()) + branch_name = f'example-config-test---{previous_branch}-{timestamp}' + + try: + shell(f'git checkout --orphan {branch_name}', check=True) + + example_project = Path('example_root') + generate_basic_project(example_project) + + for service in services: + src_config_file = Path(service.src_config_path) + dst_config_file = example_project / service.dst_config_path + + dst_config_file.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(src_config_file, dst_config_file) + + run(['git', 'add', example_project], check=True) + run(['git', 'commit', '-m', textwrap.dedent(f''' + Test example minimal configs. + + Testing files: {[s.src_config_path for s in services]} + Generated from branch: {previous_branch} + Time: {timestamp} + ''')], check=True) + shell(f'git subtree --prefix={example_project} push origin {branch_name}', check=True) + + print('---') + print() + print('**Examples test run**') + print() + print(f'Branch: [{branch_name}](https://github.com/joerick/cibuildwheel/tree/{branch_name})') + print() + print('| Service | Config | Status |') + print('|---|---|---|') + for service in services: + badge = service.badge_md.format(branch=branch_name, branch_escaped=quote(branch_name, safe='')) + print(f'| {service.name} | {service.src_config_path} | {badge} |') + print() + print(f'Generated by `bin/run_example_ci_config.py`') + print() + print('---') + finally: + # remove any local changes + shutil.rmtree(example_project, ignore_errors=True) + shell('git checkout -- .') + shell(f'git checkout {previous_branch}', check=True) + shell(f'git branch -D --force {branch_name}', check=True) + + +if __name__ == '__main__': + os.chdir(os.path.dirname(__file__)) + os.chdir('..') + run_example_ci_configs(standalone_mode=True) From a4699f4cc848c55ed3935e3105912ab12219e727 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 30 Aug 2020 12:12:06 +0100 Subject: [PATCH 09/21] Fix flake8 error --- bin/run_example_ci_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py index d7b099e6..fd1f24a4 100755 --- a/bin/run_example_ci_configs.py +++ b/bin/run_example_ci_configs.py @@ -116,7 +116,7 @@ def run_example_ci_configs(): badge = service.badge_md.format(branch=branch_name, branch_escaped=quote(branch_name, safe='')) print(f'| {service.name} | {service.src_config_path} | {badge} |') print() - print(f'Generated by `bin/run_example_ci_config.py`') + print('Generated by `bin/run_example_ci_config.py`') print() print('---') finally: From 84446ed1a9576d1d75ef4fb372c1b9d6194599ea Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 18:52:20 +0100 Subject: [PATCH 10/21] Attempt a fix for the CircleCI minimal example --- examples/circleci-minimal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/circleci-minimal.yml b/examples/circleci-minimal.yml index a7e71c5a..f39a4d29 100644 --- a/examples/circleci-minimal.yml +++ b/examples/circleci-minimal.yml @@ -25,7 +25,7 @@ jobs: - run: name: Build the OS X wheels. command: | - pip3 install --user cibuildwheel==1.5.5 + pip3 install cibuildwheel==1.5.5 cibuildwheel --output-dir wheelhouse - store_artifacts: path: wheelhouse/ From 8e0ee0a4ab56bec9b7db2fb7f8142f3789f8f4a5 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 18:59:32 +0100 Subject: [PATCH 11/21] Improve script output formatting --- bin/run_example_ci_configs.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py index fd1f24a4..e2173dfd 100755 --- a/bin/run_example_ci_configs.py +++ b/bin/run_example_ci_configs.py @@ -54,7 +54,7 @@ services = [ name='github', src_config_path='examples/github-minimal.yml', dst_config_path='.github/workflows/example.yml', - badge_md='![Build](https://github.com/joerick/cibuildwheel/workflows/Build/badge.svg?branch={branch})', + badge_md='[![Build](https://github.com/joerick/cibuildwheel/workflows/Build/badge.svg?branch={branch})](https://github.com/joerick/cibuildwheel/actions)', ), CIService( name='travis-ci', @@ -96,7 +96,7 @@ def run_example_ci_configs(): run(['git', 'add', example_project], check=True) run(['git', 'commit', '-m', textwrap.dedent(f''' - Test example minimal configs. + Test example minimal configs Testing files: {[s.src_config_path for s in services]} Generated from branch: {previous_branch} @@ -106,17 +106,17 @@ def run_example_ci_configs(): print('---') print() - print('**Examples test run**') - print() - print(f'Branch: [{branch_name}](https://github.com/joerick/cibuildwheel/tree/{branch_name})') - print() - print('| Service | Config | Status |') - print('|---|---|---|') + print('> **Examples test run**') + print('> ') + print(f'> Branch: [{branch_name}](https://github.com/joerick/cibuildwheel/tree/{branch_name})') + print('> ') + print('> | Service | Config | Status |') + print('> |---|---|---|') for service in services: badge = service.badge_md.format(branch=branch_name, branch_escaped=quote(branch_name, safe='')) - print(f'| {service.name} | {service.src_config_path} | {badge} |') - print() - print('Generated by `bin/run_example_ci_config.py`') + print(f'> | {service.name} | `{service.src_config_path}` | {badge} |') + print('> ') + print('> Generated by `bin/run_example_ci_config.py`') print() print('---') finally: From 188eaa8a9359200c90845a5daa0b6bcff08a0724 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 19:32:45 +0100 Subject: [PATCH 12/21] Add gitlab config --- bin/run_example_ci_configs.py | 8 ++++++-- examples/gitlab-minimal.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 examples/gitlab-minimal.yml diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py index e2173dfd..91647098 100755 --- a/bin/run_example_ci_configs.py +++ b/bin/run_example_ci_configs.py @@ -62,8 +62,12 @@ services = [ dst_config_path='.travis.yml', badge_md='[![Build Status](https://travis-ci.org/joerick/cibuildwheel.svg?branch={branch})](https://travis-ci.org/joerick/cibuildwheel)', ), - # CIService( - # name='gitlab', src_config_path='gitlab-minimal.yml', dst_config_path='.gitlab-ci.yml'), + CIService( + name='gitlab', + src_config_path='gitlab-minimal.yml', + dst_config_path='.gitlab-ci.yml', + badge_md='[![Gitlab](https://gitlab.com/joerick/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/joerick/cibuildwheel/-/commits/{branch})' + ), ] diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml new file mode 100644 index 00000000..f6b1f856 --- /dev/null +++ b/examples/gitlab-minimal.yml @@ -0,0 +1,32 @@ +linux: + image: python:3.8 + # make a docker daemon available for cibuildwheel to use + services: + - name: docker:dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + # See https://github.com/docker-library/docker/pull/166 + DOCKER_TLS_CERTDIR: "" + script: + - curl -sSL https://get.docker.com/ | sh + - python -m pip install cibuildwheel + - cibuildwheel --output-dir wheelhouse + artifacts: + paths: + - wheelhouse/ + +windows: + tags: + - shared-windows + - windows + - windows-1809 + script: + - choco install python --version 3.8.5 + - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" + - cibuildwheel --output-dir wheelhouse + artifacts: + paths: + - wheelhouse/ From 734dea7526a18fadb66fa22b486792be30231635 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 19:34:00 +0100 Subject: [PATCH 13/21] Fix config path --- bin/run_example_ci_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run_example_ci_configs.py b/bin/run_example_ci_configs.py index 91647098..33f54de3 100755 --- a/bin/run_example_ci_configs.py +++ b/bin/run_example_ci_configs.py @@ -64,7 +64,7 @@ services = [ ), CIService( name='gitlab', - src_config_path='gitlab-minimal.yml', + src_config_path='examples/gitlab-minimal.yml', dst_config_path='.gitlab-ci.yml', badge_md='[![Gitlab](https://gitlab.com/joerick/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/joerick/cibuildwheel/-/commits/{branch})' ), From 5c5d1ef10ad6a66390bd074d7c30278e0a2677f2 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 20:44:25 +0100 Subject: [PATCH 14/21] Fix Gitlab Windows config --- examples/gitlab-minimal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index f6b1f856..597c728c 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -24,7 +24,7 @@ windows: - windows - windows-1809 script: - - choco install python --version 3.8.5 + - choco install python --version 3.8.5 -y - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" - cibuildwheel --output-dir wheelhouse artifacts: From 4433ea4de16d24cc51e983e67d4413d5a3e1f363 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 20:46:15 +0100 Subject: [PATCH 15/21] Add missing cibuildwheel install line --- examples/gitlab-minimal.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index 597c728c..4e788545 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -26,6 +26,7 @@ windows: script: - choco install python --version 3.8.5 -y - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" + - python -m pip install cibuildwheel - cibuildwheel --output-dir wheelhouse artifacts: paths: From 2fbaa3628619d830224b000f1f5887c88ede1cb7 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Mon, 31 Aug 2020 21:02:19 +0100 Subject: [PATCH 16/21] Use cmd syntax to change PATH --- examples/gitlab-minimal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index 4e788545..c5fa0adc 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -25,7 +25,7 @@ windows: - windows-1809 script: - choco install python --version 3.8.5 -y - - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" + - set PATH=C:\Python38;C:\Python38\Scripts;%PATH% - python -m pip install cibuildwheel - cibuildwheel --output-dir wheelhouse artifacts: From 10585d288275e4577b6331523a767a1ab817182e Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Tue, 1 Sep 2020 21:25:01 +0100 Subject: [PATCH 17/21] Use Powershell syntax for changing PATH --- examples/gitlab-minimal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index c5fa0adc..118b7b71 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -25,7 +25,7 @@ windows: - windows-1809 script: - choco install python --version 3.8.5 -y - - set PATH=C:\Python38;C:\Python38\Scripts;%PATH% + - $env:PATH="C:\Python38;C:\Python38\Scripts;$env:PATH" - python -m pip install cibuildwheel - cibuildwheel --output-dir wheelhouse artifacts: From 9a444b1ab8408ef967bbbd6dedb720b875bc28e6 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Tue, 1 Sep 2020 22:45:46 +0100 Subject: [PATCH 18/21] Install vcpython27 while working around the dotnet3.5 install error --- .gitlab-ci.yml | 9 +++++---- examples/gitlab-minimal.yml | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6e4531b..e8a2d6ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,9 +19,10 @@ windows: - shared-windows - windows - windows-1809 - variables: - PYTHON: C:\\Python36\\python script: + - choco install python2 vcredist2008 -f -y + - choco install --ignore-dependencies vcpython27 -f -y - choco install python3 --version 3.6.8 --no-progress -y - - $PYTHON -m pip install -r requirements-dev.txt - - $PYTHON ./bin/run_tests.py + - $env:PATH="C:\Python36;C:\Python36\Scripts;$env:PATH" + - python -m pip install -r requirements-dev.txt + - python ./bin/run_tests.py diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index 118b7b71..e1ac273c 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -24,7 +24,9 @@ windows: - windows - windows-1809 script: - - choco install python --version 3.8.5 -y + - choco install python2 vcredist2008 -f -y + - choco install --ignore-dependencies vcpython27 -f -y + - choco install python --version 3.8.5 -f -y - $env:PATH="C:\Python38;C:\Python38\Scripts;$env:PATH" - python -m pip install cibuildwheel - cibuildwheel --output-dir wheelhouse From c67da48510df552eb0a0084785042e5ff6eda7d6 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Wed, 2 Sep 2020 19:43:12 +0100 Subject: [PATCH 19/21] Remove Windows Gitlab support --- .gitlab-ci.yml | 13 ------------- examples/gitlab-minimal.yml | 16 ---------------- 2 files changed, 29 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8a2d6ab..7398bd3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,16 +13,3 @@ linux: - curl -sSL https://get.docker.com/ | sh - python -m pip install -r requirements-dev.txt - python ./bin/run_tests.py - -windows: - tags: - - shared-windows - - windows - - windows-1809 - script: - - choco install python2 vcredist2008 -f -y - - choco install --ignore-dependencies vcpython27 -f -y - - choco install python3 --version 3.6.8 --no-progress -y - - $env:PATH="C:\Python36;C:\Python36\Scripts;$env:PATH" - - python -m pip install -r requirements-dev.txt - - python ./bin/run_tests.py diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index e1ac273c..9444ee23 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -17,19 +17,3 @@ linux: artifacts: paths: - wheelhouse/ - -windows: - tags: - - shared-windows - - windows - - windows-1809 - script: - - choco install python2 vcredist2008 -f -y - - choco install --ignore-dependencies vcpython27 -f -y - - choco install python --version 3.8.5 -f -y - - $env:PATH="C:\Python38;C:\Python38\Scripts;$env:PATH" - - python -m pip install cibuildwheel - - cibuildwheel --output-dir wheelhouse - artifacts: - paths: - - wheelhouse/ From 6840c9cea12322b1deb6eb013c2f3ce74331588f Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Wed, 2 Sep 2020 19:53:03 +0100 Subject: [PATCH 20/21] Add docs for linux-only Gitlab CI --- README.md | 22 ++++++++++++---------- docs/setup.md | 13 +++++++++++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d79b548e..a3b2ce24 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ cibuildwheel Python wheels are great. Building them across **Mac, Linux, Windows**, on **multiple versions of Python**, is not. -`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports Azure Pipelines, Travis CI, AppVeyor, GitHub Actions and CircleCI - and it builds and tests your wheels across all of your platforms. +`cibuildwheel` is here to help. `cibuildwheel` runs on your CI server - currently it supports Azure Pipelines, Travis CI, AppVeyor, GitHub Actions, CircleCI, and Gitlab CI - and it builds and tests your wheels across all of your platforms. What does it do? @@ -18,17 +18,18 @@ What does it do? | | macOS x86_64 | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux i686 | manylinux aarch64 | manylinux ppc64le | manylinux s390x | |---|---|---|---|---|---|---|---|---| | CPython 2.7 | ✅ | ✅¹ | ✅¹ | ✅ | ✅ | | | | -| CPython 3.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | -| CPython 3.6 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | -| CPython 3.7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | -| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | -| CPython 3.9³ | 🛠 | 🛠 | 🛠 | 🛠 | 🛠 | 🛠 | 🛠 | | +| CPython 3.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅² | ✅³ | +| CPython 3.6 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅² | ✅³ | +| CPython 3.7 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅² | ✅³ | +| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | ✅² | ✅³ | +| CPython 3.9⁴ | 🛠 | 🛠 | 🛠 | 🛠 | 🛠 | 🛠² | 🛠² | | | PyPy 2.7 v7.3.0 | ✅ | | ✅ | ✅ | | | | | | PyPy 3.6 v7.3.0 | ✅ | | ✅ | ✅ | | | | | ¹ Not supported on Travis
-² Beta support until Travis CI fixes a bug
-³ Python 3.9 is not yet ABI stable, so you shouldn't publish wheels with it yet. But if you want to check that your wheels build on Python 3.9, try our [`python3.9` branch](https://github.com/joerick/cibuildwheel/pull/382)! +² Only supported on Travis
+³ Beta support until Travis CI fixes a bug
+⁴ Python 3.9 is not yet ABI stable, so you shouldn't publish wheels with it yet. But if you want to check that your wheels build on Python 3.9, try our [`python3.9` branch](https://github.com/joerick/cibuildwheel/pull/382)! - Builds manylinux, macOS and Windows wheels for CPython and PyPy using Azure Pipelines, Travis CI, AppVeyor, and CircleCI - Bundles shared library dependencies on Linux and macOS through [auditwheel](https://github.com/pypa/auditwheel) and [delocate](https://github.com/matthew-brett/delocate) @@ -37,7 +38,7 @@ What does it do? Usage ----- -`cibuildwheel` currently works on **Travis CI**, **Azure Pipelines**, **AppVeyor** and **GitHub Actions** to build wheels for all three supported platforms (Linux, macOS, Windows). On **CircleCI** Linux and macOS wheels can be built. +`cibuildwheel` currently works on **Travis CI**, **Azure Pipelines**, **AppVeyor**, **GitHub Actions**, **CircleCI**, and **Gitlab CI**. Check the table below for supported platforms on each service: | | Linux | macOS | Windows | |-----------------|-------|-------|---------| @@ -46,8 +47,9 @@ Usage | AppVeyor | ✅ | ✅ | ✅ | | GitHub Actions | ✅ | ✅ | ✅ | | CircleCI | ✅ | ✅ | | +| Gitlab CI | ✅ | | | -`cibuildwheel` is not intended to run on your development machine. Because it uses system Python from Python.org it will try to install packages globally - not what you expect from a build tool! Instead, isolated CI services like Travis CI, CircleCI, Azure Pipelines and AppVeyor are ideal. +`cibuildwheel` is not intended to run on your development machine. Because it uses system Python from Python.org it will try to install packages globally - not what you expect from a build tool! Instead, isolated CI services like those mentioned above are ideal. diff --git a/docs/setup.md b/docs/setup.md index 1ff2bc55..241bc4ea 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -66,6 +66,19 @@ Commit this file, enable building of your repo on CircleCI, and push. 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. +# 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. + # AppVeyor [linux/mac/windows] {: #appveyor} To build Linux, Mac, and Windows wheels on AppVeyor, create an `appveyor.yml` file in your repo. From c3caa5f26f63e80d40628cf7558fa828bc7f82c6 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 6 Sep 2020 16:58:13 +0100 Subject: [PATCH 21/21] Add maintainer tools docs --- docs/contributing.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index c3988004..52edf315 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -28,3 +28,39 @@ cibuildwheel doesn't really do anything itself - it's always deferring to other We're not responsible for errors in those tools, for fixing errors/crashes there. But cibuildwheel's job is providing users with an 'integrated' user experience across those tools. We provide an abstraction. The user says 'build me some wheels', not 'open the docker container, build a wheel with pip, fix up the symbols with auditwheel' etc. However, errors have a habit of breaking abstractions. And this is where users get confused, because the mechanism of cibuildwheel is laid bare, and they must understand a little bit how it works to debug. So, if we can, I'd like to improve the experience on errors as well. In [this](https://github.com/joerick/cibuildwheel/issues/139) case, it takes a bit of knowledge to understand that the linux builds are happening in a totally different OS via docker, that the linked symbols won't match, that auditwheel will fail because of this. A problem with how the tools fit together, instead of the tools themselves. + +Maintainer notes +---------------- + +## Testing minimal configs + +cibuildwheel's _minimal_ example configs can be tested on a simple project on cibuildwheel's existing CI. These should be run whenever the minimal configs change. + +To test minimal configs, make sure you have a clean git repo, then run the script: + + bin/run_example_ci_configs.py + +The script will create an isolated 'orphan' commit containing all the minimal config CI files, and a simple C extension project, and push that to a branch on the `origin` repo. The project's CI is already set up to run on branch push, so will begin testing. + +The script then outputs a Markdown table that can be copy/pasted into a PR to monitor and record the test. + +## Making a release + +Before making a release, ensure pinned dependencies are up-to-date. Run the script: + + bin/make_dependency_update_pr.py + +If updates are needed, this will push a PR with those updates for the CI to test. Once green, merge this PR. + +Then, increment the project version number using: + + bin/bump_version.py + +You'll be prompted to enter the new version number. Update the changelog when prompted. The script will create a 'bump version' commit and version tag. + +Finally, cut the release and upload to PyPI/Github. + + rm -rf dist + python setup.py sdist bdist_wheel + twine upload dist/* + git push && git push --tags