Skip to content

Commit 28bab4e

Browse files
committed
Use uv to build macos wheels
refs pyca#11548
1 parent 36edeb5 commit 28bab4e

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

‎.github/workflows/wheel-builder.yml‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,46 +222,44 @@ jobs:
222222
toolchain: stable
223223
# Add the arm64 target in addition to the native arch (x86_64)
224224
target: aarch64-apple-darwin
225-
- run: ${{ matrix.PYTHON.BIN_PATH }} -m venv venv
226-
- name: Install Python dependencies
227-
run: venv/bin/pip install --require-hashes -r ${{ env.BUILD_REQUIREMENTS_PATH }}
228-
229225
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
230226
with:
231227
name: cryptography-sdist
228+
229+
- run: ${{ matrix.PYTHON.BIN_PATH }} -m pip install uv
232230
- run: mkdir wheelhouse
233231
- name: Build the wheel
234232
run: |
235233
if [ -n "${{ matrix.PYTHON.ABI_VERSION }}" ]; then
236-
PY_LIMITED_API="--config-settings=build-args=--features=pyo3/abi3-${{ matrix.PYTHON.ABI_VERSION }} --no-build-isolation"
234+
PY_LIMITED_API="--config-settings=build-args=--features=pyo3/abi3-${{ matrix.PYTHON.ABI_VERSION }}"
237235
fi
238236
239237
# `maturin` has a binary that needs to be on the $PATH, so we
240238
# activate the venv.
241239
source venv/bin/activate
242240
OPENSSL_DIR="$(readlink -f ../openssl-macos-universal2/)" \
243241
OPENSSL_STATIC=1 \
244-
venv/bin/python -m pip wheel -v --no-deps $PY_LIMITED_API cryptograph*.tar.gz -w dist/
245-
mv dist/cryptography*.whl wheelhouse
242+
uv build --wheel -require-hashes --build-constraint=$BUILD_REQUIREMENTS_PATH $PY_LIMITED_API cryptography*.tar.gz -o wheelhouse/
246243
env:
247244
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.PYTHON.DEPLOYMENT_TARGET }}
248245
ARCHFLAGS: ${{ matrix.PYTHON.ARCHFLAGS }}
249246
_PYTHON_HOST_PLATFORM: ${{ matrix.PYTHON._PYTHON_HOST_PLATFORM }}
250-
- run: venv/bin/pip install -f wheelhouse/ --no-index cryptography
247+
248+
- run: uv venv
249+
- run: uv pip install --require-hashes -r $BUILD_REQUIREMENTS_PATH
250+
- run: uv pip install cryptography --no-index -f wheelhouse/
251251
- name: Show the wheel's minimum macOS SDK and architectures
252252
run: |
253-
find venv/lib/*/site-packages/cryptography/hazmat/bindings -name '*.so' -exec vtool -show {} \;
253+
find .venv/lib/*/site-packages/cryptography/hazmat/bindings -name '*.so' -exec vtool -show {} \;
254254
- run: |
255-
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'))"
255+
.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'))"
256256
257-
- run: mkdir cryptography-wheelhouse
258-
- run: mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
259257
- run: |
260-
echo "CRYPTOGRAPHY_WHEEL_NAME=$(basename $(ls cryptography-wheelhouse/cryptography*.whl))" >> $GITHUB_ENV
258+
echo "CRYPTOGRAPHY_WHEEL_NAME=$(basename $(ls wheelhouse/cryptography*.whl))" >> $GITHUB_ENV
261259
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
262260
with:
263261
name: "${{ env.CRYPTOGRAPHY_WHEEL_NAME }}"
264-
path: cryptography-wheelhouse/
262+
path: wheelhouse/
265263

266264
windows:
267265
needs: [sdist]

0 commit comments

Comments
 (0)