@@ -9,101 +9,103 @@ concurrency:
9
9
cancel-in-progress : true
10
10
11
11
jobs :
12
- build-non-linux-wheels :
13
- runs-on : ${{ matrix.os }}
12
+ build_wheels :
13
+ name : Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
14
+ runs-on : ${{ matrix.buildplat[0] }}
14
15
strategy :
16
+ # Ensure that a wheel builder finishes even if another fails
17
+ fail-fast : false
15
18
matrix :
16
- os : [macos-10.15, windows-latest]
17
- python-version : [3.7, 3.8, 3.9, "3.10"]
18
- name : Build CPython ${{ matrix.python-version }}-${{ matrix.os }}
19
+ # Github Actions doesn't support pairing matrix values together, let's improvise
20
+ # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
21
+ buildplat :
22
+ - [ubuntu-20.04, manylinux_x86_64]
23
+ - [macos-10.15, macosx_*]
24
+ - [windows-2019, win_amd64]
25
+ python : ["cp37", "cp38", "cp39", "cp310"]
26
+
19
27
steps :
20
- - uses : actions/checkout@v2
21
- - name : Setup Python
22
- uses : actions/setup-python@v2
28
+ - name : Checkout pymongoarrow
29
+ uses : actions/checkout@v2
23
30
with :
24
- python-version : ${{ matrix.python-version }}
25
- cache : ' pip'
26
- cache-dependency-path : ' **/setup.cfg'
31
+ fetch-depth : 0
32
+
33
+ - uses : actions/setup-python@v2
34
+
35
+ - name : Install cibuildwheel
36
+ run : python -m pip install "cibuildwheel>=2.4,<3"
37
+
38
+ - name : Build MacOS Py38 Wheel
39
+ if : ${{ matrix.python == 'cp38' && matrix.buildplat[0] == 'macos-10.15' }}
40
+ working-directory : ./bindings/python
41
+ shell : bash
42
+ env :
43
+ CIBW_BUILD : cp38-macosx_x86_64
44
+ MACOSX_DEPLOYMENT_TARGET : " 10.13"
45
+ run : python -m cibuildwheel --output-dir wheelhouse
46
+
27
47
- name : Build wheels
48
+ if : ${{ matrix.python != 'cp38' || matrix.buildplat[0] != 'macos-10.15' }}
28
49
working-directory : ./bindings/python
29
50
shell : bash
30
- run : |
31
- ./release.sh
51
+ env :
52
+ CIBW_BUILD : ${{ matrix.python }}-${{ matrix.buildplat[1] }}
53
+ MACOSX_DEPLOYMENT_TARGET : " 10.13"
54
+ run : python -m cibuildwheel --output-dir wheelhouse
55
+
32
56
- uses : actions/upload-artifact@v2
33
57
with :
34
- name : pymongoarrow- ${{ matrix.python-version }}-${{ matrix.os }}-wheel
35
- path : ./bindings/python/dist /*.whl
58
+ name : ${{ matrix.python }}-${{ startsWith( matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
59
+ path : ./bindings/python/wheelhouse /*.whl
36
60
if-no-files-found : error
37
- test-non-linux-wheels :
38
- needs : build-non-linux-wheels
39
- runs-on : ${{ matrix.os }}
40
- strategy :
41
- matrix :
42
- os : [macos-10.15, windows-latest]
43
- python-version : [3.7, 3.8, 3.9, "3.10"]
44
- name : Test CPython ${{ matrix.python-version }}-${{ matrix.os }}
61
+
62
+ make_sdist :
63
+ name : Make SDist
64
+ runs-on : ubuntu-latest
45
65
steps :
46
- - name : Setup Python
47
- uses : actions/setup-python@v2
66
+ - uses : actions/checkout@v2
48
67
with :
49
- python-version : ${{ matrix.python-version }}
50
- - name : Download a previously created wheel
51
- uses : actions/download-artifact @v2
68
+ fetch-depth : 0
69
+
70
+ - uses : actions/setup-python @v2
52
71
with :
53
- name : pymongoarrow-${{ matrix.python-version }}-${{ matrix.os }}-wheel
54
- - name : Test wheel
55
- shell : bash
72
+ # Build sdist on lowest supported Python
73
+ python-version : ' 3.7'
74
+
75
+ - name : Build SDist
76
+ working-directory : ./bindings/python
56
77
run : |
57
- python -m pip install -U pip
58
- python -m pip install *.whl
59
- python -c "from pymongoarrow.lib import process_bson_stream"
60
- # Linux
61
- build-manylinux-wheels :
62
- runs-on : ubuntu-latest
63
- strategy :
64
- matrix :
65
- # Cannot have '/' in artifact names, so hardcode 'quay.io/pypa/'
66
- container : ['manylinux2010_x86_64', 'manylinux2014_x86_64']
67
- python-version : ['cp37-cp37m', 'cp38-cp38',
68
- ' cp39-cp39' , 'cp310-cp310']
69
- name : Build CPython ${{ matrix.python-version }}-${{ matrix.container }}
70
- steps :
71
- - uses : actions/checkout@v2
72
- - name : Build wheels
78
+ set -ex
79
+ python -m pip install -U pip build
80
+ export LIBBSON_INSTALL_DIR="$(pwd)/libbson"
81
+ ./build-libbson.sh
82
+ python -m build --sdist .
83
+
84
+ - name : Test Sdist
73
85
working-directory : ./bindings/python
74
86
run : |
75
- docker run --rm --volume `pwd`:/python --workdir /python --env PLAT=${{ matrix.container }} --env PYTHON_BINARY=/opt/python/${{ matrix.python-version }}/bin/python quay.io/pypa/${{ matrix.container }} ./release.sh
87
+ export LIBBSON_INSTALL_DIR="$(pwd)/libbson"
88
+ python -m pip install dist/*.gz
89
+ cd ..
90
+ python -c "from pymongoarrow.lib import process_bson_stream"
91
+
76
92
- uses : actions/upload-artifact@v2
77
93
with :
78
- name : pymongoarrow-${{ matrix.python-version }}-${{ matrix.container }}-wheel
79
- path : ./bindings/python/wheelhouse/*.whl
80
- if-no-files-found : error
81
- test-manylinux-wheels :
82
- runs-on : ubuntu-latest
83
- needs : build-manylinux-wheels
84
- strategy :
85
- matrix :
86
- container : ['manylinux2010_x86_64', 'manylinux2014_x86_64']
87
- python-version : ['cp37-cp37m', 'cp38-cp38',
88
- ' cp39-cp39' , 'cp310-cp310']
89
- name : Test CPython ${{ matrix.python-version }}-${{ matrix.container }}
90
- steps :
91
- - name : Download a previously created wheel
92
- uses : actions/download-artifact@v2
93
- with :
94
- name : pymongoarrow-${{ matrix.python-version }}-${{ matrix.container }}-wheel
95
- - name : Test wheel
96
- run : |
97
- docker run --rm --volume `pwd`:/python quay.io/pypa/${{ matrix.container }} /bin/bash -c "/opt/python/${{ matrix.python-version }}/bin/python -m pip install -U pip && /opt/python/${{ matrix.python-version }}/bin/python -m pip install /python/*.whl && /opt/python/${{ matrix.python-version }}/bin/python -c 'from pymongoarrow.lib import process_bson_stream'"
98
- # Collect all built wheels
99
- collect-wheels :
94
+ name : " sdist"
95
+ path : ./bindings/python/dist/*.tar.gz
96
+
97
+ collect-dist :
100
98
runs-on : ubuntu-latest
101
- needs : [build-non-linux-wheels, build-manylinux-wheels ]
99
+ needs : [build_wheels, make_sdist ]
102
100
name : Download Wheels
103
101
steps :
104
102
- name : Download all workflow run artifacts
105
103
uses : actions/download-artifact@v2
104
+ - name : Flatten directory
105
+ run : |
106
+ find . -mindepth 2 -type f -exec mv {} . \;
107
+ find . -type d -empty -delete
106
108
- uses : actions/upload-artifact@v2
107
109
with :
108
- name : nix-wheels
109
- path : " *-wheel "
110
+ name : all-dist
111
+ path : " ./* "
0 commit comments