Repository navigation
Description
I think the use of requirements files with X.Y.Z pinned version constraints is good but not enough to ensure full reproducibility of the builds (there can be .post0 markers after the .Z component for instance). I think we should use an explicit lock file to manage:
- the cibuildwheel dependency itself (this will transitively lock the version of cibuildwheel's own dependencies as per the "pinned" policy documented in https://cibuildwheel.pypa.io/en/stable/options/#dependency-versions)
- the sdist build dependencies;
- the test dependencies.
The lockfile(s) should be automatically refreshed, e.g. on a monthly basis with a relative dependency cooldown policy of a week to reduce the exposure of the release process to ongoing OSS Supply Chain attacks.
The lockfile(s) in the release repo could either be managed via uv or pixi. I don't think it matters much because we don't need conda-forge for the build and testing process in this repo. All the Python-level builds dependencies are fetched from pypi.org and the rest come from the system image (e.g. manylinux). EDIT: actually we do fetch a fixed binary for libomp on macOS, so maybe we could use pixi and a lock file to do that more automatically.
When the lock files are updated, we should use relative dependency cooldowns such as uv's exclude-newer config or pixi's exlude-newer config).
Ideally, the build dependencies should also be locked explicitly in the repo as for the other dependencies. According to cibuildwheel's doc, the pip wheel command is used under the hood to setup the build env automatically. By default, it will install dependencies from the pyproject.toml file. However, it should be possible to pass an explicit pylock.toml export of a proper uv managed lockfile to pip wheel -r. Alternatively, we configure cibuildwheel's before-build hook to run a script to explicitly prepare the build environment manually using uv or pixi commands and disable build isolation and run pip wheel --no-build-isolation --no-deps.
Activity
agriyakhetarpal commentedon Jun 19, 2026
Hi! A small note; I think our docs are outdated – we actually have pypa/build as the default build frontend since v2.x, and we run
python -m build --wheelacross platforms, instead ofpip wheel. I think disabling build isolation will be neater indeed, so this would be viabuild-frontend = { name = "build", args = ["--no-isolation"] }(orbuild[uv]) and usingpip-compile/uv compileto have a lockfile of build-time dependencies exported beforehand and subsequently installed in the before-build stage, like you mention. I'll put together a PR to update that line and reflect this (I caught it thanks to you!).ogrisel commentedon Jun 22, 2026
Thanks very much for the feedback @agriyakhetarpal!
thomasjpfan commentedon Jul 9, 2026
For locking the build dependencies from scikit-learn's pyproject.toml, where do you think it should live? In the
scikit-learn/scikit-learn-releaserepo or thescikit-learn/scikit-learnrepo?rgommers commentedon Jul 10, 2026
I'm looking at adopting this approach for numpy and scipy as well. Quick thought about the question from Thomas: I'd like lock files to live in
-release, because an explicit goal is supply chain security through a fully self-contained publishing pipeline, with control over who has access (a smaller group than "all maintainers") and with full reproducibility controlled in a single, easy to audit repo. To me that means that all abstract build/runtime/test/etc. dependencies are defined as project-level metadata in the main repo, and all locking for wheel building happens in the release repo.ogrisel commentedon Jul 13, 2026
I agree, I think anything related to the release process should be done in the release repo.
thomasjpfan commentedon Jul 13, 2026
In that case, I think we'll need to create a new branch to release like https://github.com/scipy/scipy-release. Concretely:
scikit-learn/scikit-learn. This may update dependencies inpyproject.toml.scikit-learn-releaseand update build lock file that is consistent with the newpyproject.toml.scikit-learn-releaseon the branch that uses the lock file.andyfaff commentedon Aug 24, 2026
I've put something like this together for scipy, scipy/scipy-release#39.
lesteve commentedon Aug 24, 2026
Nice, thanks, I'll try to take a look at one point!