Skip to content

Commit

Permalink
add azure pipelines wheel builder for bcrypt (#177)
Browse files Browse the repository at this point in the history
* add azure pipelines wheel builder for bcrypt

* fix manifest, remove jenkins
  • Loading branch information
reaperhulk authored and alex committed May 26, 2019
1 parent 8ce4bfa commit 61e8336
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 184 deletions.
160 changes: 160 additions & 0 deletions .azure-pipelines/wheel-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
trigger: none
pr: none

jobs:
- job: 'macOS'
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python27:
python.version: '2.7'
PYTHON_DOWNLOAD_URL: "https://www.python.org/ftp/python/2.7.16/python-2.7.16-macosx10.6.pkg"
PYTHON_BIN_PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin/python
Python3:
python.version: '3.4'
PYTHON_DOWNLOAD_URL: "https://www.python.org/ftp/python/3.7.3/python-3.7.3-macosx10.6.pkg"
PYTHON_BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
steps:
- script: |
set -e
set -x
curl "$PYTHON_DOWNLOAD_URL" -o python.pkg
sudo installer -pkg python.pkg -target /
displayName: Download and install Python
- script: $PYTHON_BIN_PATH -m pip install -U virtualenv
displayName: Install virtualenv
- script: $PYTHON_BIN_PATH -m virtualenv .venv
displayName: Create virtualenv
- script: .venv/bin/pip install -U wheel
displayName: Update wheel to the latest version
- script: .venv/bin/pip install cffi six
displayName: Install our Python dependencies

- script: |
set -e
set -x
REGEX="3\.([0-9])*"
if [[ "$PYTHON_VERSION" =~ $REGEX ]]; then
PY_LIMITED_API="--build-option --py-limited-api=cp3${BASH_REMATCH[1]}"
fi
.venv/bin/pip wheel bcrypt --no-use-pep517 --wheel-dir=wheelhouse --no-binary bcrypt --no-deps $PY_LIMITED_API
displayName: Build the wheel
- script: .venv/bin/pip install --no-index -f wheelhouse bcrypt
displayName: Test installing the wheel
- script: |
.venv/bin/python -c "import bcrypt;password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)"
displayName: Test the installed wheel
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: wheelhouse/
artifactName: bcrypt-macos-python$(python.version)

- job: 'manylinux1'
pool:
vmImage: 'ubuntu-16.04'
container: 'pyca/cryptography-manylinux1:x86_64'
strategy:
matrix:
Python27m:
PYTHON_VERSION: 'cp27-cp27m'
Python27mu:
PYTHON_VERSION: 'cp27-cp27mu'
Python3m:
PYTHON_VERSION: 'cp34-cp34m'
steps:
- script: /opt/python/$PYTHON_VERSION/bin/python -m virtualenv .venv
displayName: Create virtualenv
- script: .venv/bin/pip install cffi six
displayName: Install our Python dependencies
- script: |
set -e
set -x
REGEX="cp3([0-9])*"
if [[ "$PYTHON_VERSION" =~ $REGEX ]]; then
PY_LIMITED_API="--build-option --py-limited-api=cp3${BASH_REMATCH[1]}"
fi
.venv/bin/pip wheel bcrypt --no-use-pep517 --no-binary bcrypt --no-deps --wheel-dir=tmpwheelhouse $PY_LIMITED_API
displayName: Build the wheel
- script: auditwheel repair tmpwheelhouse/bcrypt*.whl -w wheelhouse/
displayName: Run auditwheel
- script: .venv/bin/pip install bcrypt --no-index -f wheelhouse/
displayName: Test installing the wheel
- script: |
.venv/bin/python -c "import bcrypt;password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)"
displayName: Test the installed wheel
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: wheelhouse/
artifactName: bcrypt-manylinux1-$(PYTHON_VERSION)

- job: 'windows'
pool:
vmImage: 'windows-2019'
container: $[variables.containerImage]
strategy:
matrix:
Python27-x86:
containerImage: 'pyca/cryptography-runner-windows:py27-x86'
PYTHON_VERSION: '27'
WINDOWS_ARCH: 'x86'
Python27-x86-64:
containerImage: 'pyca/cryptography-runner-windows:py27-x86_64'
PYTHON_VERSION: '27'
WINDOWS_ARCH: 'x86_64'
Python34-x86:
containerImage: 'pyca/cryptography-runner-windows:py34-x86'
PYTHON_VERSION: '34'
WINDOWS_ARCH: 'x86'
Python34-x86-64:
containerImage: 'pyca/cryptography-runner-windows:py34-x86_64'
PYTHON_VERSION: '34'
WINDOWS_ARCH: 'x86_64'
Python35-x86:
containerImage: 'pyca/cryptography-runner-windows:py35-x86'
PYTHON_VERSION: '35'
WINDOWS_ARCH: 'x86'
Python35-x86-64:
containerImage: 'pyca/cryptography-runner-windows:py35-x86_64'
PYTHON_VERSION: '35'
WINDOWS_ARCH: 'x86_64'
Python36-x86:
containerImage: 'pyca/cryptography-runner-windows:py3-x86'
PYTHON_VERSION: '36'
WINDOWS_ARCH: 'x86'
Python36-x86-64:
containerImage: 'pyca/cryptography-runner-windows:py3-x86_64'
PYTHON_VERSION: '36'
WINDOWS_ARCH: 'x86_64'
Python37-x86:
containerImage: 'pyca/cryptography-runner-windows:py3-x86'
PYTHON_VERSION: '37'
WINDOWS_ARCH: 'x86'
Python37-x86-64:
containerImage: 'pyca/cryptography-runner-windows:py3-x86_64'
PYTHON_VERSION: '37'
WINDOWS_ARCH: 'x86_64'
steps:
- script: '"C:/Python%PYTHON_VERSION%/Scripts/pip" install wheel cffi six'
displayName: Install wheel and our Python dependencies
- script: |
C:/Python%PYTHON_VERSION%/Scripts/pip wheel bcrypt --no-use-pep517 --wheel-dir=wheelhouse --no-binary bcrypt
displayName: Build the wheel
- script: '"C:/Python%PYTHON_VERSION%/Scripts/pip" install -f wheelhouse bcrypt --no-index'
displayName: Test installing the wheel
- script: |
"C:/Python%PYTHON_VERSION%/python" -c "import bcrypt;password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)"
displayName: Test the installed wheel
- script: mkdir bcrypt-wheelhouse
displayName: Create a directory for placing the final wheel in
- script: move wheelhouse\bcrypt*.whl bcrypt-wheelhouse\
displayName: Move the bcrypt wheel into the final wheel house
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: bcrypt-wheelhouse/
artifactName: bcrypt-windows-$(WINDOWS_ARCH)-python$(PYTHON_VERSION)
179 changes: 0 additions & 179 deletions .jenkins/Jenkinsfile-wheel-builder

This file was deleted.

8 changes: 3 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ include src/build_bcrypt.py
recursive-include src/_csrc *
recursive-include tests *.py

exclude requirements.txt tasks.py .travis.yml wheel-scripts Jenkinsfile azure-pipelines.yml
exclude requirements.txt tasks.py .travis.yml azure-pipelines.yml

exclude .jenkins
recursive-exclude .jenkins *

recursive-exclude wheel-scripts *
exclude .azure-pipelines
recursive-exclude .azure-pipelines *

prune .travis

0 comments on commit 61e8336

Please sign in to comment.