From 734f354d9dba71b8324aa54b2616eb374f2eda21 Mon Sep 17 00:00:00 2001 From: cybardev <50134239+cybardev@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:56:11 -0400 Subject: [PATCH] pyrefly: 0.44.2 -> 0.46.0 --- pkgs/by-name/py/pyrefly/fix-shebang.patch | 13 +++++++++++++ pkgs/by-name/py/pyrefly/package.nix | 19 +++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 pkgs/by-name/py/pyrefly/fix-shebang.patch diff --git a/pkgs/by-name/py/pyrefly/fix-shebang.patch b/pkgs/by-name/py/pyrefly/fix-shebang.patch new file mode 100644 index 000000000000..c2e62633b04a --- /dev/null +++ b/pkgs/by-name/py/pyrefly/fix-shebang.patch @@ -0,0 +1,13 @@ +diff --git a/pyrefly/lib/test/lsp/lsp_interaction/configuration.rs b/pyrefly/lib/test/lsp/lsp_interaction/configuration.rs +index edc2db09f..ce33a2774 100644 +--- a/pyrefly/lib/test/lsp/lsp_interaction/configuration.rs ++++ b/pyrefly/lib/test/lsp/lsp_interaction/configuration.rs +@@ -56,7 +56,7 @@ fn setup_dummy_interpreter(custom_interpreter_path: &Path) -> PathBuf { + // Create a mock Python interpreter script that returns the environment info + // This simulates what a real Python interpreter would return when queried with the env script + let python_script = format!( +- r#"#!/usr/bin/env bash ++ r#"#!@bash@ + if [[ "$1" == "-c" && "$2" == *"import json, sys"* ]]; then + cat << 'EOF' + {{"python_platform": "linux", "python_version": "3.12.0", "site_package_path": ["{site_packages}"]}} diff --git a/pkgs/by-name/py/pyrefly/package.nix b/pkgs/by-name/py/pyrefly/package.nix index d3691243be57..1f1608d7ff49 100644 --- a/pkgs/by-name/py/pyrefly/package.nix +++ b/pkgs/by-name/py/pyrefly/package.nix @@ -1,5 +1,7 @@ { lib, + bash, + replaceVars, rustPlatform, fetchFromGitHub, versionCheckHook, @@ -8,17 +10,17 @@ }: rustPlatform.buildRustPackage (finalAttrs: { pname = "pyrefly"; - version = "0.44.2"; + version = "0.46.0"; src = fetchFromGitHub { owner = "facebook"; repo = "pyrefly"; tag = finalAttrs.version; - hash = "sha256-d0aZQkCt2Yypj2CSav585M6TuoUEwPXpz1oKLjFo6NI="; + hash = "sha256-Owsma92bEwjyYFOb2AOzdLmAYIY398NrR9ztZ0bYhMc="; }; buildAndTestSubdir = "pyrefly"; - cargoHash = "sha256-gXKLzD5JbG62pc0pW5sRQJvBwr1ftu/ZOOXsQ7ZdWIU="; + cargoHash = "sha256-U3VlzjnsPmFlgaXdogqWOyJAv63vpPDULfcmcB5IHXc="; buildInputs = [ rust-jemalloc-sys ]; @@ -26,18 +28,15 @@ rustPlatform.buildRustPackage (finalAttrs: { versionCheckProgramArg = "--version"; doInstallCheck = true; + patches = [ + (replaceVars ./fix-shebang.patch { bash = lib.getExe bash; }) + ]; + # redirect tests writing to /tmp preCheck = '' export TMPDIR=$(mktemp -d) ''; - checkFlags = [ - # FIX: tracking on https://github.com/facebook/pyrefly/issues/1667 - "--skip=test::lsp::lsp_interaction::configuration::test_pythonpath_change" - "--skip=test::lsp::lsp_interaction::configuration::test_workspace_pythonpath_ignored_when_set_in_config_file" - "--skip=test::lsp::lsp_interaction::notebook_sync::test_notebook_publish_diagnostics" - ]; - # requires unstable rust features env.RUSTC_BOOTSTRAP = 1;