{ lib, pkgs, fetchFromGitHub, buildPythonPackage, rustPlatform, callPackage, }: buildPythonPackage rec { pname = "uv-build"; version = "0.9.9"; pyproject = true; src = fetchFromGitHub { owner = "astral-sh"; repo = "uv"; tag = version; hash = "sha256-i9vdpHA9EfXmw5fhK1tTZG0T2zOlDbjPCGBIizvQzZw="; }; nativeBuildInputs = [ rustPlatform.cargoSetupHook rustPlatform.maturinBuildHook ]; cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; hash = "sha256-RZkIjHQElqrj+UAz+q6w1CYW3E5/YW9uy2E5KpKvw+w="; }; buildAndTestSubdir = "crates/uv-build"; # $src/.github/workflows/build-binaries.yml#L139 maturinBuildProfile = "minimal-size"; pythonImportsCheck = [ "uv_build" ]; # The package has no tests doCheck = false; # Run the tests of a package built by `uv_build`. passthru = { tests.built-by-uv = callPackage ./built-by-uv.nix { inherit (pkgs) uv; }; # updateScript is not needed here, as updating is done on staging }; meta = { description = "Minimal build backend for uv"; homepage = "https://docs.astral.sh/uv/reference/settings/#build-backend"; inherit (pkgs.uv.meta) changelog license; maintainers = with lib.maintainers; [ bengsparks ]; }; }