11variables :
22 # https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/
3- # python2.7 + C++11(pybind11) is not available.
4- CIBW_SKIP : " cp27-win* pp27-win32 pp36-win32 "
3+ # cibuildwheel now supports python 3.6+(as of 2022 Oct)
4+ # CIBW_SKIP: "pp* "
55 CIBW_BEFORE_BUILD : " pip install pybind11"
6+ CIBW_ARCHS_LINUXBEFORE_BUILD : " pip install pybind11"
7+ # disable aarch64 build for a while since it(pulling docker aarch64 image) exceeds Azure's 60 min limit
8+ # NOTE: aarch64 linux support in Azure pipeline is not yet officially supported(as of 2022 Oct) https://github.com/microsoft/azure-pipelines-agent/issues/3935
9+ # CIBW_ARCHS_LINUX: auto aarch64
10+ CIBW_ARCHS_MACOS : x86_64 universal2 arm64
611 # CIBW_BEFORE_BUILD_MACOS: "pip install -U pip setuptools"
712 # CIBW_BEFORE_BUILD_LINUX: "pip install -U pip setuptools"
813 # CIBW_TEST_COMMAND: TODO "python -c \"import tinyobjloader; tinyobjloader.test()\""
2429 steps :
2530 - task : UsePythonVersion@0
2631 - script : |
27- pip install black==19.10b0
32+ # 19.10b0 triggers 'cannot import name '_unicodefun' from 'click'' error.
33+ # https://stackoverflow.com/questions/71673404/importerror-cannot-import-name-unicodefun-from-click
34+ #pip install black==19.10b0
35+ pip install black==22.3.0
36+
2837 black --check python/
2938 displayName: Check Python code format
3039
@@ -37,27 +46,25 @@ jobs:
3746 - bash : |
3847 python3 -m pip install --upgrade pip
3948 pip3 install cibuildwheel twine
40- # Make the header files available to the build.
41- cp *.h python
42- mkdir python/mapbox
43- cp mapbox/earcut.hpp python/mapbox/
44- cd python
49+
50+ # Use pipx to build source dist
51+ pip3 install pipx
4552
4653 # Source dist
47- python3 setup.py sdist
54+ pipx run build -- sdist
4855 ls -la dist/*
4956
5057 # build binary wheels
51- cibuildwheel --output-dir wheelhouse .
58+ cibuildwheel --platform linux -- output-dir wheelhouse .
5259
5360 - task : CopyFiles@2
5461 inputs :
55- contents : ' python/ wheelhouse/**'
62+ contents : ' wheelhouse/**'
5663 targetFolder : $(Build.ArtifactStagingDirectory)
5764
5865 - task : CopyFiles@2
5966 inputs :
60- contents : ' python/ dist/**'
67+ contents : ' dist/**'
6168 targetFolder : $(Build.ArtifactStagingDirectory)
6269
6370 - task : PublishBuildArtifacts@1
6673 artifactName : tinyobjDeployLinux
6774
6875 - job : macos
69- pool : {vmImage: 'macOS-10.15 '}
76+ pool : {vmImage: 'macOS-latest '}
7077 variables :
7178 # Support C++11: https://github.com/joerick/cibuildwheel/pull/156
7279 MACOSX_DEPLOYMENT_TARGET : 10.9
@@ -75,37 +82,27 @@ jobs:
7582 - bash : |
7683 python3 -m pip install --upgrade pip
7784 pip3 install cibuildwheel
78- # Make the header files available to the build.
79- cp *.h python
80- mkdir python/mapbox
81- cp mapbox/earcut.hpp python/mapbox/earcut.hpp
82- cd python
83- cibuildwheel --output-dir wheelhouse .
85+ cibuildwheel --platform macos --output-dir wheelhouse .
8486 - task : CopyFiles@2
8587 inputs :
86- contents : ' python/ wheelhouse/*.whl'
88+ contents : ' wheelhouse/*.whl'
8789 targetFolder : $(Build.ArtifactStagingDirectory)
8890 - task : PublishBuildArtifacts@1
8991 inputs :
9092 path : $(Build.ArtifactStagingDirectory)
9193 artifactName : tinyobjDeployMacOS
9294
9395 - job : windows
94- pool : {vmImage: 'windows-2019 '}
96+ pool : {vmImage: 'windows-latest '}
9597 steps :
9698 - task : UsePythonVersion@0
9799 - bash : |
98100 python -m pip install --upgrade pip
99101 pip install cibuildwheel
100- # Make the header files available to the build.
101- cp *.h python
102- mkdir python/mapbox
103- cp mapbox/earcut.hpp python/mapbox/
104- cd python
105- cibuildwheel --output-dir wheelhouse .
102+ cibuildwheel --platform windows --output-dir wheelhouse .
106103 - task : CopyFiles@2
107104 inputs :
108- contents : ' python/ wheelhouse/*.whl'
105+ contents : ' wheelhouse/*.whl'
109106 targetFolder : $(Build.ArtifactStagingDirectory)
110107 - task : PublishBuildArtifacts@1
111108 inputs :
@@ -114,7 +111,7 @@ jobs:
114111
115112 - job : deployPyPI
116113 # Based on vispy: https://github.com/vispy/vispy/blob/master/azure-pipelines.yml
117- pool : {vmImage: 'Ubuntu-16.04 '}
114+ pool : {vmImage: 'ubuntu-latest '}
118115 condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
119116 dependsOn :
120117 - linux
@@ -145,9 +142,9 @@ jobs:
145142 find .
146143 python -m pip install --upgrade pip
147144 pip install twine
148- echo tinyobjDeployLinux/python/ dist/*
149- echo tinyobjDeployLinux/python/ wheelhouse/* tinyobjDeployMacOS/python/ wheelhouse/* tinyobjDeployWindows/python /wheelhouse/*
150- twine upload -u "__token__" --skip-existing tinyobjDeployLinux/python/ dist/* tinyobjDeployLinux/python/ wheelhouse/* tinyobjDeployMacOS/python/ wheelhouse/* tinyobjDeployWindows/python /wheelhouse/*
145+ echo tinyobjDeployLinux/dist/*
146+ echo tinyobjDeployLinux/wheelhouse/* tinyobjDeployMacOS/wheelhouse/* tinyobjDeployWindows/wheelhouse/*
147+ twine upload -u "__token__" --skip-existing tinyobjDeployLinux/dist/* tinyobjDeployLinux/wheelhouse/* tinyobjDeployMacOS/wheelhouse/* tinyobjDeployWindows/wheelhouse/*
151148 env:
152149 TWINE_PASSWORD: $(pypiToken2)
153150
0 commit comments