-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from sqreen/feature/plat-names
Build universal wheels
- Loading branch information
Showing
13 changed files
with
319 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
trigger: | ||
- master | ||
|
||
stages: | ||
- stage: build | ||
jobs: | ||
- job: linux | ||
displayName: Build on Linux | ||
pool: {vmImage: 'Ubuntu-16.04'} | ||
variables: | ||
plat_name: "manylinux1_x86_64" | ||
steps: | ||
- checkout: self | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '2.7', architecture: x64}} | ||
- script: | | ||
python3 -m pip install setuptools wheel | ||
mkdir wheelhouse | ||
python3 helpers/build_package.py wheel wheelhouse | ||
displayName: Build the Wheelhouse | ||
- script: | | ||
python3 -m pip install auditwheel | ||
for i in wheelhouse/*.whl; do auditwheel show $i; done | ||
displayName: Patch the Wheelhouse | ||
- script: | | ||
python -m pip install twine readme_renderer[md] | ||
twine check wheelhouse/*.whl | ||
displayName: Check the wheels | ||
- publish: wheelhouse | ||
- job: mac | ||
displayName: Build on macOS | ||
pool: {vmImage: 'macOS-10.14'} | ||
variables: | ||
plat_name: "macosx_10_9_x86_64" | ||
steps: | ||
- checkout: self | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '2.7', architecture: x64}} | ||
- script: | | ||
python3 -m pip install setuptools wheel | ||
mkdir wheelhouse | ||
python3 helpers/build_package.py wheel wheelhouse | ||
displayName: Build the wheelhouse | ||
- publish: wheelhouse | ||
- job: windows | ||
displayName: Build on Windows | ||
pool: {vmImage: 'vs2017-win2016'} | ||
variables: | ||
plat_name: "win_amd64" | ||
steps: | ||
- script: git config --global core.symlinks true | ||
- checkout: self | ||
- powershell: | | ||
Remove-Item C:\ProgramData\Chocolatey\bin\python2.7.exe -force | ||
Remove-Item C:\ProgramData\Chocolatey\bin\python2.exe -force | ||
displayName: Remove extraneous Python Interpreters | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '2.7', architecture: x64}} | ||
- bash: echo "##vso[task.prependpath]$(Build.SourcesDirectory)\\py_mini_racer\\extension\\depot_tools\\" | ||
- script: | | ||
python helpers/v8_build.py --target py_mini_racer_shared_lib | ||
cp py_mini_racer/extension/out/mini_racer.dll py_mini_racer/mini_racer.dll | ||
displayName: Build the extension | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- script: | | ||
python -m pip install wheel | ||
mkdir wheelhouse | ||
python setup.py bdist_wheel --dist-dir wheelhouse --python-tag py2.py3 --plat-name $(plat_name) | ||
displayName: Build the Wheelhouse | ||
- publish: wheelhouse | ||
- job: alpine | ||
displayName: Build on Alpine Linux | ||
pool: {vmImage: 'Ubuntu-16.04'} | ||
container: nicolassqreen/azure-pipelines-container-alpine-python:latest | ||
steps: | ||
- checkout: self | ||
- bash: python helpers/v8_build.py --no-build --no-sysroot | ||
displayName: Download V8 sources | ||
target: host | ||
- bash: | | ||
sudo apk add ninja llvm lld linux-headers | ||
cp -f /usr/local/bin/gn py_mini_racer/extension/v8/buildtools/linux64/gn | ||
rm -f py_mini_racer/extension/depot_tools/ninja | ||
displayName: Prepare Aline Linux build environment | ||
- bash: | | ||
python helpers/v8_build.py --no-update --no-sysroot --target py_mini_racer_shared_lib | ||
cp py_mini_racer/extension/out/libmini_racer.so py_mini_racer/libmini_racer.muslc.so | ||
displayName: Build the extension | ||
- bash: | | ||
/opt/python/cp36-cp36m/bin/python -m pip install wheel | ||
mkdir wheelhouse | ||
/opt/python/cp36-cp36m/bin/python setup.py bdist_wheel --dist-dir wheelhouse --python-tag py2.py3 --plat-name linux_x86_64 | ||
displayName: Build the Wheelhouse | ||
- bash: /opt/python/cp36-cp36m/bin/python setup.py sdist --dist-dir wheelhouse | ||
displayName: Build the source package | ||
- publish: wheelhouse | ||
|
||
- stage: test | ||
jobs: | ||
- job: linux | ||
displayName: Test on Linux | ||
pool: {vmImage: 'Ubuntu-16.04'} | ||
variables: | ||
plat_name: "manylinux1_x86_64" | ||
steps: | ||
- checkout: self | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- download: current | ||
artifact: build.linux | ||
- script: | | ||
python -m pip install $(Pipeline.Workspace)/build.linux/*.whl | ||
python -m pip install pytest | ||
pytest $(Build.SourcesDirectory)/tests | ||
displayName: Test the Wheel | ||
- job: mac | ||
displayName: Test on macOS | ||
pool: {vmImage: 'macOS-10.14'} | ||
variables: | ||
plat_name: "macosx_10_9_x86_64" | ||
steps: | ||
- checkout: self | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- download: current | ||
artifact: build.mac | ||
- script: | | ||
python -m pip install $(Pipeline.Workspace)/build.mac/*.whl | ||
python -m pip install pytest | ||
pytest $(Build.SourcesDirectory)/tests | ||
displayName: Test the Wheel | ||
- job: windows | ||
displayName: Test on Windows | ||
pool: {vmImage: 'vs2017-win2016'} | ||
variables: | ||
plat_name: "win_amd64" | ||
steps: | ||
- script: git config --global core.symlinks true | ||
- checkout: self | ||
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} | ||
- download: current | ||
artifact: build.windows | ||
- bash: | | ||
python -m pip install ../build.windows/*.whl | ||
python -m pip install pytest | ||
pytest tests | ||
displayName: Test the Wheel | ||
- job: alpine | ||
displayName: Test on Alpine Linux | ||
container: nicolassqreen/azure-pipelines-container-alpine-python:latest | ||
steps: | ||
- checkout: self | ||
- download: current | ||
artifact: build.alpine | ||
- bash: | | ||
sudo /opt/python/cp36-cp36m/bin/python -m pip install $(Pipeline.Workspace)/build.alpine/*.tar.gz | ||
sudo /opt/python/cp36-cp36m/bin/python -m pip install pytest | ||
/opt/python/cp36-cp36m/bin/pytest $(Build.SourcesDirectory)/tests | ||
displayName: Test the Source Dist | ||
- stage: release | ||
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/')) | ||
jobs: | ||
- job: release | ||
steps: | ||
- download: current | ||
- task: S3Upload@1 | ||
displayName: Publish Wheelhouse to S3 | ||
inputs: | ||
awsCredentials: AWS | ||
bucketName: sqreen-download-private | ||
globExpressions: | | ||
**/py_mini_racer-*.whl | ||
**/py_mini_racer-*.tar.gz | ||
targetFolder: python/py-mini-racer/ | ||
sourceFolder: $(Pipeline.Workspace) | ||
flattenFolders: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.