@@ -66,29 +66,36 @@ jobs:
66
66
fail_ci_if_error : true
67
67
68
68
package_wheels :
69
- name : Package wheels on ${{ matrix.os }}
70
69
needs : build
71
70
runs-on : ${{ matrix.os }}
72
71
strategy :
73
72
matrix :
74
- os : [ubuntu-latest, macOS -latest]
73
+ os : [ubuntu-latest, macos-latest, windows -latest]
75
74
python-build : [cp27*, cp37*, cp38*]
76
-
77
75
steps :
78
76
- uses : actions/checkout@v2
79
77
80
- # Used to host cibuildwheel
81
- - uses : actions/setup-python@v2
82
-
83
- - name : Install cibuildwheel
84
- run : python -m pip install cibuildwheel==1.10.0
78
+ # cibuildwheel 1.12.0 gates Python 2.7 wheels builds
79
+ # by using two environment variables, DISTUTILS_USE_SDK and MSSdk.
80
+ # https://cibuildwheel.readthedocs.io/en/1.x/cpp_standards/#windows-and-python-27
81
+ # Note that normally these are used by setuptools/distutils, but in our case
82
+ # they are really just used for cibuildwheel as we don't use any of the
83
+ # setuptools/distutils build tools. Our builds are entirely handled
84
+ # by CMake. CMake is able to find the right toolchain, thanks to
85
+ # the -A argument that we specify in the setup.py to set the
86
+ # target platform (x86, x64, etc).
87
+ - name : Set Windows Python 2.7 environment variables
88
+ if : matrix.python-build == 'cp27*' && runner.os == 'Windows'
89
+ shell : bash
90
+ run : |
91
+ echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
92
+ echo "MSSdk=1" >> $GITHUB_ENV
85
93
86
94
- name : Build wheels
87
- run : python -m cibuildwheel --output-dir wheelhouse
88
- # TODO: Solve for the 32-bit errors in windows python 2.7 :
89
- # https://github.com/pybind/cmake_example/blob/master/.github/workflows/wheels.yml#L66
95
+ uses : pypa/ cibuildwheel@v1.12.0
96
+ with :
97
+ output-dir : wheelhouse
90
98
env :
91
- CIBW_SKIP : cp27-win*
92
99
CIBW_BUILD : ${{ matrix.python-build }}
93
100
94
101
- uses : actions/upload-artifact@v2
0 commit comments