Skip to content

Commit f523887

Browse files
alexclaude
andauthored
Add optional pip testing to wheel smoketest (#13834)
Adds test-pip input to wheel smoketest action and enables it for CPython linux builders. The pip testing is split into four steps (venv creation, build requirements installation, wheel installation, verification) to match the uv approach. Resolves #13456 Co-authored-by: Claude <[email protected]>
1 parent 8e5f124 commit f523887

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/actions/wheel-smoketest/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
build-requirements-path:
1010
description: 'Path to the build requirements file'
1111
required: true
12+
test-pip:
13+
description: 'Optional flag to also test installation with pip'
14+
required: false
15+
default: 'false'
1216

1317
runs:
1418
using: "composite"
@@ -45,3 +49,33 @@ runs:
4549
print(f"Linked Against: {backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii')}")
4650
EOF
4751
shell: bash
52+
53+
- name: Create virtual environment for pip testing
54+
if: inputs.test-pip == 'true'
55+
run: |
56+
if [ -n "${{ inputs.python-path }}" ]; then
57+
"${{ inputs.python-path }}" -m venv .venv-pip-test
58+
else
59+
python3 -m venv .venv-pip-test
60+
fi
61+
shell: bash
62+
63+
- name: Install build requirements with pip
64+
if: inputs.test-pip == 'true'
65+
run: .venv-pip-test/bin/pip install --require-hashes -r "${{ inputs.build-requirements-path }}"
66+
shell: bash
67+
68+
- name: Install cryptography wheel with pip
69+
if: inputs.test-pip == 'true'
70+
run: .venv-pip-test/bin/pip install cryptography --no-index -f wheelhouse/
71+
shell: bash
72+
73+
- name: Verify pip installation and OpenSSL version
74+
if: inputs.test-pip == 'true'
75+
run: |
76+
.venv-pip-test/bin/python - <<'EOF'
77+
from cryptography.hazmat.backends.openssl.backend import backend
78+
print(f"pip install - Loaded: {backend.openssl_version_text()}")
79+
print(f"pip install - Linked Against: {backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii')}")
80+
EOF
81+
shell: bash

.github/workflows/wheel-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
with:
169169
python-path: /opt/python/${{ matrix.PYTHON.VERSION }}/bin/python
170170
build-requirements-path: ${{ env.BUILD_REQUIREMENTS_PATH }}
171+
test-pip: ${{ startsWith(matrix.PYTHON.VERSION, 'cp') }}
171172

172173
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
173174
with:

0 commit comments

Comments
 (0)