Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.11-beta 62 lines 1.4 kB view raw
1{ lib 2, rustPlatform 3, fetchFromGitHub 4, installShellFiles 5, stdenv 6, darwin 7, rust-jemalloc-sys 8 # tests 9, ruff-lsp 10}: 11 12rustPlatform.buildRustPackage rec { 13 pname = "ruff"; 14 version = "0.1.6"; 15 16 src = fetchFromGitHub { 17 owner = "astral-sh"; 18 repo = "ruff"; 19 rev = "refs/tags/v${version}"; 20 hash = "sha256-EX1tXe8KlwjrohzgzKDeJP0PjfKw8+lnQ7eg9PAUAfQ="; 21 }; 22 23 cargoHash = "sha256-ueWSBYXcdaxagjFjxfsImulOs0zVVqGHmfXp4pQLaMM="; 24 25 nativeBuildInputs = [ 26 installShellFiles 27 ]; 28 29 buildInputs = [ 30 rust-jemalloc-sys 31 ] ++ lib.optionals stdenv.isDarwin [ 32 darwin.apple_sdk.frameworks.CoreServices 33 ]; 34 35 cargoBuildFlags = [ "--package=ruff_cli" ]; 36 cargoTestFlags = cargoBuildFlags; 37 38 # tests expect no colors 39 preCheck = '' 40 export NO_COLOR=1 41 ''; 42 43 postInstall = '' 44 installShellCompletion --cmd ruff \ 45 --bash <($out/bin/ruff generate-shell-completion bash) \ 46 --fish <($out/bin/ruff generate-shell-completion fish) \ 47 --zsh <($out/bin/ruff generate-shell-completion zsh) 48 ''; 49 50 passthru.tests = { 51 inherit ruff-lsp; 52 }; 53 54 meta = with lib; { 55 description = "An extremely fast Python linter"; 56 homepage = "https://github.com/astral-sh/ruff"; 57 changelog = "https://github.com/astral-sh/ruff/releases/tag/v${version}"; 58 license = licenses.mit; 59 mainProgram = "ruff"; 60 maintainers = with maintainers; [ figsoda ]; 61 }; 62}