nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 pkgs,
4 fetchFromGitHub,
5 buildPythonPackage,
6 rustPlatform,
7 callPackage,
8}:
9
10buildPythonPackage rec {
11 pname = "uv-build";
12 version = "0.9.26";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "astral-sh";
17 repo = "uv";
18 tag = version;
19 hash = "sha256-qvfMB62/0Hvc7m5h+QitvUcS6YZWAV1uGPg8JpCKPNU=";
20 };
21
22 nativeBuildInputs = [
23 rustPlatform.cargoSetupHook
24 rustPlatform.maturinBuildHook
25 ];
26
27 cargoDeps = rustPlatform.fetchCargoVendor {
28 inherit pname version src;
29 hash = "sha256-3ncKhauappl1MR3EG1bwYVrwhM7gCFRcRyRvYrsDaok=";
30 };
31
32 buildAndTestSubdir = "crates/uv-build";
33
34 # $src/.github/workflows/build-binaries.yml#L139
35 maturinBuildProfile = "minimal-size";
36
37 pythonImportsCheck = [ "uv_build" ];
38
39 # The package has no tests
40 doCheck = false;
41
42 # Run the tests of a package built by `uv_build`.
43 passthru = {
44 tests.built-by-uv = callPackage ./built-by-uv.nix { inherit (pkgs) uv; };
45
46 # updateScript is not needed here, as updating is done on staging
47 };
48
49 meta = {
50 description = "Minimal build backend for uv";
51 homepage = "https://docs.astral.sh/uv/reference/settings/#build-backend";
52 inherit (pkgs.uv.meta) changelog license;
53 maintainers = with lib.maintainers; [ bengsparks ];
54 };
55}