Skip to content

Commit 76d99b5

Browse files
committed
Add optional pip testing to wheel smoketest
Adds test-pip input to wheel smoketest action and enables it for CPython linux builders. The pip testing is split into three steps (venv creation, installation, verification) to match the uv approach. Resolves #13456
1 parent 8e5f124 commit 76d99b5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

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

Lines changed: 29 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,28 @@ 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 cryptography wheel with pip
64+
if: inputs.test-pip == 'true'
65+
run: .venv-pip-test/bin/pip install cryptography --no-index -f wheelhouse/
66+
shell: bash
67+
68+
- name: Verify pip installation and OpenSSL version
69+
if: inputs.test-pip == 'true'
70+
run: |
71+
.venv-pip-test/bin/python - <<'EOF'
72+
from cryptography.hazmat.backends.openssl.backend import backend
73+
print(f"pip install - Loaded: {backend.openssl_version_text()}")
74+
print(f"pip install - Linked Against: {backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii')}")
75+
EOF
76+
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)