Skip to content

Commit 4c54d39

Browse files
authored
Use uv to build manylinux wheels (#11565)
refs #11548
1 parent 1c32edc commit 4c54d39

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

.github/workflows/wheel-builder.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ jobs:
107107
sparse-checkout: |
108108
${{ env.BUILD_REQUIREMENTS_PATH }}
109109
sparse-checkout-cone-mode: false
110-
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/python -m venv .venv
111-
- name: Install Python dependencies
112-
run: .venv/bin/pip install --require-hashes -r ${{ env.BUILD_REQUIREMENTS_PATH }}
113110

114111
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
115112
with:
@@ -118,19 +115,15 @@ jobs:
118115
- name: Build the wheel
119116
run: |
120117
if [ -n "${{ matrix.PYTHON.ABI_VERSION }}" ]; then
121-
PY_LIMITED_API="--config-settings=build-args=--features=pyo3/abi3-${{ matrix.PYTHON.ABI_VERSION }} --no-build-isolation"
118+
PY_LIMITED_API="--config-settings=build-args=--features=pyo3/abi3-${{ matrix.PYTHON.ABI_VERSION }}"
122119
fi
123120
124-
# `maturin` has a binary that needs to be on the $PATH, so we
125-
# activate the venv.
126-
source .venv/bin/activate
127121
OPENSSL_DIR="/opt/pyca/cryptography/openssl" \
128122
OPENSSL_STATIC=1 \
129-
.venv/bin/python -m pip wheel -v --no-deps $PY_LIMITED_API cryptograph*.tar.gz -w dist/
130-
mv dist/cryptography*.whl tmpwheelhouse
123+
uv build --python=/opt/python/${{ matrix.PYTHON.VERSION }}/bin/python --wheel --require-hashes --build-constraint=$BUILD_REQUIREMENTS_PATH $PY_LIMITED_API cryptography*.tar.gz -o tmpwheelhouse/
131124
env:
132125
RUSTUP_HOME: /root/.rustup
133-
- run: auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/cryptograph*.whl -w wheelhouse/
126+
- run: auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/cryptography*.whl -w wheelhouse/
134127
- run: unzip wheelhouse/*.whl -d execstack.check
135128
- run: |
136129
results=$(readelf -lW execstack.check/cryptography/hazmat/bindings/*.so)
@@ -140,15 +133,17 @@ jobs:
140133
else
141134
exit 0
142135
fi
143-
- run: .venv/bin/pip install cryptography --no-index -f wheelhouse/
136+
137+
- run: uv venv --python=/opt/python/${{ matrix.PYTHON.VERSION }}/bin/python
138+
- run: uv pip install --require-hashes -r $BUILD_REQUIREMENTS_PATH
139+
- run: uv pip install cryptography --no-index -f wheelhouse/
144140
- run: |
145-
.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'))"
146-
- run: mkdir cryptography-wheelhouse
147-
- run: mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
141+
echo "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'))" | uv run -
142+
148143
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
149144
with:
150145
name: "cryptography-${{ github.event.inputs.version }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON.VERSION }}-${{ matrix.PYTHON.ABI_VERSION }}"
151-
path: cryptography-wheelhouse/
146+
path: wheelhouse/
152147

153148
macos:
154149
needs: [sdist]

0 commit comments

Comments
 (0)