diff options
Diffstat (limited to 'pkgs/by-name/uv/uv/package.nix')
-rw-r--r-- | pkgs/by-name/uv/uv/package.nix | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/pkgs/by-name/uv/uv/package.nix b/pkgs/by-name/uv/uv/package.nix index 77f775d3793ee..18e34d61fc2f4 100644 --- a/pkgs/by-name/uv/uv/package.nix +++ b/pkgs/by-name/uv/uv/package.nix @@ -3,29 +3,34 @@ , darwin , fetchFromGitHub , installShellFiles +, libiconv , openssl , pkg-config +, python3Packages , rustPlatform , stdenv +, testers +, uv , nix-update-script }: -rustPlatform.buildRustPackage rec { +python3Packages.buildPythonApplication rec { pname = "uv"; - version = "0.1.39"; + version = "0.2.11"; + pyproject = true; src = fetchFromGitHub { owner = "astral-sh"; repo = "uv"; - rev = version; - hash = "sha256-o5KrguapmfihO8oAse+LjBH9MvSsUORyZRALxkU4+xA="; + rev = "refs/tags/${version}"; + hash = "sha256-SkWhff9nYlbbzsXb9EWMzC0aKRU+LbJqClBddq1yl3Y="; }; - cargoLock = { + cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; outputHashes = { "async_zip-0.0.17" = "sha256-Q5fMDJrQtob54CTII3+SXHeozy5S5s3iLOzntevdGOs="; - "pubgrub-0.2.1" = "sha256-sqC7R2mtqymYFULDW0wSbM/MKCZc8rP7Yy/gaQpjYEI="; + "pubgrub-0.2.1" = "sha256-i1Eaip4J5VXb66p1w0sRjP655AngBLEym70ChbAFFIc="; }; }; @@ -33,18 +38,20 @@ rustPlatform.buildRustPackage rec { cmake installShellFiles pkg-config + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook ]; buildInputs = [ + libiconv openssl ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ]; - cargoBuildFlags = [ "--package" "uv" ]; + dontUseCmakeConfigure = true; - # Tests require network access - doCheck = false; + cargoBuildFlags = [ "--package" "uv" ]; env = { OPENSSL_NO_VENDOR = true; @@ -58,14 +65,23 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/uv --generate-shell-completion zsh) ''; - passthru.updateScript = nix-update-script { }; + pythonImportsCheck = [ + "uv" + ]; + + passthru = { + tests.version = testers.testVersion { + package = uv; + }; + updateScript = nix-update-script { }; + }; - meta = with lib; { - description = "An extremely fast Python package installer and resolver, written in Rust"; + meta = { + description = "Extremely fast Python package installer and resolver, written in Rust"; homepage = "https://github.com/astral-sh/uv"; changelog = "https://github.com/astral-sh/uv/blob/${src.rev}/CHANGELOG.md"; - license = with licenses; [ asl20 mit ]; - maintainers = with maintainers; [ GaetanLepage ]; + license = with lib.licenses; [ asl20 mit ]; + maintainers = with lib.maintainers; [ GaetanLepage ]; mainProgram = "uv"; }; } |