Skip to content

Commit e5c7145

Browse files
committed
📝 Update cibuildwheel
1 parent cb3ec1e commit e5c7145

File tree

3 files changed

+67
-101
lines changed

3 files changed

+67
-101
lines changed

docs/libs/.github/workflows/build_wheels.yml

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,16 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04, windows-2019, macos-11]
15+
# macos-13 is an intel runner, macos-14 is apple silicon
16+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920

2021
- name: Build wheels
21-
uses: pypa/cibuildwheel@v2.15.0
22+
uses: pypa/cibuildwheel@v2.21.3
2223

23-
- uses: actions/upload-artifact@v3
24+
- uses: actions/upload-artifact@v4
2425
with:
26+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
2527
path: ./wheelhouse/*.whl
26-
27-
make_sdist:
28-
name: Make SDist
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v3
32-
with:
33-
fetch-depth: 0 # Optional, use if you use setuptools_scm
34-
submodules: true # Optional, use if you have submodules
35-
36-
- name: Build SDist
37-
run: pipx run build --sdist
38-
39-
- uses: actions/upload-artifact@v3
40-
with:
41-
path: dist/*.tar.gz
42-
43-
upload_all:
44-
needs: [build_wheels, make_sdist]
45-
environment: pypi
46-
permissions:
47-
id-token: write
48-
runs-on: ubuntu-latest
49-
if: github.event_name == 'release' && github.event.action == 'published'
50-
steps:
51-
- uses: actions/download-artifact@v3
52-
with:
53-
name: artifact
54-
path: dist
55-
56-
- uses: pypa/gh-action-pypi-publish@release/v1

docs/libs/.gitlab-ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
linux:
2-
image: python:3.8
2+
image: python:latest
33
# make a docker daemon available for cibuildwheel to use
44
services:
55
- name: docker:dind
@@ -12,7 +12,7 @@ linux:
1212
DOCKER_TLS_CERTDIR: ""
1313
script:
1414
- curl -sSL https://get.docker.com/ | sh
15-
- python -m pip install cibuildwheel==2.15.0
15+
- python -m pip install cibuildwheel==2.21.3
1616
- cibuildwheel --output-dir wheelhouse
1717
artifacts:
1818
paths:
@@ -21,13 +21,25 @@ linux:
2121
windows:
2222
image: mcr.microsoft.com/windows/servercore:1809
2323
before_script:
24-
- choco install python -y --version 3.8.6
24+
- choco install python -y --version 3.12.4
2525
- choco install git.install -y
26-
- py -m pip install cibuildwheel==2.15.0
26+
- py -m pip install cibuildwheel==2.21.3
2727
script:
2828
- py -m cibuildwheel --output-dir wheelhouse --platform windows
2929
artifacts:
3030
paths:
3131
- wheelhouse/
3232
tags:
33-
- windows
33+
- saas-windows-medium-amd64
34+
35+
macos:
36+
image: macos-14-xcode-15
37+
before_script:
38+
- python3 -m pip install cibuildwheel==2.21.3
39+
script:
40+
- python3 -m cibuildwheel --output-dir wheelhouse
41+
artifacts:
42+
paths:
43+
- wheelhouse/
44+
tags:
45+
- saas-macos-medium-m1

docs/libs/cibuildwheel.rst

Lines changed: 44 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,85 +18,68 @@ Finally, the tests can also run against the wheels.
1818
* `Docs <https://cibuildwheel.pypa.io/>`_
1919
* `GitHub <https://github.com/pypa/cibuildwheel>`_
2020

21-
GitHub Actions
22-
--------------
21+
.. _cibuildwheel-in-gitlab-ci: GitLab CI/CD
2322

24-
To build Linux, macOS, and Windows wheels, create a
25-
:file:`.github/workflows/build_wheels.yml` file in your GitHub repo:
23+
.. tab:: GitHub Actions
2624

27-
.. literalinclude:: .github/workflows/build_wheels.yml
28-
:language: yaml
29-
:lines: 1-7
25+
To build Linux, macOS, and Windows wheels, create a
26+
:file:`.github/workflows/build_wheels.yml` file in your GitHub repo:
3027

31-
``workflow_dispatch``
32-
allows you to click a button in the graphical user interface to trigger a
33-
build. This is perfect for manually testing wheels before a release, as you
34-
can easily download them from *artifacts*.
28+
.. literalinclude:: .github/workflows/build_wheels.yml
29+
:caption: .github/workflows/build_wheels.yml
30+
:language: yaml
31+
:lines: 1-7
3532

36-
.. seealso::
37-
* `workflow_dispatch
38-
<https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/>`_
39-
40-
``release``
41-
is executed when a tagged version is transferred.
42-
43-
.. seealso::
44-
* `release
45-
<https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release>`_
46-
47-
Now the :term:`wheels <wheel>` can be built with:
33+
``workflow_dispatch``
34+
allows you to click a button in the graphical user interface to trigger
35+
a build. This is perfect for manually testing wheels before a release,
36+
as you can easily download them from *artifacts*.
4837

49-
.. literalinclude:: .github/workflows/build_wheels.yml
50-
:language: yaml
51-
:lines: 9-21
38+
.. seealso::
39+
* `workflow_dispatch
40+
<https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/>`_
5241

53-
This runs the CI workflow with the following default settings:
42+
``release``
43+
is executed when a tagged version is transferred.
5444

55-
* ``package-dir: .``
56-
* ``output-dir: wheelhouse``
57-
* ``config-file: "{package}/pyproject.toml"``
45+
.. seealso::
46+
* `release
47+
<https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release>`_
5848

59-
You can also extend the file to automatically upload the wheels to the
60-
:term:`Python Package Index` (:term:`PyPI`). For this, however, you should first
61-
create a :term:`source distribution`, for example with:
49+
Now the :term:`wheels <wheel>` can be built with:
6250

63-
.. literalinclude:: .github/workflows/build_wheels.yml
64-
:language: yaml
65-
:lines: 27-41
51+
.. literalinclude:: .github/workflows/build_wheels.yml
52+
:language: yaml
53+
:lines: 9-22
6654

67-
In addition, this GitHub workflow must be set in the PyPI settings of your
68-
project:
55+
This runs the CI workflow with the following default settings:
6956

70-
* `Creating a PyPI project with a trusted publisher
71-
<https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc>`_
72-
* `Adding a trusted publisher to an existing PyPI project
73-
<https://docs.pypi.org/trusted-publishers/adding-a-publisher>`_
57+
* ``package-dir: .``
58+
* ``output-dir: wheelhouse``
59+
* ``config-file: "{package}/pyproject.toml"``
7460

75-
Now you can finally upload the artefacts of both jobs to the :term:`PyPI`:
76-
77-
.. literalinclude:: .github/workflows/build_wheels.yml
78-
:language: yaml
79-
:lines: 43-
61+
.. seealso::
62+
* `Workflow syntax for GitHub Actions
63+
<https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions>`_
8064

81-
.. seealso::
82-
* `Workflow syntax for GitHub Actions
83-
<https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions>`_
65+
Now you can finally upload the artefacts of both jobs to the :term:`PyPI`:
8466

85-
.. _cibuildwheel-in-gitlab-ci:
67+
.. literalinclude:: .github/workflows/build_wheels.yml
68+
:language: yaml
69+
:lines: 24-
8670

87-
GitLab CI/CD
88-
------------
71+
.. tab:: GitLab CI/CD
8972

90-
To build Linux wheels with
91-
:doc:`Python4DataScience:productive/git/advanced/gitlab/ci-cd`, create a
92-
:file:`.gitlab-ci.yml` file in your repository:
73+
To build wheels for Linux, macOS, and Windows with
74+
:doc:`Python4DataScience:productive/git/advanced/gitlab/ci-cd`, create a
75+
:file:`.gitlab-ci.yml` file in your repository:
9376

94-
.. literalinclude:: .gitlab-ci.yml
95-
:language: yaml
77+
.. literalinclude:: .gitlab-ci.yml
78+
:language: yaml
9679

97-
.. seealso::
98-
* `Keyword reference for the .gitlab-ci.yml file
99-
<https://docs.gitlab.com/ee/ci/yaml/>`_
80+
.. seealso::
81+
* `Keyword reference for the .gitlab-ci.yml file
82+
<https://docs.gitlab.com/ee/ci/yaml/>`_
10083

10184
Options
10285
-------

0 commit comments

Comments
 (0)