nixpkgs/pkgs/by-name/py/pyrefly/package.nix
Benoit de Chezelles 0c8249f7ec pyrefly: 1.0.0 -> 1.1.1
(cherry picked from commit 60d1960984)
2026-06-22 03:13:40 +00:00

54 lines
1.2 KiB
Nix

{
lib,
bash,
replaceVars,
rustPlatform,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
rust-jemalloc-sys,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "pyrefly";
version = "1.1.1";
src = fetchFromGitHub {
owner = "facebook";
repo = "pyrefly";
tag = finalAttrs.version;
hash = "sha256-GHH+oG3oUEmGNEmtrmra321UIgRD04Eq1Ct0H7VsjxU=";
};
buildAndTestSubdir = "pyrefly";
cargoHash = "sha256-vOHcmYVKlsxueWjvCCDWwSfJt+2/71b5+NdQyW3jYH4=";
buildInputs = [ rust-jemalloc-sys ];
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
patches = [
(replaceVars ./fix-shebang.patch { bash = lib.getExe bash; })
];
# redirect tests writing to /tmp
preCheck = ''
export TMPDIR=$(mktemp -d)
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Fast type checker and IDE for Python";
homepage = "https://github.com/facebook/pyrefly";
license = lib.licenses.mit;
mainProgram = "pyrefly";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
cybardev
QuiNzX
];
};
})