Skip to content

Commit 1fad7e4

Browse files
committed
Use uv to build manylinux wheels
refs pyca#11548
1 parent 10a0af4 commit 1fad7e4

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
@@ -106,9 +106,6 @@ jobs:
106106
sparse-checkout: |
107107
${{ env.BUILD_REQUIREMENTS_PATH }}
108108
sparse-checkout-cone-mode: false
109-
- run: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/python -m venv .venv
110-
- name: Install Python dependencies
111-
run: .venv/bin/pip install --require-hashes -r ${{ env.BUILD_REQUIREMENTS_PATH }}
112109

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

152147
macos:
153148
needs: [sdist]

0 commit comments

Comments
 (0)