-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uv: Build as a standalone without Python
Using `buildPythonPackage` triggers dependency propagation, meaning that using `uv` with `nix-shell` results in a a shell with the `uv` Python input in it. This is problematic for development usage where you only want the one specified version. Often this design bug in the Python package builders is worked around by deleting `$out/nix-support/propagated-build-inputs`, but since `uv` is written in Rust and can be built without a Python interpreter so it's better to just build without a Python interpreter.
- Loading branch information
1 parent
f959feb
commit 09d02b9
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
buildPythonPackage, | ||
installShellFiles, | ||
pkg-config, | ||
rustPlatform, | ||
pkgs, | ||
}: | ||
|
||
buildPythonPackage { | ||
inherit (pkgs.uv) | ||
pname | ||
version | ||
src | ||
cargoDeps | ||
dontUseCmakeConfigure | ||
meta | ||
cargoBuildFlags | ||
postInstall | ||
versionCheckProgramArg | ||
; | ||
|
||
nativeBuildInputs = [ | ||
pkgs.cmake | ||
installShellFiles | ||
pkg-config | ||
rustPlatform.cargoSetupHook | ||
rustPlatform.maturinBuildHook | ||
]; | ||
|
||
pyproject = true; | ||
pythonImportsCheck = [ "uv" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters