Merge pull request #314183 from Aleksanaa/uv

uv: build with python builder to include python module
This commit is contained in:
OTABI Tomoya 2024-05-24 22:22:23 +09:00 committed by GitHub
commit ba764c1184
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

@ -3,16 +3,19 @@
, darwin
, fetchFromGitHub
, installShellFiles
, libiconv
, openssl
, pkg-config
, python3Packages
, rustPlatform
, stdenv
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
python3Packages.buildPythonApplication rec {
pname = "uv";
version = "0.1.45";
pyproject = true;
src = fetchFromGitHub {
owner = "astral-sh";
@ -21,7 +24,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-PJeUndpD7jHcpM66dMIyXpDx95Boc01rzovS0Y7io7w=";
};
cargoLock = {
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"async_zip-0.0.17" = "sha256-Q5fMDJrQtob54CTII3+SXHeozy5S5s3iLOzntevdGOs=";
@ -33,14 +36,19 @@ rustPlatform.buildRustPackage rec {
cmake
installShellFiles
pkg-config
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
buildInputs = [
libiconv
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
dontUseCmakeConfigure = true;
cargoBuildFlags = [ "--package" "uv" ];
# Tests require network access
@ -58,6 +66,10 @@ rustPlatform.buildRustPackage rec {
--zsh <($out/bin/uv --generate-shell-completion zsh)
'';
pythonImportsCheck = [
"uv"
];
passthru.updateScript = nix-update-script { };
meta = with lib; {

@ -16576,6 +16576,10 @@ self: super: with self; {
utils = callPackage ../development/python-modules/utils { };
uv = toPythonModule (pkgs.uv.override {
python3Packages = self;
});
uvcclient = callPackage ../development/python-modules/uvcclient { };
uvicorn = callPackage ../development/python-modules/uvicorn { };