Reproducible Python virtual environment using uv
and nix
#1387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a draft aimed at producing a reproducible Python virtual environment.
uv
seems like the right tool for this because it has a lock file mechanism (but we could alternatively usepoetry
), andnix
would be my preferred choice for managing system dependencies (I’m not aware of many alternatives for pinning system dependencies, apart from possibly using a container with a pinned version of Alpine Linux?)This is still a draft, the
shell.nix
is currently too convoluted (and ultimately I would like to rather rely on uv2nix), and the goal of this PR is to enable the use of this environment in GitHub Action jobs! Using this setup in CI would help avoid non-reproducible issues, such as this one.n.b. that VLLM is currently broken on NixOS, debugging its derivation might be necessary at some point:
nix-build /nix/var/nix/profiles/per-user/root/channels/nixos/ --run-env -A python3Packages.vllm