chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ru / ruff / package.nix
blobc760ebd8f336efa49d82f2c10e00abfe42f7dede
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   installShellFiles,
6   stdenv,
7   darwin,
8   rust-jemalloc-sys,
9   ruff-lsp,
10   nix-update-script,
11   versionCheckHook,
14 rustPlatform.buildRustPackage rec {
15   pname = "ruff";
16   version = "0.6.9";
18   src = fetchFromGitHub {
19     owner = "astral-sh";
20     repo = "ruff";
21     rev = "refs/tags/${version}";
22     hash = "sha256-O8iRCVxHrchBSf9kLdkdT0+oMi+5fLCAF9CMEsPrHqw=";
23   };
25   cargoLock = {
26     lockFile = ./Cargo.lock;
27     outputHashes = {
28       "lsp-types-0.95.1" = "sha256-8Oh299exWXVi6A39pALOISNfp8XBya8z+KT/Z7suRxQ=";
29       "salsa-0.18.0" = "sha256-zHXLNK6SCiJ3MmT0PMIauA1eolyJ4wfVWxN6wcvmhts=";
30     };
31   };
33   nativeBuildInputs = [ installShellFiles ];
35   buildInputs = [
36     rust-jemalloc-sys
37   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreServices ];
39   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
40     installShellCompletion --cmd ruff \
41       --bash <($out/bin/ruff generate-shell-completion bash) \
42       --fish <($out/bin/ruff generate-shell-completion fish) \
43       --zsh <($out/bin/ruff generate-shell-completion zsh)
44   '';
46   passthru = {
47     tests = {
48       inherit ruff-lsp;
49     };
50     updateScript = nix-update-script { };
51   };
53   # Failing on darwin for an unclear reason.
54   # According to the maintainers, those tests are from an experimental crate that isn't actually
55   # used by ruff currently and can thus be safely skipped.
56   checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
57     "--skip=changed_file"
58     "--skip=changed_metadata"
59     "--skip=changed_versions_file"
60     "--skip=deleted_file"
61     "--skip=directory_deleted"
62     "--skip=directory_moved_to_trash"
63     "--skip=directory_moved_to_workspace"
64     "--skip=directory_renamed"
65     "--skip=hard_links_in_workspace"
66     "--skip=hard_links_to_target_outside_workspace"
67     "--skip=move_file_to_trash"
68     "--skip=move_file_to_workspace"
69     "--skip=new_file"
70     "--skip=new_ignored_file"
71     "--skip=rename_file"
72     "--skip=search_path"
73     "--skip=unix::symlink_inside_workspace"
74   ];
76   nativeInstallCheckInputs = [
77     versionCheckHook
78   ];
79   versionCheckProgramArg = [ "--version" ];
80   doInstallCheck = true;
82   meta = {
83     description = "Extremely fast Python linter";
84     homepage = "https://github.com/astral-sh/ruff";
85     changelog = "https://github.com/astral-sh/ruff/releases/tag/${version}";
86     license = lib.licenses.mit;
87     mainProgram = "ruff";
88     maintainers = with lib.maintainers; [
89       figsoda
90       GaetanLepage
91     ];
92   };