Repository navigation
fix: seed build's isolated env with the pinned pip - #3018
Conversation
build's virtualenv backend seeded its own bundled pip, ignoring the dependency constraints. On GraalPy 25.0, pip 26.2 (urllib3 2.7) cannot create an SSLContext, so builds failed even though pip is pinned for GraalPy. Set VIRTUALENV_PIP to the build venv's pip on macOS and Windows. Fixes pypa#2984. Assisted-by: ClaudeCode:claude-opus-5-5
On Windows, build uses the outer pip, so the isolated env has no pip. Assisted-by: ClaudeCode:claude-opus-5-5
|
Hm. Last time I checked this, VIRTUALENV_PIP had no effect on build. I think the behaviour depends on whether virtualenv is installed. But I think build doesn't have access to virtualenv in the venvs that cibuildwheel makes. |
|
This does fix GraalPy on macOS (tested before fixing). I was fixing #2984. 馃 AI text below 馃 It depends on the backend that build selects. build uses the outer pip with On macOS, we create the build venv with I checked locally with GraalPy 25.0.3 on macOS arm64. Without this change, the build fails with the #2984 |
|
I checked myself locally and you're right, VIRTUALENV_PIP does take effect. Not sure what was going on last year. Maybe I made a mistake, or there was a bug. |
|
Is it possible that this patch caused what looks like a regression in OpenAstronomy/github-actions-workflows#434 ? (please be warned, I will not read or reply to AI-generated responses) |
|
No, wasn't this one, it was #3017. |
馃 AI text below 馃
Fixes #2984.
With the
buildfrontend, build's isolated virtualenv seeds the pip that virtualenv bundles (26.2.2 now), not the pinned pip. pip 26.2 vendors urllib3 2.7.0, which importsssl.VERIFY_X509_PARTIAL_CHAINdirectly. GraalPy 25.0.x does not have this constant, so pip fails withTypeError: Can't create an SSLContext object without an ssl module. The GraalPy pin from #2955 only applies to cibuildwheel's own build venv, so it does not prevent this.This PR sets
VIRTUALENV_PIPto the build venv's pip version on macOS and Windows. A user-setVIRTUALENV_PIPstill takes priority. Linux is not changed: manylinux installsbuildwithout the virtualenv extra, and GraalPy there uses its own patched pip.The new test
test_build_isolated_env_pip_versionpinspip==25.3and checks the pip version inside build's isolated env. I ran the same project by hand ongp312_250-macosx_arm64. It fails without the fix (('26.2.2', '25.3')) and passes with it. I could not run the CPython test locally, because there are no python.org installs on this machine.