diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2022-01-05 15:18:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 16:18:14 -0500 |
commit | 871e21914d3ac57b121a0780a8645aa3f75a5ae3 (patch) | |
tree | 52c15dbf1955d2e0da14ef5b5d4ba955807baa4c | |
parent | d9c9892dad5843f8c9fab03249d4c6de2af38b13 (diff) | |
download | py-bcrypt-git-871e21914d3ac57b121a0780a8645aa3f75a5ae3.tar.gz |
circleci support for linux arm64 (#284)
-rwxr-xr-x | .circleci/build-wheel.sh | 33 | ||||
-rw-r--r-- | .circleci/config.yml | 97 | ||||
-rw-r--r-- | MANIFEST.in | 5 |
3 files changed, 133 insertions, 2 deletions
diff --git a/.circleci/build-wheel.sh b/.circleci/build-wheel.sh new file mode 100755 index 0000000..ebe745a --- /dev/null +++ b/.circleci/build-wheel.sh @@ -0,0 +1,33 @@ +#!/bin/bash -ex + +cd /test + +echo "Building for ${PLATFORM}" + +PYBIN="/opt/python/${PYTHON}/bin" + +mkdir -p /test/wheelhouse.final + +"${PYBIN}"/python -m venv .venv + +.venv/bin/pip install -U pip wheel cffi + +.venv/bin/python setup.py sdist +cd dist +tar zxf bcrypt*.tar.gz +rm -rf bcrypt*.tar.gz +cd bcrypt* + +REGEX="cp3([0-9])*" +if [[ "${PYBIN}" =~ $REGEX ]]; then + PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}" +fi + +../../.venv/bin/python setup.py bdist_wheel "$PY_LIMITED_API" + +auditwheel repair --plat "${PLATFORM}" -w wheelhouse/ dist/bcrypt*.whl + +../../.venv/bin/pip install bcrypt --no-index -f wheelhouse/ +../../.venv/bin/python -c "import bcrypt; password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)" + +mv wheelhouse/* /test/wheelhouse.final diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..afc8c00 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,97 @@ +version: 2.1 + +commands: + docker-pull: + parameters: + image: + type: string + steps: + - run: docker pull <<parameters.image>> + docker-run: + parameters: + image: + type: string + command: + type: string + steps: + - run: docker run -e PLATFORM -e PYTHON -v $(pwd):/test <<parameters.image>> /bin/bash -c 'cd /test;<<parameters.command>>' + +jobs: + linux-arm64: + machine: + image: ubuntu-2004:202111-01 + resource_class: arm.medium + parameters: + image: + type: string + toxenv: + type: string + steps: + - checkout + - docker-pull: + image: <<parameters.image>> + - docker-run: + image: <<parameters.image>> + command: tox -e <<parameters.toxenv>> + linux-arm64-wheel: + machine: + image: ubuntu-2004:202111-01 + resource_class: arm.medium + parameters: + image: + type: string + platform: + type: string + python: + type: string + environment: + PLATFORM: <<parameters.platform>> + PYTHON: <<parameters.python>> + steps: + - checkout + - docker-pull: + image: <<parameters.image>> + - docker-run: + image: <<parameters.image>> + command: /test/.circleci/build-wheel.sh + - store_artifacts: + path: wheelhouse.final + +workflows: + ci: + jobs: + - linux-arm64: + # Changing this name should only be done in conjunction with updating + # the required checks on GH + name: linux-arm64-ci + image: ghcr.io/pyca/cryptography-runner-ubuntu-focal:aarch64 + toxenv: py38 + # This makes sure it runs on all tags in addition to PRs/branches. + # By default CircleCI ignores tags. + filters: + tags: + only: /.*/ + - linux-arm64-wheel: + name: manylinux2014_aarch64-wheel + image: ghcr.io/pyca/cryptography-manylinux2014_aarch64:latest + python: cp36-cp36m + platform: manylinux2014_aarch64 + filters: + tags: + only: /.*/ + - linux-arm64-wheel: + name: manylinux_2_24_aarch64-wheel + image: ghcr.io/pyca/cryptography-manylinux_2_24:aarch64 + python: cp36-cp36m + platform: manylinux_2_24_aarch64 + filters: + tags: + only: /.*/ + - linux-arm64-wheel: + name: musllinux_1_1_aarch64-wheel + image: ghcr.io/pyca/cryptography-musllinux_1_1:aarch64 + python: cp36-cp36m + platform: musllinux_1_1_aarch64 + filters: + tags: + only: /.*/ diff --git a/MANIFEST.in b/MANIFEST.in index a4ec24c..53d7299 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,6 +8,7 @@ include src/build_bcrypt.py recursive-include src/_csrc * recursive-include tests *.py -exclude requirements.txt release.py .travis.yml mypy.ini +exclude requirements.txt release.py mypy.ini -prune .travis +recursive-exclude .github * +recursive-exclude .circleci * |