Skip to content

Commit

Permalink
Use uv to build manylinux wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Sep 7, 2024
1 parent 32a0e53 commit 7204cb2
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/wheel-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ jobs:
sparse-checkout: |
${{ env.BUILD_REQUIREMENTS_PATH }}
sparse-checkout-cone-mode: false
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/python -m venv .venv
- name: Install Python dependencies
run: .venv/bin/pip install --require-hashes -r ${{ env.BUILD_REQUIREMENTS_PATH }}

- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand All @@ -120,16 +117,12 @@ jobs:
PY_LIMITED_API="--config-settings=build-args=--features=pyo3/abi3-${{ matrix.PYTHON.ABI_VERSION }} --no-build-isolation"
fi
# `maturin` has a binary that needs to be on the $PATH, so we
# activate the venv.
source .venv/bin/activate
OPENSSL_DIR="/opt/pyca/cryptography/openssl" \
OPENSSL_STATIC=1 \
.venv/bin/python -m pip wheel -v --no-deps $PY_LIMITED_API cryptograph*.tar.gz -w dist/
mv dist/cryptography*.whl tmpwheelhouse
/opt/python/${{ matrix.PYTHON.VERSION }}/bin/uv build --wheel --build-constraint=$BUILD_REQUIREMENTS_PATH $PY_LIMITED_API cryptography*.tar.gz -o tmpwheelhouse/
env:
RUSTUP_HOME: /root/.rustup
- run: auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/cryptograph*.whl -w wheelhouse/
- run: auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/cryptography*.whl -w wheelhouse/
- run: unzip wheelhouse/*.whl -d execstack.check
- run: |
results=$(readelf -lW execstack.check/cryptography/hazmat/bindings/*.so)
Expand All @@ -139,15 +132,17 @@ jobs:
else
exit 0
fi
- run: .venv/bin/pip install cryptography --no-index -f wheelhouse/
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/uv venv
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/uv pip install --require-hashes -r $BUILD_REQUIREMENTS_PATH
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/uv install cryptography --no-index -f wheelhouse/
- run: |
.venv/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
- run: mkdir cryptography-wheelhouse
- run: mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: "cryptography-${{ github.event.inputs.version }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON.VERSION }}-${{ matrix.PYTHON.ABI_VERSION }}"
path: cryptography-wheelhouse/
path: wheelhouse/

macos:
needs: [sdist]
Expand Down Expand Up @@ -241,7 +236,7 @@ jobs:
source venv/bin/activate
OPENSSL_DIR="$(readlink -f ../openssl-macos-universal2/)" \
OPENSSL_STATIC=1 \
venv/bin/python -m pip wheel -v --no-deps $PY_LIMITED_API cryptograph*.tar.gz -w dist/
venv/bin/python -m pip wheel -v --no-deps $PY_LIMITED_API cryptography*.tar.gz -w dist/
mv dist/cryptography*.whl wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.PYTHON.DEPLOYMENT_TARGET }}
Expand Down

0 comments on commit 7204cb2

Please sign in to comment.